GifBoomのWeb APIを調べたのでメモ。公開されてるものではないので使用は自己責任で。とりあえず便利そうなやつだけ。
レスポンスはすべてJSON形式で返ってくる。だいたいのAPIは認証なしで使える模様。
あるユーザーの投稿したGIF一覧を取得したい場合、まず/v1/users/searchでusernameからuser_idをとってきて、そのuser_idを使って/v1/feed/user_timelineにリクエストを投げればいい。
ユーザーを検索する。usernameからuser_idをとってくるのに使える。
パラメータ
- q - 検索するusername
- page (option)
用例
% curl "http://api.gifboom.com/v1/users/search?q=uiureo"
レスポンス
{
"paging" : {
"previous" : 1,
"next" : -1,
"current" : 1,
"pagesize" : 100
},
"data" : [
{
"cover_gif" : null,
"is_followed_by_me" : null,
"website" : null,
"relationship" : 0,
"_id" : "b6928290e037012fa591002590722d94",
"followings_count" : 39,
"public_pm" : true,
"avatar" : "http://medias.gifboom.com/assets/thumb_default.png",
"subscriber_count" : 0,
"age" : null,
"can_message" : false,
"is_verified" : null,
"cover" : null,
"items_count" : 33,
"is_following_me" : null,
"bio" : null,
"gender" : null,
"cover_audio" : null,
"is_official" : null,
"require_approval" : null,
"location" : null,
"followers_count" : 37,
"name" : "ウイウ",
"notification_settings" : 0,
"username" : "uiureo",
"cover_audio_duration" : null
}
]
}
ユーザーのタイムラインを取得する。ユーザーが投稿したGIFの一覧をとれる。
パラメータ
- user_id
- show (option) - feedonlyなどが指定できる。結果がどう変わるのかは不明。
- page (option)
用例
% curl "http://api.gifboom.com/v1/feed/user_timeline?user_id=b6928290e037012fa591002590722d94"
レスポンス
{
"paging" : {
"previous" : 1,
"next" : 2,
"current" : 1,
"pagesize" : 30
},
"data" : [
{
"medias" : [
{
"movie_width" : 480,
"width" : 240,
"_id" : "83736187e2c142f7abc61e592246c971",
"movie_url" : "http://medias.gifboom.com/medias/83736187e2c142f7abc61e592246c971.mp4",
"height" : 320,
"movie_height" : 640,
"size" : 275912,
"audio_duration" : null,
"audio_url" : null,
"thumb_url" : "http://medias.gifboom.com/medias/t_83736187e2c142f7abc61e592246c971.jpg",
"full_url" : "http://medias.gifboom.com/medias/[email protected]"
}
],
"country" : null,
"likes_count" : 3,
"location" : null,
"_id" : "5ff98cecfcbc4d7d94d0ba9762ccaade",
"categories" : [],
"state" : null,
"body" : "単振動する仏教僧の様子です",
"city" : null,
"created_at" : "2013-03-15T14:21:18Z",
"is_liked_by_me" : null,
"user" : {
"is_official" : null,
"_id" : "b6928290e037012fa591002590722d94",
"public_pm" : true,
"avatar" : "http://medias.gifboom.com/assets/thumb_default.png",
"name" : "ウイウ",
"can_message" : false,
"username" : "uiureo",
"cover" : null
},
"code" : "d79b3b54",
"comments_count" : 0,
"retweets_count" : 0
},
(...)
]
}
ユーザーのプロフィールを取得する。
用例
% curl "http://api.gifboom.com/v1/users/b6928290e037012fa591002590722d94"
レスポンス
{
"cover_gif" : null,
"is_followed_by_me" : null,
"website" : null,
"relationship" : 0,
"_id" : "b6928290e037012fa591002590722d94",
"followings_count" : 39,
"public_pm" : true,
"avatar" : "http://medias.gifboom.com/assets/thumb_default.png",
"subscriber_count" : 0,
"age" : null,
"can_message" : false,
"is_verified" : null,
"cover" : null,
"items_count" : 33,
"is_following_me" : null,
"bio" : null,
"gender" : null,
"cover_audio" : null,
"is_official" : null,
"require_approval" : null,
"location" : null,
"followers_count" : 37,
"name" : "ウイウ",
"notification_settings" : 0,
"username" : "uiureo",
"cover_audio_duration" : null,
"is_subscribed_by_me" : null
}
ユーザーがfollowしてる人の一覧を取得する。
パラメータ
- page (option)
用例
% curl "http://api.gifboom.com/v1/users/b6928290e037012fa591002590722d94/followings"
レスポンス
{
"paging" : {
"previous" : 1,
"next" : -1,
"current" : 1,
"pagesize" : 100
},
"data" : [
{
"cover_gif" : null,
"is_followed_by_me" : null,
"website" : null,
"relationship" : 0,
"_id" : "09db9fc0232a013075f30025907c3f54",
"followings_count" : 10,
"public_pm" : true,
"avatar" : "http://medias.gifboom.com/assets/thumb_default.png",
"subscriber_count" : 0,
"age" : null,
"can_message" : false,
"is_verified" : null,
"cover" : null,
"items_count" : 0,
"is_following_me" : null,
"bio" : null,
"gender" : null,
"cover_audio" : null,
"is_official" : null,
"require_approval" : null,
"location" : null,
"followers_count" : 8,
"name" : "チョウザメカジュアル.jp",
"notification_settings" : 0,
"username" : "a_halka",
"cover_audio_duration" : null
},
(...)
]
}
ユーザーのfollower一覧を取得する。
パラメータ
- page (option)
用例
followingとだいたい同じ。
人気のGIF一覧を取得する。
用例
% curl "http://api.gifboom.com/v1/feed/popular"
[
{
"medias" : [
{
"movie_width" : 480,
"width" : 240,
"_id" : "4244fe3a6b33481da1fce589176b665c",
"movie_url" : "http://medias.gifboom.com/medias/4244fe3a6b33481da1fce589176b665c.mp4",
"height" : 320,
"movie_height" : 640,
"size" : 315235,
"audio_duration" : null,
"audio_url" : null,
"thumb_url" : "http://medias.gifboom.com/medias/t_4244fe3a6b33481da1fce589176b665c.jpg",
"full_url" : "http://medias.gifboom.com/medias/4244fe3a6b33481da1fce589176b665c_large.gif"
}
],
"country" : null,
"likes_count" : 100,
"location" : null,
"_id" : "3388b95a6eb649a9b6223ec08a0f39a2",
"categories" : [],
"state" : null,
"body" : "My little brother helping me with this gif(: Like and Reboom <3",
"city" : null,
"created_at" : "2013-03-21T23:53:53Z",
"is_liked_by_me" : false,
"user" : {
"is_official" : null,
"_id" : "9a69fad0725d01304be200259078862d",
"public_pm" : true,
"avatar" : "http://medias.gifboom.com/uploads/thumb_0e127a3c076a4b21adde028ab9df95e8.jpg",
"name" : "Austin☁⚡❄",
"can_message" : true,
"username" : "austintheteen",
"cover" : "http://medias.gifboom.com/uploads/mini_62a6d9f1c8634ed08b5c2705b9c422a7.jpg"
},
"code" : "96160a4f",
"comments_count" : 7,
"retweets_count" : 19
},
(...)
]