{"openapi":"3.1.1","info":{"title":"smoking.today REST API","version":"1","description":"喫煙所と出典の読み取り、および選択式の現地報告の受け付け。v1では互換性を保って項目を追加します。未対応のメソッドは405、未定義のパスは404で、共通の Error 形式です。一覧はID昇順で、ページ間のスナップショットはありません。"},"servers":[{"url":"https://smoking.today"}],"externalDocs":{"description":"完全なAPI契約","url":"https://smoking.today/llms-full.txt"},"paths":{"/api/health":{"get":{"operationId":"getHealth","summary":"稼働確認","responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/api/spots":{"get":{"operationId":"listSpots","summary":"公開喫煙所一覧","responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"503":{"$ref":"#/components/responses/Unavailable"}},"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Area"},{"$ref":"#/components/parameters/Paper"},{"$ref":"#/components/parameters/Hours"}]}},"/api/spots/{id}":{"get":{"operationId":"getSpot","summary":"公開喫煙所の詳細","responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotDetail"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/Unavailable"}},"parameters":[{"$ref":"#/components/parameters/SpotId"}]}},"/api/spots/{id}/reports":{"post":{"operationId":"submitSpotReport","summary":"スポットの現地報告を受け付ける","description":"アカウント不要。同じスポットへの報告は同一端末または公開IPから24時間に1回。認められた報告は利用者報告として集計します。","parameters":[{"$ref":"#/components/parameters/SpotId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["choice"],"additionalProperties":false,"properties":{"choice":{"type":"string","enum":["paper_ok","heated_only","both","closed"],"description":"順に紙巻き可、加熱式のみ、両方可、閉鎖・無くなっていた。"}}}}}},"responses":{"201":{"description":"報告受付。報告後の集計を返します。端末の連投防止に使うCookieを返します。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAccepted"}}}},"400":{"description":"スポットIDまたは報告内容が不正。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"別オリジンからの報告。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"指定したスポットが見つからない。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"リクエストボディが128バイトを超えている。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Content-Typeがapplication/jsonではない。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"同じ端末または公開IPから直近24時間以内に同じスポットへの報告がある。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"報告を受け付けられない。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/sources":{"get":{"operationId":"listSources","summary":"出典台帳一覧","responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"503":{"$ref":"#/components/responses/Unavailable"}},"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}]}},"/api/sources/{sourceId}":{"get":{"operationId":"getSource","summary":"出典台帳の詳細","responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceDetail"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/Unavailable"}},"parameters":[{"$ref":"#/components/parameters/SourceId"}]}},"/llms.txt":{"get":{"operationId":"getLlms","summary":"AI向けエントリーポイント","responses":{"200":{"description":"UTF-8の契約文書","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/llms-full.txt":{"get":{"operationId":"getLlmsFull","summary":"完全なAPI契約","responses":{"200":{"description":"UTF-8の契約文書","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"parameters":{"Limit":{"name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"description":"1ページに返す最大件数。URLでは1〜3桁の数字を指定。","in":"query"},"Cursor":{"name":"cursor","schema":{"type":"string","maxLength":512},"description":"同じエンドポイント・絞り込みで直前の nextCursor を指定。","in":"query"},"Area":{"name":"area","schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":60},"description":"東京23区のslug、大阪市全体は osaka、大阪市各区は osaka-kita など osaka- 接頭辞付きslug。詳細は /llms-full.txt。","in":"query"},"Paper":{"name":"type_paper","schema":{"type":"string","enum":["true","false","unknown","unclaimed"]},"description":"紙巻きの公開値。unknown は追跡中で不明、unclaimed は値の主張なし。","in":"query"},"Hours":{"name":"hours","schema":{"type":"string","enum":["known","always","unknown","unclaimed"]},"description":"掲載時間の状態。always は「終日」「24時間」「24/7」「全日」「00:00-24:00」の完全一致。現在の開閉状況は評価しません。","in":"query"},"SpotId":{"name":"id","schema":{"type":"string","pattern":"^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$"},"description":"喫煙所の公開ID。","required":true,"in":"path"},"SourceId":{"name":"sourceId","schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":100},"description":"出典ID。","required":true,"in":"path"}},"responses":{"BadRequest":{"description":"引数・ID・カーソルが不正です。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"一致するレコードがありません。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"台帳を取得できません。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Envelope":{"type":"object","required":["schema","contractVersion","generatedAt"],"properties":{"schema":{"type":"string","const":"smoking-today/v1"},"contractVersion":{"type":"integer","const":1},"generatedAt":{"type":"string","format":"date-time"}}},"Error":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}]},"Health":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":true}}}]},"SpotList":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","required":["count","returned","nextCursor","spots"],"properties":{"count":{"type":"integer","minimum":0,"description":"条件に合う全件数"},"returned":{"type":"integer","minimum":0},"nextCursor":{"type":["string","null"]},"spots":{"type":"array","items":{"$ref":"#/components/schemas/Spot"}}}}]},"SourceList":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","required":["count","returned","nextCursor","sources"],"properties":{"count":{"type":"integer","minimum":0,"description":"条件に合う全件数"},"returned":{"type":"integer","minimum":0},"nextCursor":{"type":["string","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/Source"}}}}]},"SpotDetail":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","required":["spot"],"properties":{"spot":{"$ref":"#/components/schemas/Spot"}}}]},"SourceDetail":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","required":["source"],"properties":{"source":{"$ref":"#/components/schemas/Source"}}}]},"Spot":{"type":"object","required":["id","seed_key","seed_ref","name","area","address","landmark","lat","lng","geo_source","geo_note","geo_precision","geo_missing_reason","type_paper","type_heated","form","facilities","access","hours","flags","source_id","source_url","retrieved_at","data_basis_date","created_at","updated_at","confirmed_at","review_status","trust","unknown_fields","note","maps_url","userReports"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$"},"seed_key":{"type":"string"},"seed_ref":{"type":"string"},"name":{"type":"string"},"area":{"$ref":"#/components/schemas/Area"},"address":{"type":["string","null"]},"landmark":{"type":["string","null"]},"lat":{"type":["number","null"],"minimum":-90,"maximum":90},"lng":{"type":["number","null"],"minimum":-180,"maximum":180},"geo_source":{"type":["string","null"]},"geo_note":{"type":["string","null"]},"geo_precision":{"enum":["exact","address","block",null]},"geo_missing_reason":{"type":["string","null"]},"type_paper":{"type":["boolean","null"],"description":"可／不可／値の主張なし。null かつ unknown_fields にある場合は追跡中で未確認。"},"type_heated":{"type":["boolean","null"],"description":"可／不可／値の主張なし。null かつ unknown_fields にある場合は追跡中で未確認。"},"form":{"enum":["indoor_room","outdoor","store","other",null]},"facilities":{"type":"array","items":{"type":"string"}},"access":{"enum":["free","customers_only","unknown",null]},"hours":{"type":["string","null"]},"flags":{"type":"array","items":{"type":"string"}},"source_id":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"source_url":{"type":"string","format":"uri"},"retrieved_at":{"type":"string"},"data_basis_date":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"confirmed_at":{"type":["string","null"]},"review_status":{"type":"string"},"trust":{"$ref":"#/components/schemas/Trust"},"unknown_fields":{"type":"array","items":{"type":"string"}},"note":{"type":["string","null"]},"maps_url":{"type":"string","format":"uri","description":"Google Mapsの検索リンク。公開座標があればその緯度経度、なければ名称と住所を検索クエリに使用します。"},"userReports":{"description":"第3層の利用者報告。集計を取得できない場合はnull。","oneOf":[{"$ref":"#/components/schemas/UserReports"},{"type":"null"}]}}},"Source":{"type":"object","required":["source_id","label","publisher","source_url","license","retrieval_mode","checked_at","freshness","note"],"properties":{"source_id":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"label":{"type":"string"},"publisher":{"type":"string"},"source_url":{"type":"string","format":"uri"},"license":{"type":"string"},"retrieval_mode":{"type":"string"},"checked_at":{"type":["string","null"]},"freshness":{"$ref":"#/components/schemas/Freshness"},"note":{"type":["string","null"]}}},"Area":{"type":"object","required":["prefCode","municipalityCode","slug","nameJa"],"properties":{"prefCode":{"type":"string"},"municipalityCode":{"type":"string"},"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"nameJa":{"type":"string"}}},"Trust":{"type":"object","required":["score","band","reasons"],"properties":{"score":{"type":["number","null"]},"band":{"type":["string","null"]},"reasons":{"type":"array","items":{"type":"string"}}}},"Freshness":{"type":"object","required":["status","basis"],"properties":{"status":{"type":["string","null"]},"basis":{"type":["string","null"]}}},"UserReports":{"type":"object","description":"利用者報告の集計。公式の可否や営業時間は公式フィールドを参照してください。","required":["paperOk","heatedOnly","both","closed","total","latestAt"],"properties":{"paperOk":{"type":"integer","minimum":0},"heatedOnly":{"type":"integer","minimum":0},"both":{"type":"integer","minimum":0},"closed":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"latestAt":{"type":["string","null"],"format":"date-time","description":"最終報告日時。0件の場合はnull。"}}},"ReportAccepted":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","required":["userReports"],"properties":{"userReports":{"$ref":"#/components/schemas/UserReports"}}}]}}}}