公開API仕様

健常者エミュレータ事例集の投稿を、AIエージェント・外部クライアントから検索・取得するための公開API仕様です。 OpenAPI 3.1.0 準拠の機械可読版は /api/openapi.json から取得できます。

概要

  • バージョン: 1.0.0
  • ベースURL: https://healthy-person-emulator.org
  • 認証: 不要(全エンドポイント公開)
  • CORS: Access-Control-Allow-Origin: *
  • レスポンス形式: application/json; charset=utf-8
  • キャッシュ: Cache-Control: public, max-age=60, s-maxage=300

レート制限

明示的なレート制限はありませんが、Cloudflareにより異常なリクエストパターンは制限される可能性があります。 AIエージェントから大量に取得する場合は、postId ごとに数十ミリ秒の間隔を空けるなど、節度を持って利用してください。

共通エラーレスポンス

4xx系のエラーは全て以下の形式のJSONで返却されます。

フィールドnullable説明
errorstringエラーメッセージ

エンドポイント一覧

GET /api/posts/{postId}

個別投稿の本文(HTML)・コメント一覧・タグ・類似投稿・前後の投稿を取得します。

リクエスト

パスパラメータ

名前位置必須制約 / デフォルト説明
postIdpathinteger必須
最小: 1
投稿ID。正の整数。

リクエスト例

curl "https://healthy-person-emulator.org/api/posts/32172"

レスポンス

2xx 200 OK

Post オブジェクト。

フィールドnullable説明
postIdinteger投稿ID
postTitlestringタイトル
postUrlstring (uri)投稿の絶対URL
postDateGmtstring (date-time)投稿日時(ISO 8601, UTC)
postContentHtmlstring投稿本文(HTML形式。サイト上の表示と同じマークアップ)
commentStatusstringコメント受付状態(例: open, closed)
countLikesintegerいいね数
countDislikesinteger低評価数
countBookmarksintegerブックマーク数
countCommentsintegerコメント数
ogpImageUrlstring (uri)OGP画像のURL。未生成の場合は null
isWelcomedbooleanAIによるコンテンツフィルターの結果
isWelcomedExplanationstringAIによるコンテンツフィルターの判定理由
tagsTag[]紐づくタグ
commentsComment[]コメント一覧
similarPostsPostSummary[]類似した投稿
previousPostPostSummary前の投稿。先頭なら null
nextPostPostSummary次の投稿。末尾なら null

4xx 400 Bad Request

postId が正の整数でない場合(非数値・0以下など)。

{ "error": "postId must be a positive integer" }

4xx 404 Not Found

該当する postId の投稿が存在しない場合。

{ "error": "Post not found" }

GET /api/openapi.json

本APIのOpenAPI 3.1.0 仕様を機械可読なJSONで返します。 コード生成ツール(openapi-generator、orval等)やAIエージェントから直接読み込めます。

curl "https://healthy-person-emulator.org/api/openapi.json"

スキーマ定義

各エンドポイントで再利用される型の定義です。

SearchMetadata

フィールドnullable説明
querystringリクエストの q の値
countinteger総ヒット件数
pageinteger現在のページ番号(1始まり)
totalPagesinteger総ページ数
orderbyenum (timeDesc / timeAsc / like)適用された並び順
hasMoreboolean次ページが存在するか

TagCount

フィールドnullable説明
tagNamestringタグ名
countinteger件数

SearchHit

フィールドnullable説明
postIdinteger投稿ID
postTitlestringタイトル
postUrlstring (uri)投稿の絶対URL
postDateGmtstring (date-time)投稿日時(ISO 8601, UTC)
countLikesintegerいいね数
countDislikesinteger低評価数
countCommentsintegerコメント数
tagNamesstring[]紐づくタグ名

Tag

フィールドnullable説明
tagNamestringタグ名
tagIdintegerタグID

Comment

フィールドnullable説明
commentIdintegerコメントID
commentDateGmtstring (date-time)コメント投稿日時(ISO 8601, UTC)
commentAuthorstring投稿者名
commentContentstringコメント本文
likesCountintegerいいね数
dislikesCountinteger低評価数
commentParentinteger親コメントID(トップレベルは 0)

PostSummary

フィールドnullable説明
postIdinteger投稿ID
postTitlestringタイトル
postUrlstring (uri)投稿の絶対URL

Error

フィールドnullable説明
errorstringエラーメッセージ