# GitHub API 搜索查询合集 用于按语言、Stars、创建时间等维度批量发现高星项目。 ## 基础查询 ```bash # 高星项目(>1000 stars,最近有更新) https://api.github.com/search/repositories?q=stars:>1000&sort=stars&order=desc&per_page=25 # 本月新项目(近30天创建,>100 stars) https://api.github.com/search/repositories?q=created:>2026-04-26+stars:>100&sort=stars&order=desc # 本周爆发项目(本周创建,>50 stars) https://api.github.com/search/repositories?q=created:>2026-05-19+stars:>50&sort=stars&order=desc ``` ## 按语言筛选 ```bash # Rust 高星项目 https://api.github.com/search/repositories?q=language:rust+stars:>500&sort=stars&order=desc # Python AI/ML 项目 https://api.github.com/search/repositories?q=language:python+topic:ai+stars:>500&sort=stars&order=desc # TypeScript 开发者工具 https://api.github.com/search/repositories?q=language:typescript+topic:developer-tools+stars:>200&sort=stars&order=desc # Go 云原生项目 https://api.github.com/search/repositories?q=language:go+topic:cloud-native+stars:>500&sort=stars&order=desc ``` ## 按主题筛选 ```bash # LLM Agent 框架 https://api.github.com/search/repositories?q=topic:llm-agent+stars:>200&sort=stars&order=desc # RAG 项目 https://api.github.com/search/repositories?q=topic:rag+stars:>100&sort=stars&order=desc # 本地 LLM 工具 https://api.github.com/search/repositories?q=topic:local-llm+stars:>100&sort=stars&order=desc ``` ## 组合查询 ```bash # 2025年后创建的高星 Rust 项目 https://api.github.com/search/repositories?q=language:rust+created:>2025-01-01+stars:>1000&sort=stars&order=desc # 近3个月的热门 AI 工具(>500 stars) https://api.github.com/search/repositories?q=language:python+topic:ai+topic:tools+created:>2026-02-25+stars:>200&sort=stars&order=desc ``` ## 获取完整数据 GitHub API 返回 JSON,直接用 curl 处理: ```bash curl -s "https://api.github.com/search/repositories?q=stars:>1000&sort=stars&per_page=10" | jq '[.items[] | {name: .full_name, stars: .stargazers_count, desc: .description, lang: .language, url: .html_url, topics: .topics}]' ``` ## 注意事项 - GitHub API 未认证限制 60 req/h,认证后 5000 req/h - `per_page` 最大 100 - 日期格式: `YYYY-MM-DD` - 用 `pushed:>YYYY-MM-DD` 筛选活跃项目 - `topic:` 使用仓库的 GitHub Topics 标签