2012年5月5日土曜日

ニコニコ静画のAPI一覧

原宿版でしか使えないかもしれませんが、静画のAPIを調べてみました。
  1. タグ検索
タグ付け動画の連続再生時に使用するAPIが使えそうです。

http://seiga.nicovideo.jp/api/tagslide/data?page=[ページ数]&query=[タグ文字列]

[ページ数]は1からです。

レスポンスは下記です。


<response>

<image_count>838</image_count>

<image_list>

<image>

<id>2021276</id>

<user_id>769290</user_id>

<title>春に。</title>

<description>「みんな―――誰だって、綺麗に花を咲かせたがってるんです。」</description>

<comment_count>0</comment_count>

<view_count>12</view_count>

<clip_count>0</clip_count>

<source_name>Wさくら2.jpg</source_name>

<source_url/>

<category>1</category>

<genre>200</genre>

<category_tag_id>50</category_tag_id>

<image_type>1</image_type>

<illust_type>0</illust_type>

<anonymous_flag>0</anonymous_flag>

<public_status>0</public_status>

<inspection_status>1</inspection_status>

<mobile_flag>0</mobile_flag>

<delete_flag>0</delete_flag>

<delete_type>0</delete_type>

<summary/>

<cache_time/>

<last_info_updated/>

<last_comment_created/>

<last_clip_registered/>

<created>2012-05-04 18:08:32</created>

<updated>2012-05-04 21:42:14</updated>

<width>1280</width>

<height>1280</height>

<filesize>805260</filesize>

<hash>7cbc619b24b55af95575f7f47d4316e9cc2bee0c</hash>

<extension>jpeg</extension>

<animation_flag>0</animation_flag>

<last_replaced/>

<point_weight>100</point_weight>

<operation_adult_flag>0</operation_adult_flag>

<adult_level>0</adult_level>

<gro_level>0</gro_level>

<nickname>ふせ</nickname>
</image>

<image>
</image>
</image_list>

<comment_list>

<comment>

<comment_id>9002663</comment_id>

<id>9002663</id>

<image_id>2021008</image_id>

<res_id>0</res_id>

<content>あ~、いいっすね~</content>

<command/>

<created>2012-05-04 16:49:14</created>

<frame>-1</frame>

<user_hash>7HYVq9sRcLb/BmXJdZvDkMa7828</user_hash>

<anonymous_flag>1</anonymous_flag>
</comment>

<comment>



</comment>
</comment_list>
</response>

動画情報のほかにコメントも取得できますね。


  • ユーザID検索
http://seiga.nicovideo.jp/api/user/data?id=[ユーザID]

レスポンスはタグ検索と同じ

http://ext.seiga.nicovideo.jp/api/illust/blogparts?mode=user&key=[ユーザID]

レスポンスは下記。


<response>
<base_url>http://seiga.nicovideo.jp/</base_url>
<icon_url>http://seiga.nicovideo.jp/user/illust/10244556</icon_url>
<image_url>http://lohas.nicoseiga.jp/</image_url>
<image_list>
<image>
<id>2018397</id>
<cache_time/>
<title>自演その3</title>
<nickname>刃天</nickname>
</image>
<image>
</image>
</image_list>
</response>
  • 静画の画像データ
サムネイル
http://lohas.nicoseiga.jp/thumb/[動画番号]
http://lohas.nicoseiga.jp/img/[動画番号]

動画番号は頭の2文字の英字を除いた後ろの数字だけです。
末尾にそれぞれ下記のように文字をつけるとサイズを指定できます。
l : 大サイズ(800*600以下)
m : 中サイズ(320*240以下)
s : 小サイズ(96*72以下)

元動画
http://seiga.nicovideo.jp/image/source?id=[動画番号]

  • 新着RSS

  • 統計ベースの静画一覧
http://seiga.nicovideo.jp/illust/list/[下記参照]

image_created : 投稿の新しい順
image_created_a : 投稿の古い順
comment_created : コメントの新しい順
comment_created_a : コメントの古い順
clip_created : クリップ追加が新しい順
clip_created_a : クリップ追加が古い順
image_view : 閲覧数の多い順
image_view_a : 閲覧数の少ない順
comment_count : コメントの多い順
comment_count_a : コメントの少ない順
clip_count : クリップの多い順
clip_count_a : クリップの少ない順

取得されるのはHTMLベースですので、サムネイルのURL(http://lohas.nicoseiga.jp/thumb/[xxxxxxx]q?)を抽出すればいいと思います。

  • ランキング
http://ext.seiga.nicovideo.jp/api/illust/blogparts?mode=ranking&key=[①]%2c[②]

①期間

fresh : 新着
hourly : 毎時
daily : デイリー
weekly : 週間
monthly : 月間 
 total : 合計

②対象

all : カテゴリ合算
g_creation : 創作
original : オリジナル
portrait : 似顔絵
g_fanart : ファンアート
anime : アニメ
game : ゲーム
character : キャラクター
g_popular : 殿堂入り
toho : 東方
vocaloid : VOCALOID
r15 : R-15


  • 公開クリップ情報取得
http://ext.seiga.nicovideo.jp/api/illust/blogparts?mode=clip&key=[クリップ番号]


お題と漫画のほうはまた今度。。。

0 件のコメント:

コメントを投稿