ShangriLa Anime APIというAPIをこの前知った。秋葉原IT戦略研究所というところが無料で出しているらしいが、結構データが豊富で面白い。ここのサークルは以前の技術書典で本買った記憶がある。
が、ドキュメントが幾つか分散していたのでまとめメモ
共通仕様
ここで記述するAPIの共通仕様
- すべてGETパラメータ
- httpで書いているがhttpsでも取得可能
アニメ一覧取得
:yearは2018のような西暦が入る以下はhttp://api.moemoe.tokyo/anime/v1/master/2018 の取得例
[
{
"id": 673,
"title": "探偵オペラ ミルキィホームズ アルセーヌ 華麗なる欲望"
},
{
"id": 674,
"title": "アイドリッシュセブン"
},
{
"id": 675,
"title": "宇宙よりも遠い場所"
},
{
"id": 676,
"title": "ダメプリ ANIME CARAVAN"
},
{
"id": 677,
"title": "ラーメン大好き小泉さん"
},
{
"id": 678,
"title": "ゆるキャン△"
},
(略)
:yearのあとに1〜4の数字をつけるとクールごとに取得できる。こちらはタイトルに加えてURLやTwitterアカウントも取得できる。以下は http://api.moemoe.tokyo/anime/v1/master/2018/1 の例
[
{
"title_short2": "",
"twitter_account": "milkyholmes",
"public_url": "https://sp.bushiroad.com/special_tv/",
"title_short1": "ミルキィホームズ",
"sex": 0,
"twitter_hash_tag": "milkyholmes",
"id": 673,
"sequel": 5,
"created_at": "2018-01-07 20:29:38.0",
"city_name": "",
"cours_id": 17,
"title": "探偵オペラ ミルキィホームズ アルセーヌ 華麗なる欲望",
"city_code": 0,
"title_short3": "",
"updated_at": "2018-01-07 20:29:38.0"
},
{
"title_short2": "",
"twitter_account": "iD7Mng_Ogami",
"public_url": "http://idolish7.com/aninana/",
"title_short1": "アイドリッシュセブン",
"sex": 1,
"twitter_hash_tag": "アイナナ",
"id": 674,
"sequel": 0,
"created_at": "2018-01-07 20:29:38.0",
"city_name": "",
"cours_id": 17,
"title": "アイドリッシュセブン",
"city_code": 0,
"title_short3": "",
"updated_at": "2018-01-07 20:29:38.0"
},
{
"title_short2": "",
"twitter_account": "yorimoi",
"public_url": "http://yorimoi.com/",
"title_short1": "宇宙よりも遠い場所",
"sex": 0,
"twitter_hash_tag": "よりもい",
"id": 675,
"sequel": 0,
"created_at": "2018-01-07 20:29:38.0",
"city_name": "",
"cours_id": 17,
"title": "宇宙よりも遠い場所",
"city_code": 0,
"title_short3": "",
"updated_at": "2018-01-07 20:29:38.0"
},
{
"title_short2": "",
"twitter_account": "damepri_anime",
"public_url": "https://damepri-anime.jp/",
"title_short1": "ダメプリ",
"sex": 1,
"twitter_hash_tag": "ダメプリ",
"id": 676,
"sequel": 0,
"created_at": "2018-01-07 20:29:38.0",
"city_name": "",
"cours_id": 17,
"title": "ダメプリ ANIME CARAVAN",
"city_code": 0,
"title_short3": "",
"updated_at": "2018-01-07 20:29:38.0"
},
{
"title_short2": "小泉さん",
"twitter_account": "ramen_koizumi",
"public_url": "http://ramen-koizumi.com/",
"title_short1": "ラーメン大好き小泉さん",
"sex": 0,
"twitter_hash_tag": "ラーメン大好き小泉さん",
"id": 677,
"sequel": 0,
"created_at": "2018-01-07 20:29:38.0",
"city_name": "",
"cours_id": 17,
"title": "ラーメン大好き小泉さん",
"city_code": 0,
"title_short3": "",
"updated_at": "2018-01-07 20:29:38.0"
},
{
"title_short2": "",
"twitter_account": "yurucamp_anime",
"public_url": "http://yurucamp.jp/",
"title_short1": "ゆるキャン△",
"sex": 0,
"twitter_hash_tag": "ゆるキャン",
"id": 678,
"sequel": 0,
"created_at": "2018-01-07 20:29:38.0",
"city_name": "",
"cours_id": 17,
"title": "ゆるキャン△",
"city_code": 0,
"title_short3": "",
"updated_at": "2018-01-07 20:29:38.0"
},
Property |
Value |
Required |
description |
Sample |
id |
Number |
◯ |
APIで管理するアニメ作品に割り当てられているユニークなID |
125 |
title |
String |
◯ |
アニメ作品名 |
"冴えない彼女の育てかた" |
title_short1 |
String |
- |
アニメ作品名の略称1 |
"冴えカノ" |
title_short2 |
String |
- |
アニメ作品名の略称2 |
|
title_short3 |
String |
- |
アニメ作品名の略称3 |
|
public_url |
String |
◯ |
アニメ作品の公式URL |
"http://www.saenai.tv/" |
twitter_account |
String |
◯ |
ツイッターアカウント |
"saenai_heroine" |
twitter_hash_tag |
String |
◯ |
ツイッターハッシュタグ |
"saekano" |
cours_id |
Number |
◯ |
coursマスターのID |
5 |
created_at |
String |
◯ |
データの作成日時 |
"2015-01-08 09:37:01.0" |
updated_at |
String |
◯ |
データの更新日時 |
"2015-01-08 09:37:01.0" |
sex |
Number |
- |
男性向け=0, 女性向け=1 |
0 |
sequel |
Number |
- |
続編モノの場合は1以上の数値が入る |
0 |
取得したいTwitterのアカウントのスクリーンネーム(@以降のやつ)をaccountsパラメータで渡す。カンマ区切りで渡すと複数アカウントを一括で取得できる。以下は https://api.moemoe.tokyo/anime/v1/twitter/follower/status?accounts=usagi_anime,kinmosa_anime,nganime の取得例
// 20180503221210
// https://api.moemoe.tokyo/anime/v1/twitter/follower/status?accounts=usagi_anime,kinmosa_anime,nganime
{
"kinmosa_anime": {
"follower": 97431,
"updated_at": 1525274645
},
"usagi_anime": {
"follower": 305795,
"updated_at": 1525275187
},
"nganime": {
"follower": 138999,
"updated_at": 1525278006
}
}
:screen_nameにはTwitterのアカウント名が入る。こちらは複数不可
http://api.moemoe.tokyo/anime/v1/twitter/follower/history/daily?account=usagi_anime&days=30 のようにdaysをつけると取得にっすが増える。が最大39日前までっぽい。デフォルト7。
// 20180503222117
// http://api.moemoe.tokyo/anime/v1/twitter/follower/history/daily?account=usagi_anime&days=10
[
{
"follower": 305549,
"updated_at": 1524417182,
"yyyy-mm-dd": "2018-04-23"
},
{
"follower": 305605,
"updated_at": 1524503582,
"yyyy-mm-dd": "2018-04-24"
},
{
"follower": 305680,
"updated_at": 1524589982,
"yyyy-mm-dd": "2018-04-25"
},
{
"follower": 305697,
"updated_at": 1524676382,
"yyyy-mm-dd": "2018-04-26"
},
{
"follower": 305701,
"updated_at": 1524762782,
"yyyy-mm-dd": "2018-04-27"
},
{
"follower": 305729,
"updated_at": 1524849183,
"yyyy-mm-dd": "2018-04-28"
},
{
"follower": 305779,
"updated_at": 1524935583,
"yyyy-mm-dd": "2018-04-29"
},
{
"follower": 305796,
"updated_at": 1525021982,
"yyyy-mm-dd": "2018-04-30"
},
{
"follower": 305843,
"updated_at": 1525108382,
"yyyy-mm-dd": "2018-05-01"
},
{
"follower": 305806,
"updated_at": 1525194782,
"yyyy-mm-dd": "2018-05-02"
}
]