{"openapi":"3.1.0","info":{"title":"IF.Link Public Content API","version":"1.0.0","description":"IF.Link 社区公开、匿名、只读的搜索与内容读取接口。"},"servers":[{"url":"https://iflink.tech"}],"paths":{"/api/v1/search":{"get":{"operationId":"searchIfLinkContent","summary":"搜索 IF.Link 公开内容","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100},"description":"中文或英文关键词。"},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["page","activity","tutorial","radar"]},"description":"限定内容类型；省略表示全部类型。"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":10}}],"responses":{"200":{"description":"按相关度排序的结果。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"400":{"$ref":"#/components/responses/Problem"}}}},"/api/v1/content":{"get":{"operationId":"listIfLinkContent","summary":"列出 IF.Link 公开内容","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["page","activity","tutorial","radar"]},"description":"限定内容类型；省略表示全部类型。"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":10000,"default":0}}],"responses":{"200":{"description":"按日期倒序的内容目录。","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"}}}},"/api/v1/content/{type}/{slug}":{"get":{"operationId":"getIfLinkContent","summary":"读取一篇 IF.Link 内容的结构化正文","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["page","activity","tutorial","radar"]}},{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"元数据、纯文本正文与 Block AST。","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"}}}}},"components":{"schemas":{"ContentItem":{"type":"object","required":["id","type","slug","title","summary","url","tags"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["page","activity","tutorial","radar"]},"slug":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"url":{"type":"string","format":"uri"},"date":{"type":"string"},"endDate":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"excerpt":{"type":"string"},"score":{"type":"number"}}},"SearchResponse":{"type":"object","required":["schemaVersion","query","count","items","attribution"],"properties":{"schemaVersion":{"type":"string","const":"1.0"},"query":{"type":"string"},"count":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ContentItem"}},"attribution":{"type":"object"}}},"Problem":{"type":"object","required":["status","code","title","detail"],"properties":{"status":{"type":"integer"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}},"responses":{"Problem":{"description":"请求参数错误或内容不存在。","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}