1.1.15 • Published 2 years ago

nhk-api-v2 v1.1.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

nhk-api-v2

NHK番組表APIのクライアントSDK(JavaScript)です

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • Package version: 1.1.15
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

インストール方法

npm i nhk-api-v2

サンプルコード

  1. npm i nhl-api-v2を実行してあなたのアプリケーションにnhk-api-v2を追加します
  2. example.jsを作成して以下のコードを入力します

    const NhkApiV2 = require('nhk-api-v2')
    
    const client = new NhkApiV2.Client('Your API Key')
    const area = '020' // 地域ID
    const service = 'tv' // サービスID
    
    client.getProgramsNowOnAir(area, service).then(function (data) {
      console.log('青森で現在放送中のテレビ番組: ' + JSON.stringify(data))
    }, function (error) {
      console.error(error)
    })
  3. NHK番組表APIで発行したAPI Keyを確認します image

  4. example.jsの3行目にあるYour API KeyをあなたのAPIキーに書き換えます
  5. example.jsを実行します

サンプルアプリ

以下のコマンドで同梱のサンプルアプリの動作を確認できます。 サンプルアプリのソースコードはexampleディレクトリにあります。

export NHK_API_KEY="Your Api Key"
npx -y nhk-api-v2 nhk-radio-now

movie

リクエストパラメータについて

Documentation for API Endpoints

All URIs are relative to https://api.nhk.or.jp/v2/pg

ClassMethodHTTP requestDescription
NhkApiV2.ProgramsApigetProgramInfoGET /info/{area}/{service}/{id}.json番組情報を取得します
NhkApiV2.ProgramsApigetProgramsGET /list/{area}/{service}/{date}.json番組リストを取得します
NhkApiV2.ProgramsApigetProgramsByGenreGET /genre/{area}/{service}/{genre}/{date}.json指定されたジャンルの番組リストを取得します
NhkApiV2.ProgramsApigetProgramsNowOnAirGET /now/{area}/{service}.json放送中の番組リストを取得します

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: key
  • Location: URL query string
1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago