HTTP ステータスコードAPI
IANA に登録されている HTTP ステータスコード 62 種。日本語の説明つき。
| エンドポイント | https://apis-cloud.net/http-status |
| 件数 | 62 件 |
| 形式 | JSON(UTF-8) |
| 認証 | 不要(CORS 全オリジン許可) |
| ID フィールド | code(name でも引ける) |
| 検索対象 | name ja category description |
リクエスト
curl -s "https://apis-cloud.net/http-status/100"const res = await fetch("https://apis-cloud.net/http-status/100");
const data = await res.json();import urllib.request, json
with urllib.request.urlopen("https://apis-cloud.net/http-status/100") as r:
data = json.load(r)
レスポンス
200 OK
{
"code": 100,
"name": "Continue",
"ja": "継続",
"category": "情報",
"spec": "RFC 9110",
"description": "リクエストの前半を受理したので、クライアントは残りを送ってよい。"
}エンドポイント
HTTP ステータスコードAPIは、他のリソースと同じ共通の形をしている。 パラメータの詳しい説明は 共通エンドポイントの節 にある。
GET/http-status |
メタ情報(件数・フィールド・エンドポイント) | |
GET/http-status/all |
全62件 | |
GET/http-status/random |
ランダムに1件 | |
GET/http-status/search?q=Co |
部分一致検索 | |
GET/http-status/fields |
フィールド名の一覧 | |
GET/http-status/getCode |
code の列だけ取り出す | |
GET/http-status/100 |
ID 指定で1件 | |
GET/http-status/100/name |
1件の特定フィールド | |
全件取得
curl -s "https://apis-cloud.net/http-status/all?limit=3"const res = await fetch("https://apis-cloud.net/http-status/all?limit=3");
const data = await res.json();import urllib.request, json
with urllib.request.urlopen("https://apis-cloud.net/http-status/all?limit=3") as r:
data = json.load(r)フィールド
1レコードは次の 6 個のフィールドを持つ。値の例は実際の1件目から取っている。
codenumber | 100 |
namestring | Continue |
jastring | 継続 |
categorystring | 情報 |
specstring | RFC 9110 |
descriptionstring | リクエストの前半を受理したので、クライアントは残りを送ってよい。 |
必要な列だけ取得
curl -s "https://apis-cloud.net/http-status/all?fields=code,name&limit=3"const res = await fetch("https://apis-cloud.net/http-status/all?fields=code,name&limit=3");
const data = await res.json();import urllib.request, json
with urllib.request.urlopen("https://apis-cloud.net/http-status/all?fields=code,name&limit=3") as r:
data = json.load(r)使用例
GET/http-status/404 |
||
GET/http-status/418 |
||
GET/http-status/random |
||
GET/http-status/search?q=キャッシュ |
||
GET/http-status/all?fields=code,name |
||
ランダムに3件(seed 固定)
curl -s "https://apis-cloud.net/http-status/random?count=3&seed=demo"const res = await fetch("https://apis-cloud.net/http-status/random?count=3&seed=demo");
const data = await res.json();import urllib.request, json
with urllib.request.urlopen("https://apis-cloud.net/http-status/random?count=3&seed=demo") as r:
data = json.load(r)HTTP ステータスコードAPIのよくある質問
- HTTP ステータスコードの一覧はどう取得しますか?
- GET https://apis-cloud.net/http-status/all で全62件がJSONで返ります。1件だけ欲しいときは /http-status/random、ID を指定するときは /http-status/{code} を使います。
- HTTP ステータスコードAPIに認証は必要ですか?
- 不要です。API キーもトークンもなく、GET するだけで使えます。CORS も全オリジンに開けているのでブラウザから直接呼べます。
- HTTP ステータスコードAPIにはどんなフィールドがありますか?
- code、name、ja、category、spec、description の 6 個です。?fields= で必要な列だけに絞れます。検索は name、ja、category、description が対象です。