JSON API 仕様

FTBucket は json_api.php を通じて、保持しているスレッド情報やファイルリストを取得する API を提供しています。

API 一覧

共通エンドポイント: json_api.php

action パラメータ 説明
readurlinfo url (必須) 指定されたURLのスレッドメタデータを取得します。
readallurl なし 保持している全スレッドのURLリストを取得します。
readallinfo なし 保持している全スレッドのメタデータを取得します。
readurlitemlist url (必須) 指定したスレッドが保持しているファイルの一覧を取得します。

詳細仕様: readurlinfo

指定されたURLのスレッドメタデータを取得します。

リクエスト

パラメータ:

パラメータ名 必須 説明
action 必須 readurlinfo 固定
url 必須 取得元のスレッドURL (URLエンコード推奨)

リクエスト例:

http:////json_api.php?action=readurlinfo&url=http%3A%2F%2Fmay.2chan.net%2Fb%2Fres%2F12345.htm

レスポンス

成功時はスレッドのメタデータを含むJSONオブジェクトを返します。

レスポンス例:

{
  "date": 1704067200,
  "title": "スピキスレ - 二次元裏@ふたば",
  "url": "http://may.2chan.net/b/res/12345.htm",
  "store_url": "cont/may.2chan.net_b_res_12345/index.htm",
  "thumb": "cont/may.2chan.net_b_res_12345/thumb/12345s.jpg",
  "res": "スピキスレ",
  "lost": 2,
  "ng": false,
  "du": 41786673,
  "res_count": 143,
  "first_date": 1704060000,
  "user_update": 1704067200,
  "tags": [
    [
      "虹裏may",
      ""
    ]
  ],
  "src1res_day": "24/01/01",
  "src1res_time": "12:00:00",
  "file_count": 72,
  "htmlhash": "cf6f2d603b625ebce08cf6cc582755136681f409",
  "mht_publish_path": "",
  "zip_publish_path": "https://storage.ftbucket.info/may.2chan.net_b_res_1378270610.zip",
  "user_ip": "",
  "user_host": "",
  "user_regid": "",
  "samefiles": []
}

レスポンスフィールド:

フィールド名 説明
date integer 最終更新日時 (UTC UnixTime)
title string スレッドタイトル
url string 取得元のふたばURL
store_url string 保存済み index.htm の相対パス
thumb string サムネイル画像の相対パス
res string 1レス目のテキスト本文
lost integer スレッドの状態 (0: 生存中, 1,2: スレ落ち済み)
ng boolean 更新中止フラグ
du integer ディスク使用量 (バイト)
res_count integer レス数
file_count integer ファイル数
life_time integer ライフタイム (秒)
first_date integer 初回登録日時 (UTC UnixTime)
user_update integer ユーザー更新日時 (UTC UnixTime)
tags array タグリスト
src1res_day string 1レス目の日付
src1res_time string 1レス目の時刻
htmlhash string index.htm のハッシュ値 (SHA1)
mht_publish_path string オブジェクトストレージ上の MHT 公開URL
zip_publish_path string オブジェクトストレージ上の ZIP 公開URL

詳細仕様: readallurl

保持している全スレッドのURLリストを取得します。

リクエスト

パラメータ:

パラメータ名 必須 説明
action 必須 readallurl 固定

リクエスト例:

http:////json_api.php?action=readallurl

レスポンス

成功時はホストしているスレッド取得元のふたばURL全件リスト(文字列配列)を返します。

レスポンス例:

[
  "http://dec.2chan.net/60/res/25413552.htm",
  "http://dec.2chan.net/60/res/25405843.htm"
]

詳細仕様: readallinfo

ホストしているすべてのスレッドメタデータを取得します。

リクエスト

パラメータ:

パラメータ名 必須 説明
action 必須 readallinfo 固定

リクエスト例:

http:////json_api.php?action=readallinfo

レスポンス

成功時はスレッドのメタデータを含むJSONオブジェクトを返します。 readurlinfo と同じ形式のデータが配列で返されます。

[
  {
    "date": 1704067200,
    "title": "スピキスレ - 二次元裏@ふたば",
    "url": "http://may.2chan.net/b/res/12345.htm",
    "store_url": "cont/may.2chan.net_b_res_12345/index.htm",
    "thumb": "cont/may.2chan.net_b_res_12345/thumb/12345s.jpg",
    "res": "スピキスレ",
    "lost": 2,
    "ng": false,
    "du": 41786673,
    "res_count": 143,
    "first_date": 1704060000,
    "user_update": 1704067200,
    "tags": [
      [
        "虹裏may",
        ""
      ]
    ],
    "src1res_day": "24/01/01",
    "src1res_time": "12:00:00",
    "file_count": 72,
    "htmlhash": "cf6f2d603b625ebce08cf6cc582755136681f409",
    "mht_publish_path": "",
    "zip_publish_path": "https://storage.ftbucket.info/may.2chan.net_b_res_1378270610.zip",
    "user_ip": "",
    "user_host": "",
    "user_regid": "",
    "samefiles": []
  }
]

詳細仕様: readurlitemlist

指定したスレッドが保持しているファイルの一覧を返します。 相対パスとホストしている絶対パスのペアのリストです。

リクエスト

エンドポイント: json_api.php

パラメータ:

パラメータ名 必須 説明
action 必須 readurlitemlist 固定
url 必須 取得元のスレッドURL (URLエンコード推奨)

リクエスト例:

https:////json_api.php?action=readurlitemlist&url=http%3A%2F%2Fimg.2chan.net%2Fb%2Fres%2F1389542254.htm

レスポンス

指定したスレッドが保持しているファイルの一覧を返します。 相対パスとホストしている絶対パスのペアのリストです。

[
  [
    "other/fu6125823.jpg",
    "http://<yourhost>/<path>/img.2chan.net_b_res_1389542254/other/fu6125823.jpg"
  ],
  [
    "other/index.htm.gz",
    "http://<yourhost>/<path>/img.2chan.net_b_res_1389542254/other/index.htm.gz"
  ],
  [
    "other/crawl.json",
    "http://<yourhost>/<path>/img.2chan.net_b_res_1389542254/other/crawl.json"
  ],
  [
    "img/1767529480899.jpg",
    "http://<yourhost>/<path>/img.2chan.net_b_res_1389542254/img/1767529480899.jpg"
  ],
  [
    "index.htm",
    "http://<yourhost>/<path>/img.2chan.net_b_res_1389542254/index.htm"
  ],
  [
    "thumb/1767529480899s.jpg",
    "http://<yourhost>/<path>/img.2chan.net_b_res_1389542254/thumb/1767529480899s.jpg"
  ],
  [
    "catalog.jpg",
    "http://<yourhost>/<path>/img.2chan.net_b_res_1389542254/catalog.jpg"
  ]
]