{"openapi":"3.1.0","info":{"title":"Orbit Wire API","version":"1.0.0","description":"太空新聞、AI 新聞、arXiv 論文與火箭發射時程。資料每小時更新一次；時間一律是 ISO 8601（UTC）。讀取不需要金鑰。"},"servers":[{"url":"https://space-info.marvinswift.com"}],"paths":{"/api/feed":{"get":{"summary":"新聞流（依發布時間新到舊）","parameters":[{"name":"topic","in":"query","schema":{"type":"string","enum":["nasa","jaxa","spacex","china","launch","astronomy","ai","papers-space","papers-ai","papers-agents"]}},{"name":"source","in":"query","schema":{"type":"string","enum":["nasa","jaxa","spacecom","spacenews","snapi","openai","anthropic","google","deepmind","arxiv"]}},{"name":"kind","in":"query","description":"news、paper 或 all。沒給時：有 topic 或 source 就不限種類，否則只回新聞。","schema":{"type":"string","enum":["news","paper","all"]}},{"name":"cursor","in":"query","description":"上一頁回傳的 nextCursor","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":30}}],"responses":{"200":{"description":"一頁內容","content":{"application/json":{"schema":{"type":"object","required":["items","nextCursor"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedItem"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"參數錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/items/{id}":{"get":{"summary":"單則新聞或論文＋對應的發射任務","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"內容","content":{"application/json":{"schema":{"type":"object","required":["item","launches"],"properties":{"item":{"$ref":"#/components/schemas/FeedItem"},"launches":{"type":"array","items":{"$ref":"#/components/schemas/Launch"}}}}}}},"404":{"description":"找不到","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/launches/upcoming":{"get":{"summary":"即將發射（依時間由近到遠）","parameters":[{"name":"country","in":"query","description":"以逗號分隔的發射場所在國（alpha-3）。預設 USA,JPN,CHN；ALL 表示不篩選。","schema":{"type":"string","example":"USA,JPN,CHN"}},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365,"default":30}}],"responses":{"200":{"description":"發射任務","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchList"}}}}}}},"/api/launches/recent":{"get":{"summary":"最近發射結果（依時間新到舊）","parameters":[{"name":"country","in":"query","description":"以逗號分隔的發射場所在國（alpha-3）。預設 USA,JPN,CHN；ALL 表示不篩選。","schema":{"type":"string","example":"USA,JPN,CHN"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":15}}],"responses":{"200":{"description":"發射任務","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchList"}}}}}}},"/api/launches/{id}":{"get":{"summary":"單一發射任務＋相關新聞","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"發射任務","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Launch"}}}},"404":{"description":"找不到","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/sources":{"get":{"summary":"每個外部來源最近一次抓取的狀態","responses":{"200":{"description":"來源清單","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/health":{"get":{"summary":"健康檢查","responses":{"200":{"description":"服務正常","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/admin/ingest":{"post":{"summary":"手動觸發抓資料（需要密鑰）","security":[{"bearer":[]}],"parameters":[{"name":"feed","in":"query","description":"只抓這些 feed（逗號分隔）","schema":{"type":"string"}},{"name":"force","in":"query","description":"1 表示不管間隔都重抓","schema":{"type":"string"}},{"name":"max","in":"query","description":"這次最多跑幾個 feed","schema":{"type":"integer"}}],"responses":{"200":{"description":"每個 feed 的結果","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"密鑰不正確","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"這個環境還沒設定密鑰","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"FeedItem":{"type":"object","required":["id","kind","source","publisher","title","summary","url","lang","publishedAt","topics"],"properties":{"id":{"type":"string","description":"由原文 URL 算出的穩定 id；頁面在 /news/{id}"},"kind":{"type":"string","enum":["news","paper"]},"source":{"type":"string","enum":["nasa","jaxa","spacecom","spacenews","snapi","openai","anthropic","google","deepmind","arxiv"]},"publisher":{"type":"string","description":"實際發布的媒體或機構"},"title":{"type":"string"},"summary":{"type":"string","description":"純文字摘要（新聞最多約 320 字、論文約 480 字）"},"url":{"type":"string","format":"uri","description":"原文連結"},"imageUrl":{"type":["string","null"],"format":"uri"},"lang":{"type":"string","description":"內容語言：en、ja"},"byline":{"type":["string","null"],"description":"論文作者；新聞為 null"},"publishedAt":{"type":"string","format":"date-time","description":"ISO 8601（UTC）"},"topics":{"type":"array","items":{"type":"string","enum":["nasa","jaxa","spacex","china","launch","astronomy","ai","papers-space","papers-ai","papers-agents"]}}}},"Launch":{"type":"object","required":["id","name","status","net","timeConfirmed","provider","rocket","pad","location","country","news"],"properties":{"id":{"type":"string","description":"Launch Library 2 的 launch UUID；頁面在 /launches/{id}"},"name":{"type":"string"},"status":{"type":"string","description":"Go、TBD、TBC、Hold、In Flight、Success、Failure、Partial Failure、Deployed"},"statusName":{"type":"string"},"net":{"type":"string","format":"date-time","description":"預定發射時間（UTC）"},"netPrecision":{"type":["string","null"],"description":"SEC、MIN、HR、DAY、M、Q1–Q4、H1、H2、Y"},"timeConfirmed":{"type":"boolean","description":"false 表示只知道大概日期（時間未定）"},"windowStart":{"type":["string","null"],"format":"date-time"},"windowEnd":{"type":["string","null"],"format":"date-time"},"provider":{"type":"string","description":"發射單位"},"rocket":{"type":"string"},"missionName":{"type":["string","null"]},"missionType":{"type":["string","null"]},"missionDescription":{"type":["string","null"]},"orbit":{"type":["string","null"]},"agencies":{"type":"array","items":{"type":"string"},"description":"任務的客戶機構（例如 NASA）"},"programs":{"type":"array","items":{"type":"string"}},"pad":{"type":"string"},"location":{"type":"string"},"country":{"type":"string","description":"發射場所在國（ISO 3166-1 alpha-3）"},"imageUrl":{"type":["string","null"],"format":"uri"},"webcastUrl":{"type":["string","null"],"format":"uri"},"webcastLive":{"type":"boolean"},"failReason":{"type":["string","null"]},"news":{"type":"array","items":{"$ref":"#/components/schemas/FeedItem"}}}},"LaunchList":{"type":"object","required":["launches"],"properties":{"launches":{"type":"array","items":{"$ref":"#/components/schemas/Launch"}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}