{"openapi":"3.1.0","info":{"title":"LearnMap · 学径 public API","version":"2","description":"只读的 AI 精选接口：每条精选带中文标题与中文摘要（由模型根据原文生成，以原文为准）。破坏性变化：路径沿用 /api/v1，但返回内容已从旧版学习资源库换成 v2 精选，字段全部不同；旧版 id（res_、prc_ 开头）一律 404。主题接口（/api/v1/topics、/md/topics）返回 v2 两层主题树，单个主题按推荐学习顺序列出精选（越基础越靠前）；合并或改名前的旧主题 id 301 到新 id。当前开放的类型（按显示顺序）：project、blog、course、lecture；项目再按 subtype 分 agent、capability、idea。访问不触发模型调用。允许跨域；每个 IP 每分钟 120 次，超出返回 429 与 Retry-After。MCP：POST https://oplearnx.com/mcp（Streamable HTTP，无状态）。"},"servers":[{"url":"https://oplearnx.com"}],"externalDocs":{"description":"Agent 接入说明","url":"https://oplearnx.com/agent"},"paths":{"/api/v1/resources":{"get":{"operationId":"searchPicks","summary":"精选列表与关键词搜索，按首次精选时间倒序","parameters":[{"name":"q","in":"query","description":"关键词，匹配原标题、中文标题与中文摘要（不区分大小写）","schema":{"type":"string","maxLength":200}},{"name":"kind","in":"query","description":"精选类型（当前开放的类型）","schema":{"type":"string","enum":["project","blog","course","lecture"]}},{"name":"subtype","in":"query","description":"项目子类：agent、capability（能力）、idea（创意）；只配合 kind=project，否则 400","schema":{"type":"string","enum":["agent","capability","idea"]}},{"name":"grade","in":"query","description":"分级：必读 must_read 或值得看 worth","schema":{"type":"string","enum":["must_read","worth"]}},{"name":"cost","in":"query","description":"是否付费：free 免费、partial 部分免费、paid 付费、unknown 未知","schema":{"type":"string","enum":["free","partial","paid","unknown"]}},{"name":"listed","in":"query","description":"只要近 N 天首次精选（上架）的","schema":{"type":"integer","enum":[7,30,90,365]}},{"name":"level","in":"query","description":"学习层级：intro 入门、intermediate 进阶、advanced 深入","schema":{"type":"string","enum":["intro","intermediate","advanced"]}},{"name":"topic","in":"query","description":"主题 id（见 /api/v1/topics）；方向（大主题）含它的全部细分主题","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,47}$"}},{"name":"sort","in":"query","description":"latest 按首次精选倒序（默认）；recommended 必读在前、再按学习顺序（层级入门 → 进阶 → 深入，同层按主题树顺序，再必读在前、主题内 rank）；learning 学习顺序；learning_desc 反过来；published 按原文发布时间新的在前；published_asc 早的在前","schema":{"type":"string","enum":["latest","recommended","learning","learning_desc","published","published_asc"],"default":"latest"}},{"name":"limit","in":"query","description":"每页条数","schema":{"type":"integer","minimum":1,"maximum":50,"default":12}},{"name":"cursor","in":"query","description":"上一页返回的 next_cursor；翻页期间新上架的精选不会造成重复或漏项","schema":{"type":"string"}}],"responses":{"200":{"description":"精选列表","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PickList"}}}},"400":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/resources/{id}":{"get":{"operationId":"getPick","summary":"一条精选的详情；并入另一条的 id（换版迁移确认的同一资源，或已归入同一门课程的）301 到保留的那条；已下线返回 410，旧版 id 与不存在返回 404","parameters":[{"name":"id","in":"path","required":true,"description":"精选 ID，形如 pk_xxxxxxxxxxxx","schema":{"type":"string"}}],"responses":{"200":{"description":"精选详情","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PickDetail"}}}},"301":{"description":"并入另一条的 id，跳到保留的那条"},"404":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/new-resources":{"get":{"operationId":"listNewPicks","summary":"最新精选：只含发布到首次精选在所属类型时效窗口内的（课程的新一期、新一讲与博客、项目的新版本按动态日期到上榜算，窗口按所属类型，课程 60 天），按上榜时间 latest_at 倒序","parameters":[{"name":"kind","in":"query","description":"精选类型（当前开放的类型）","schema":{"type":"string","enum":["project","blog","course","lecture"]}},{"name":"subtype","in":"query","description":"项目子类：agent、capability（能力）、idea（创意）；只配合 kind=project，否则 400","schema":{"type":"string","enum":["agent","capability","idea"]}},{"name":"grade","in":"query","description":"分级：必读 must_read 或值得看 worth","schema":{"type":"string","enum":["must_read","worth"]}},{"name":"limit","in":"query","description":"每页条数","schema":{"type":"integer","minimum":1,"maximum":50,"default":12}},{"name":"cursor","in":"query","description":"上一页返回的 next_cursor；翻页期间新上架的精选不会造成重复或漏项","schema":{"type":"string"}}],"responses":{"200":{"description":"精选列表","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PickList"}}}},"400":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/topics":{"get":{"operationId":"listTopics","summary":"两层主题树：先大主题、后细分主题，带在架精选数与其中入门层级的条数","responses":{"200":{"description":"主题列表","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicList"}}}}}}},"/api/v1/topics/{id}":{"get":{"operationId":"getTopic","summary":"一个主题与按推荐学习顺序排列的精选（rank 越小越先学）；旧主题 id 301，不存在 404","parameters":[{"name":"id","in":"path","required":true,"description":"主题 ID，小写字母、数字和连字符","schema":{"type":"string"}}],"responses":{"200":{"description":"主题详情","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicDetail"}}}},"301":{"description":"旧主题 id，跳到新 id"},"404":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/md/resources/{file}":{"get":{"operationId":"getPickMarkdown","summary":"一条精选的 Markdown（适合直接放进 Agent 上下文）；并入另一条的 id（同上）301 到保留的那条；已下线 410，不存在 404","parameters":[{"name":"file","in":"path","required":true,"description":"{精选ID}.md","schema":{"type":"string","pattern":"\\.md$"}}],"responses":{"200":{"description":"Markdown","content":{"text/markdown":{"schema":{"type":"string"}}}},"301":{"description":"并入另一条的 id，跳到保留的那条"},"404":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/md/topics/{file}":{"get":{"operationId":"getTopicMarkdown","summary":"一个主题的 Markdown：介绍、上下级主题、按推荐学习顺序的精选","parameters":[{"name":"file","in":"path","required":true,"description":"{主题ID}.md","schema":{"type":"string","pattern":"\\.md$"}}],"responses":{"200":{"description":"Markdown","content":{"text/markdown":{"schema":{"type":"string"}}}},"301":{"description":"旧主题 id，跳到新 id"},"404":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/md/new-resources.md":{"get":{"operationId":"getNewPicksMarkdown","summary":"最新 30 条精选的 Markdown 列表（按上榜时间；动态带【新一期】/【新一讲】/【新版本】标签）","responses":{"200":{"description":"Markdown","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/rss/new-resources.xml":{"get":{"operationId":"getNewPicksRss","summary":"最新 50 条精选的 RSS 2.0；标题为中文标题，描述为中文摘要；课程的每次新一期、新一讲与博客、项目的每次新版本是一条新条目，标题带前缀","responses":{"200":{"description":"RSS","content":{"application/rss+xml":{"schema":{"type":"string"}}}}}}},"/rss/topics/{file}":{"get":{"operationId":"getTopicRss","summary":"订阅主题时效窗口内的最新精选与课程、版本动态，按上榜时间倒序取最多 50 条；方向包含其下的细分主题","parameters":[{"name":"file","in":"path","required":true,"description":"{主题ID}.xml（主题 id 为小写字母、数字和连字符，2–48 个字符）","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,47}\\.xml$"}}],"responses":{"200":{"description":"RSS","content":{"application/rss+xml":{"schema":{"type":"string"}}}},"301":{"description":"旧主题 id，跳到新主题的 RSS"},"404":{"description":"错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/openapi.json":{"get":{"operationId":"getOpenApi","summary":"本文档","responses":{"200":{"description":"OpenAPI 3.1 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDocument"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"OpenApiDocument":{"type":"object","description":"OpenAPI 3.1 JSON"},"Pick":{"type":"object","description":"一条 AI 精选；中文标题与摘要由模型根据原文生成，以原文为准；未知信息为 null","properties":{"id":{"type":"string","description":"精选 ID，pk_ 开头"},"url":{"type":"string","format":"uri","description":"本站详情页地址"},"kind":{"type":"string","enum":["project","blog","course","lecture"]},"kind_label":{"type":"string","description":"主类中文名，如“项目”“讲座与播客”"},"subtype":{"type":["string","null"],"enum":["agent","capability","idea",null],"description":"项目子类；不是项目或没判为 null"},"subtype_label":{"type":["string","null"],"description":"项目子类中文名：Agent、能力、创意"},"kind_display":{"type":"string","description":"网站、RSS、Markdown 共用的类型写法，如“项目 · Agent”"},"title_zh":{"type":"string","description":"一句话中文展示标题"},"title":{"type":"string","description":"原标题"},"summary_zh":{"type":"string"},"original_url":{"type":"string","format":"uri","description":"原文链接"},"source_host":{"type":"string","description":"原文所在站点"},"source_name":{"type":["string","null"],"description":"信息来源名，如“Stanford 课程官网”“GitHub”；未知为 null（显示时退回 source_host）"},"published_at":{"type":["string","null"],"format":"date-time"},"collected_at":{"type":"string","format":"date-time"},"first_listed_at":{"type":"string","format":"date-time","description":"首次精选（上架）时间，列表按它倒序"},"latest_at":{"type":"string","format":"date-time","description":"上榜时间：首次精选与课程动态上榜较晚的一个；new-resources 等最新出口按它倒序"},"updated_at":{"type":"string","format":"date-time"},"authorized_use":{"type":"boolean"},"notice":{"type":["string","null"],"description":"authorized_use 为 true 时是“仅限授权使用”，否则 null"},"grade":{"type":"string","enum":["must_read","worth"],"description":"分级：必读或值得看"},"grade_label":{"type":"string"},"level":{"type":["string","null"],"enum":["intro","intermediate","advanced",null],"description":"学习层级：入门、进阶、深入；未知为 null"},"level_label":{"type":["string","null"]},"topics":{"type":"array","description":"所属细分主题与该主题里的学习顺序（rank 越小越先学）","items":{"type":"object","properties":{"id":{"type":"string"},"rank":{"type":"integer","minimum":1},"api_url":{"type":"string","format":"uri"}}}},"related_ids":{"type":"array","items":{"type":"string"},"description":"库内相关精选的 id，按推荐先后"},"cited":{"type":"array","description":"原文涉及、不在库里的链接；未经本站评审（reviewed 恒为 false）","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"title":{"type":"string"},"reviewed":{"type":"boolean"}}}},"renewed":{"type":["object","null"],"description":"动态：课程的新一期或新一讲，或博客、项目等换了链接的新版本（version）；没有为 null","properties":{"kind":{"type":"string","enum":["term","lecture","version"],"description":"term、lecture 只在课程上；version 只在课程以外"},"kind_label":{"type":"string","description":"新一期 / 新一讲 / 新版本"},"label_zh":{"type":"string","description":"一行说明，如“新一讲：第 5 讲 Scaling Laws”"},"published_at":{"type":["string","null"],"description":"新一讲的日期或新一期第一讲的日期（YYYY-MM-DD 或带时区的时间）；未知为 null"},"listed_at":{"type":["string","null"],"format":"date-time","description":"这次动态上榜的时间；等于 first_listed_at 表示随新上架一起收录；null 表示没有上榜"}}},"cost":{"type":["string","null"],"enum":["free","partial","paid",null],"description":"是否付费：免费、部分免费、付费；未知为 null"},"cost_label":{"type":["string","null"]},"cost_basis":{"type":["string","null"],"enum":["public_repo","public_post","public_video","fulltext","overview","model",null],"description":"是否付费的依据"},"cost_basis_label":{"type":["string","null"],"description":"依据的中文名，如“公开仓库”“课程或书籍页面”"},"study_minutes":{"type":["integer","null"],"minimum":1,"description":"预估学习时长（分钟）；未知为 null"},"study_label":{"type":["string","null"],"description":"如“约 20 分钟”“约 1.5 小时”"},"study_basis":{"type":["string","null"],"enum":["words","words_handson","video","page_total","lectures_sum","pages","model",null],"description":"学习时长的依据"},"study_basis_label":{"type":["string","null"],"description":"依据的中文名，如“按全文字数估算”“视频时长”"},"is_demo":{"type":"boolean","description":"演示站的数据为 true（虚构示例）"}}},"Topic":{"type":"object","properties":{"id":{"type":"string"},"parent_id":{"type":["string","null"],"description":"大主题为 null"},"name_zh":{"type":"string"},"intro_zh":{"type":"string"},"order":{"type":"integer"},"count":{"type":"integer","description":"在架精选数"},"intro_count":{"type":"integer","description":"其中入门层级的条数"},"level_counts":{"type":"object","description":"各层级的条数","properties":{"intro":{"type":"integer"},"intermediate":{"type":"integer"},"advanced":{"type":"integer"},"unknown":{"type":"integer","description":"没标层级的"}}},"must_read_count":{"type":"integer","description":"其中必读的条数（必读未公开时为 0）"},"url":{"type":"string","format":"uri","description":"网站主题页"},"api_url":{"type":"string","format":"uri"},"rss_url":{"type":"string","format":"uri","description":"主题 RSS 的绝对订阅地址"}}},"TopicList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Topic"}}}},"TopicDetail":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Topic"},{"type":"object","properties":{"picks":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Pick"},{"type":"object","properties":{"rank":{"type":"integer"},"topic_id":{"type":"string"}}}]}}}}]}}},"PickList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Pick"}},"total":{"type":"integer"},"next_cursor":{"type":["string","null"]}}},"PickDetail":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Pick"},{"type":"object","properties":{"detail":{"description":"按类型的详情（只在单条详情里有，列表不带）：博客与教程的中文精读与许可允许时的全文翻译、帖子的原帖引用与讨论观点、项目的热度与上手方式、课程与书籍的概览；没有为 null","oneOf":[{"$ref":"#/components/schemas/ReadingDetail"},{"$ref":"#/components/schemas/PostDetail"},{"$ref":"#/components/schemas/ProjectDetail"},{"$ref":"#/components/schemas/OverviewDetail"},{"type":"null"}]},"earlier":{"type":"array","maxItems":10,"description":"往期版本（只在单条详情里有，列表不带）：同一资源换了链接的较早版本（修订版的旧链接、搬家前的仓库、官方页面、上一代仓库），新的在前、最多 10 条，没有为空数组；中文标题与摘要以本条（最新版）为准","items":{"type":"object","required":["url","title","label","published_at"],"properties":{"url":{"type":"string","format":"uri","description":"那一版原来的链接"},"title":{"type":"string","description":"那一版的原标题"},"label":{"type":"string","description":"说明，如“初版”“旧地址：owner/repo”“官方页面”“上一代：owner/repo”"},"published_at":{"type":["string","null"],"description":"那一版的发布日期（YYYY-MM-DD 或带时区的时间）；未知为 null"}}}},"via":{"type":"array","maxItems":5,"description":"推荐信源（只在单条详情里有，列表不带）：指向这条资源的帖子与讨论，与来源（source_name）分开；新的在前、最多 5 条，没有为空数组；不含信源等级","items":{"type":"object","required":["name","url","at"],"properties":{"name":{"type":"string","description":"信源名，X 写“X @作者”"},"url":{"type":"string","format":"uri","description":"推荐帖链接"},"at":{"type":["string","null"],"description":"推荐时间（ISO 8601）；未知为 null"}}}}}}]}}},"ReadingDetail":{"type":"object","required":["reading","license","translation"],"properties":{"reading":{"type":"object","required":["sections","source_words"],"properties":{"sections":{"type":"array","items":{"type":"object","required":["heading_zh","points_zh"],"properties":{"heading_zh":{"type":"string"},"points_zh":{"type":"array","items":{"type":"string"},"maxItems":6},"code":{"type":"object","required":["lang","text"],"properties":{"lang":{"type":"string","description":"代码语言，可为空串"},"text":{"type":"string","description":"最多 40 行"}}}}},"maxItems":24,"description":"按原文章节顺序的中文精读"},"source_words":{"type":"integer","description":"原文词数"}}},"license":{"type":["object","null"],"required":["id","url"],"properties":{"id":{"type":"string","description":"SPDX 许可 id，如 CC-BY-4.0"},"url":{"type":["string","null"]},"author":{"type":"string","description":"原作者，可省略"},"copyright":{"type":["string","null"],"description":"原文的版权行原样，可省略或为 null；MIT、Apache-2.0 的全文翻译必须有"},"notice":{"type":["string","null"],"description":"Apache NOTICE 里要求保留的署名，可省略或为 null"}},"description":"查不到许可为 null"},"translation":{"type":["object","null"],"required":["sections"],"properties":{"sections":{"type":"array","items":{"type":"object","required":["heading_zh","body_zh"],"properties":{"heading_zh":{"type":"string"},"body_zh":{"type":"string","description":"段落之间空一行"}}},"maxItems":60}},"description":"全文翻译：只在许可属于 CC BY、CC BY-SA、CC0、Apache-2.0、MIT 时存在，否则为 null"}},"description":"博客、教程"},"PostDetail":{"type":"object","required":["platform","quote","gist_zh","discussion"],"properties":{"platform":{"type":"string","enum":["reddit","x","hn","weibo"],"description":"原帖平台（微博 weibo 2026-11-01 加入）"},"quote":{"type":"object","required":["author","text","posted_at"],"properties":{"author":{"type":"string"},"text":{"type":"string","description":"原帖关键句，最多 300 字"},"posted_at":{"type":["string","null"],"description":"日期（YYYY-MM-DD）或带时区的时间"}}},"gist_zh":{"type":"string","description":"中文大意"},"discussion":{"type":["object","null"],"required":["read","points"],"properties":{"read":{"type":"integer","description":"读过的评论条数"},"points":{"type":"array","items":{"type":"object","required":["view_zh"],"properties":{"view_zh":{"type":"string"},"url":{"type":"string","description":"出处，可省略"}}},"maxItems":6,"description":"讨论区核心观点"}}}},"description":"帖子"},"ProjectDetail":{"type":"object","required":["repo","heat","quickstart"],"properties":{"repo":{"type":"object","required":["language","license","pushed_at","stars","forks","open_issues"],"properties":{"language":{"type":["string","null"]},"license":{"type":["string","null"]},"pushed_at":{"type":["string","null"],"description":"日期（YYYY-MM-DD）或带时区的时间"},"stars":{"type":"integer"},"forks":{"type":"integer"},"open_issues":{"type":"integer"}}},"heat":{"type":"object","required":["level","stars_7d","stars_30d","series","hn","mentions"],"properties":{"level":{"type":["string","null"],"enum":["strong","some",null],"description":"热度强 / 有热度"},"stars_7d":{"type":["integer","null"]},"stars_30d":{"type":["integer","null"]},"series":{"type":"array","items":{"type":"object","required":["d","stars"],"properties":{"d":{"type":"string","description":"日期"},"stars":{"type":"integer"}}},"maxItems":30,"description":"近 30 天 star 走势"},"hn":{"type":["object","null"],"required":["points","comments","url"],"properties":{"points":{"type":"integer"},"comments":{"type":"integer"},"url":{"type":"string"}}},"mentions":{"type":"integer","description":"社区讨论帖数"}}},"quickstart":{"type":["object","null"],"required":["lang","text","from"],"properties":{"lang":{"type":"string"},"text":{"type":"string","description":"摘自 README 的代码块，最多 40 行"},"from":{"type":"string","description":"README 链接"}}}},"description":"项目"},"OverviewDetail":{"type":"object","required":["facts","goals_zh","fit_zh","not_fit_zh","prereq_zh","features","outline_zh"],"properties":{"facts":{"type":"object","required":["difficulty","language","scale","fee","hands_on"],"properties":{"difficulty":{"type":["string","null"]},"language":{"type":["string","null"]},"scale":{"type":["string","null"]},"fee":{"type":["string","null"]},"hands_on":{"type":["string","null"]}}},"goals_zh":{"type":"array","items":{"type":"string"},"maxItems":12,"description":"学完你能"},"fit_zh":{"type":"array","items":{"type":"string"},"maxItems":8},"not_fit_zh":{"type":"array","items":{"type":"string"},"maxItems":8},"prereq_zh":{"type":["string","null"],"description":"需要先会；未知为 null 或空串"},"features":{"type":"object","required":["emphasis","practice","effort","fee_note"],"properties":{"emphasis":{"type":["string","null"]},"practice":{"type":["string","null"]},"effort":{"type":["string","null"]},"fee_note":{"type":["string","null"]}}},"outline_zh":{"type":"array","items":{"type":"string"},"maxItems":40,"description":"内容覆盖（书籍为目录）"},"term":{"type":["string","null"],"description":"只有课程：学期，如“2026 秋”"},"lectures":{"type":["array","null"],"items":{"type":"object","required":["title","url","date"],"properties":{"title":{"type":"string"},"url":{"type":"string"},"date":{"type":["string","null"]}}},"maxItems":60,"description":"只有课程：课程各讲（每天按课程页更新）"},"playlist":{"type":["string","null"],"description":"只有课程：视频合集链接（http/https）"},"lectures_term":{"type":["string","null"],"description":"只有课程：列出的 lectures 是另一学期的录像时，那个学期（如“2026 春”）；就是本期讲座时没有这个键"}},"description":"课程、书籍"}}}}