AC-API 追加データフォーマット

AC Data API の追加データフォーマット仕様。(ラジオ番組、ニュース、物販)

Data Provider に必要な Index API 仕様。

全API共通仕様

前提としての共通仕様の要約。 詳細は別紙。

API接続認証

以下をリクエストクエリに追加する。

?access_key={string}&sign={string}

access_key: サーバ管理者から払い出されたアクセスキー sign: サーバ管理者から払い出されたシークレットキーでAPIリクエストを署名したもの

Data API 仕様

共通仕様

リクエストフォーマット

GET /api/v0/data/{data_type}/{id_type}/{id}

日時の書式はISO 8601をURLエンコードする 2018-06-28T10%3A32%3A21%2B09%3A00

ex. https://example.com/api/v0/data/artist/acid/ACJP-AZZ-000-F0001-6

レスポンスフォーマット

ステータスコード

成功時 {content} には以下の項(ラジオ番組、ニュース、物販)の情報が入る

{
  "status": "succeeded",
  "request": {
    "uri": "{request_uri}"
  },
  "data": [
    {
      "indexer": "{indexer_url}",
      "provider": "{provider_url}",
      "published_at": "{published_datetime}",
      "expired_at": "{expired_datetime}",
      "body": "{content}"
    }
  ]
}

失敗時

{
  "status": "failed",
  "request": {
    "uri": "{request_uri}"
  },
  "error": {
    "message": "{error_message}"
  }
}

日時の書式はISO 8601 2018-06-28T10:32:21+09:00

ラジオ番組

入力はアーティストID(acid)、出力はラジオ番組情報

リクエスト

GET /api/v0/data/radio_event/acid/{acid}
?begun_at={datetime}&ended_at={datetime}&order={order}

ex. https://example.com/api/v0/data/radio_event/acid/ACJP-AZZ-000-F0001-6?begun_at=2021-01-13T00%3A00%3A00%2B09%3A00&ended_at=2021-01-14T00%3A00%3A00%2B09%3A00&order=asc

レスポンス

共通仕様の {content} の内容

Type: RadioBroadcastEvent https://schema.org/BroadcastEvent の独自派生

{
    "@context": "http://schema.org",
    "@type": "RadioBroadcastEvent",
    "identifier": {
        "@type": "PropertyValue",
        "propertyID": "radio_event_radiko",
        "value": "{id}"
    },
    "name": "{event_name}",
    "publishedOn": {
        "@type": "BroadcastService",
        "identifier": {
            "@type": "PropertyValue",
            "propertyID": "channel_radiko",
            "value":  "{id}"
        },
        "name": "{channel_name}"
    },
    "startDate": "{datetime}",
    "endDate": "{datetime}",
    "image": {
        "@type": "ImageObject",
        "contentUrl": "{image_url}"
    },
    "mainEntityOfPage": "{event_url}",
    "url": "{radiko_url}",
    "about": {
        "@type": "RadioEpisode",
        "identifier": {
            "@type": "PropertyValue",
            "propertyID": "radio_episode_radiko",
            "value":  "{id}"
        },
        "name": "{episode_name}",
        "partOfSeason": {
            "@type": "RadioSeason",
            "identifier": {
                "@type": "PropertyValue",
                "propertyID": "radio_season_radiko",
                "value":  "{id}"
            },
            "name": "{season_name}",
        },
        "partOfSeries": {
            "@type": "RadioSeries",
            "identifier": {
                "@type": "PropertyValue",
                "propertyID": "radio_series_radiko",
                "value":  "{id}"
            }
        }
    }
}

ニュース

入力はアーティストID(acid)、出力はニュース情報

リクエスト

GET /api/v0/data/news/acid/{acid}
?begun_at={datetime}&ended_at={datetime}&order={order}

ex. https://example.com/api/v0/data/news/acid/ACJP-AZZ-000-F0001-6?begun_at=2021-01-13T00%3A00%3A00%2B09%3A00&ended_at=2021-01-14T00%3A00%3A00%2B09%3A00&order=asc

レスポンス

共通仕様の {content} の内容

Type: https://schema.org/NewsArticle

{
    "@context": "http://schema.org",
    "@type": "NewsArticle",
    "identifier": {
        "@type": "PropertyValue",
        "propertyID": "news_barks",
        "value": "{id}"
    },
    "publisher": {
        "@type": "Organization",
        "identifier": {
            "@type": "PropertyValue",
            "propertyID": "news_publisher_ac",
            "value": "barks"
        },
        "name": "BARKS",
        "url": "https://www.barks.jp"
    },
    "headline": "{headline}",
    "articleBody": "{article_body}",
    "url": "{news_url}",
    "datePublished": "{datetime}",
    "image": [
        {
            "@type": "ImageObject",
            "contentUrl": "{image_url}"
        },
    ]
}

ex. json { "status": "succeeded", "request": { "uri": "/api/v0/data/news/acid/ACJP-AZZ-000-F0001-6?begun_at=2021-01-13T00%3A00%3A00%2B09%3A00&ended_at=2021-01-14T00%3A00%3A00%2B09%3A00&order=asc" }, "data": [ { "indexer": null, "provider": "https://example.com", "published_at": "2011-01-14T00:00:00+09:00", "expired_at": "2011-01-14T01:00:00+09:00", "body": { "@context": "http://schema.org", "@type": "NewsArticle", "identifier": { "@type": "PropertyValue", "propertyID": "news_barks", "value": "123456" }, "publisher": { "@type": "Organization", "identifier": { "@type": "PropertyValue", "propertyID": "news_publisher_ac", "value": "barks" }, "name": "BARKS", "url": "https://www.barks.jp" }, "headline": "記事タイトル1", "articleBody": "記事概要1", "url": "https://www.barks.jp/news/?id=123456", "datePublished": "2011-01-13T00:00:00+09:00", "image": [ { "@type": "ImageObject", "contentUrl": "https://img.barks.jp/image/review/123456/0.jpg" }, { "@type": "ImageObject", "contentUrl": "https://img.barks.jp/image/review/123456/1.jpg" } ] } }, { "indexer": null, "provider": "https://example.com", "published_at": "2011-01-14T00:00:00+09:00", "expired_at": "2011-01-14T01:00:00+09:00", "body": { "@context": "http://schema.org", "@type": "NewsArticle", "identifier": { "@type": "PropertyValue", "propertyID": "news_barks", "value": "123457" }, "publisher": { "@type": "Organization", "identifier": { "@type": "PropertyValue", "propertyID": "news_publisher_ac", "value": "barks" }, "name": "BARKS", "url": "https://www.barks.jp" }, "headline": "記事タイトル2", "articleBody": "記事概要2", "url": "https://www.barks.jp/news/?id=123457", "datePublished": "2011-01-13T01:00:00+09:00", "image": [ { "@type": "ImageObject", "contentUrl": "https://img.barks.jp/image/review/123457/0.jpg" }, { "@type": "ImageObject", "contentUrl": "https://img.barks.jp/image/review/123457/1.jpg" } ] } } ] }

物販

入力はアーティストID(acid)、出力は物販情報

リクエスト

GET /api/v0/data/product/acid/{acid}
?status={status}&per_page={per_page}&page={page}

(ソート方法はこの仕様では定めない)

ex. https://example.com/api/v0/data/product/acid/ACJP-AZZ-000-F0001-6?status=new&per_page=10&page=1

レスポンス

共通仕様の {content} の内容

Type: https://schema.org/Product

{
    "@context": "http://schema.org",
    "@type": "Product",
    "identifier": {
        "@type": "PropertyValue",
        "propertyID": "product_fanplus",
        "value": "{id}"
    },
    "name": "{product_name}",
    "brand": {
        "@type": "PerformingGroup",
        "identifier": {
            "@type": "PropertyValue",
            "propertyID": "acid",
            "value": "{id}"
        },
        "name": "{artist_name}"
    },
    "color": "{color}",
    "offers": {
        "@type": "Offer",
        "price": "{price}",
        "priceCurrency": "JPY"
    },
    "url": "{product_url}",
    "image": [
        {
            "@type": "ImageObject",
            "contentUrl": "{image_url}"
        },
    ],
    "description": "{description}"
}

ex. json { "status": "succeeded", "request": { "uri": "/api/v0/data/product/acid/ACJP-AZZ-000-F0001-6?status=recommended&per_page=10&page=1" }, "data": [ { "indexer": null, "provider": "https://example.com", "published_at": "2011-01-14T00:00:00+09:00", "expired_at": "2011-01-14T01:00:00+09:00", "body": { "@context": "http://schema.org", "@type": "Product", "identifier": { "@type": "PropertyValue", "propertyID": "product_fanplus", "value": "xxxxx-xxxx-xxxxx" }, "name": "商品名1", "brand": { "@type": "PerformingGroup", "identifier": { "@type": "PropertyValue", "propertyID": "acid", "value": "ACJP-AZZ-000-F0001-6" }, "name": "ベルリン・フィルハーモニー管弦楽団" }, "color": "ピンク", "offers": { "@type": "Offer", "price": "2800", "priceCurrency": "JPY" }, "url": "https://xxx.merchview.co.jp/xxx/xxxxx", "image": [ { "@type": "ImageObject", "contentUrl": "https://store.xxxx.jp/xxxxx/img1.png" }, { "@type": "ImageObject", "contentUrl": "https://store.xxxx.jp/xxxxx/img2.png" } ], "description": "説明文章1" } }, { "indexer": null, "provider": "https://example.com", "published_at": "2011-01-14T00:00:00+09:00", "expired_at": "2011-01-14T01:00:00+09:00", "body": { "@context": "http://schema.org", "@type": "Product", "identifier": { "@type": "PropertyValue", "propertyID": "product_fanplus", "value": "xxxxx-xxxx-xxxxy" }, "name": "商品名2", "brand": { "@type": "PerformingGroup", "identifier": { "@type": "PropertyValue", "propertyID": "acid", "value": "ACJP-AZZ-000-F0001-6" }, "name": "ベルリン・フィルハーモニー管弦楽団" }, "color": "白", "offers": { "@type": "Offer", "price": "2800", "priceCurrency": "JPY" }, "url": "https://xxx.merchview.co.jp/xxx/xxxxy", "image": [ { "@type": "ImageObject", "contentUrl": "https://store.xxxx.jp/xxxxy/img1.png" }, { "@type": "ImageObject", "contentUrl": "https://store.xxxx.jp/xxxxy/img2.png" } ], "description": "説明文章2" } } ] }

Index API 仕様

どんなデータが処理可能かのリストを返却する。 AC-API対応するためには必ず実装する必要があります。

共通仕様

リクエストフォーマット

GET /api/v0/index

ex. https://example.com/api/v0/index

レスポンスフォーマット

ステータスコード

成功時

{
  "status": "succeeded",
  "request": {
    "uri": "{request_uri}"
  },
  "data": [
    {
      "indexer": "{indexer_url}",
      "provider": "{provider_url}",
      "provider_type": "{provider_type}",
      "data_type": "{data_type}",
      "id_type": "{id_type}",
      "to_id_types": [
        "{id_type}"
      ],
      "search_keys": [
        "{search_key}"
      ]
    }
  ]
}

失敗時

{
  "status": "failed",
  "request": {
    "uri": "{request_uri}"
  },
  "error": {
    "message": "{error_message}"
  }
}

ラジオ番組

レスポンス

{
  "status": "succeeded",
  "request": {
    "uri": "/api/v0/index"
  },
  "data": [
    {
      "indexer": null,
      "provider": "{provider_url}",
      "provider_type": "data_provider",
      "data_type": "radio_event",
      "id_type": "acid",
      "to_id_types": null,
      "search_keys": [
          "begun_at", "ended_at", "order"
      ]
    }
  ]
}

ニュース

レスポンス

{
  "status": "succeeded",
  "request": {
    "uri": "/api/v0/index"
  },
  "data": [
    {
      "indexer": null,
      "provider": "{provider_url}",
      "provider_type": "data_provider",
      "data_type": "news",
      "id_type": "acid",
      "to_id_types": null,
      "search_keys": [
          "begun_at", "ended_at", "order"
      ]
    }
  ]
}

物販

レスポンス

{
  "status": "succeeded",
  "request": {
    "uri": "/api/v0/index"
  },
  "data": [
    {
      "indexer": null,
      "provider": "{provider_url}",
      "provider_type": "data_provider",
      "data_type": "product",
      "id_type": "acid",
      "to_id_types": null,
      "search_keys": [
          "status", "per_page", "page"
      ]
    }
  ]
}

(付録)追加語彙

リクエストデータタイプ

リクエストクエリ

レスポンスIDタイプ