Skip to content

GitCode API

Verified

Fetch and query data from GitCode platform via its REST API: repositories, branches, issues, pull requests, commits, tags, users, organizations, search, webh...

83 downloads
$ Add to .claude/skills/

About This Skill

Content available in Chinese

# GitCode API

何时使用

查仓库/分支/议题/PR/提交/标签、用户与组织、搜索、Webhook、成员、发布等 GitCode 数据。全量 API 一览(每个接口的功能说明与可获取信息)见 reference.md,为本 skill 唯一 API 说明文档。

请求与认证

  • Base URL:`https://api.gitcode.com/api/v5`
  • 认证:以下接口须带 Token(否则可能 400/401):pulls、issues、branches、commits、仓库详情与文件列表、tags、releases、members、webhooks 等。
  • Token 获取方式(按优先级):
  • 1. 用户直接提供:用户可在问题中直接提供 token,如"获取 gitcode 上 owner/repo 仓库的 star 数量,token 是 xxxxx"
  • 2. 环境变量:从 `GITCODE_TOKEN` 读取,顺序:(1) 当前进程 `$env:GITCODE_TOKEN`(PowerShell)或 `$GITCODE_TOKEN`(bash);(2) Windows 用户变量 `[Environment]::GetEnvironmentVariable('GITCODE_TOKEN','User')`;(3) Windows 系统变量 `[Environment]::GetEnvironmentVariable('GITCODE_TOKEN','Machine')`
  • 请求头:使用 `PRIVATE-TOKEN: {token}` 或 `Authorization: Bearer {token}`,或查询参数 `access_token={token}`
  • 未配置时:提示用户到 GitCode 个人访问令牌 创建 Token(勾选 read_api、read_repository 等),并设置环境变量 `GITCODE_TOKEN`。

状态码与限流

| Code | 含义 | |------|------| | 200/201/204 | 成功 | | 400 | 缺少参数或未带认证(部分接口) | | 401 | Token 无效或缺失 | | 403/404/409/422 | 禁止/未找到/冲突/校验失败 | | 429 | 限流(默认 50/分钟、4000/小时) |

接口与示例

  • 全量接口:所有 v5 接口的 Method / Path / 功能说明 / 可获取信息 / 官方文档链接见 reference.md(含 Repositories、Branch、Issues、Search、PR、Commit、Tag、Labels、Milestone、Users、Orgs、Webhooks、Member、Release 等)。
  • 调用示例:见 examples.md。
  • 官方文档:<https://docs.gitcode.com/docs/apis/>(每接口单独页含参数与响应)。

历史版本

  • v1.2.0 (2026-03-15)
  • 🔒 移除 `scripts/setup_gitcode_token.py`
  • v1.1.0 (2026-03-14)
  • 📝 优化 PR 评论 API 描述,区分普通评论与代码行评论
  • v1.0.0 (2026-03-11)
  • 🎉 初始版本发布
  • 🔍 支持仓库/分支/PR/提交/标签等 API 查询

Use Cases

  • Query repository, branch, and issue data from the GitCode platform via REST API
  • Search for projects, users, and organizations on GitCode
  • Monitor pull requests, commits, and tags in GitCode repositories
  • Set up webhooks for GitCode repository event notifications
  • Manage releases and organizational data through the GitCode API

Pros & Cons

Pros

  • +Compatible with multiple platforms including claude-code, openclaw
  • +Well-documented with detailed usage instructions and examples
  • +Open source with permissive licensing for commercial use

Cons

  • -Documentation primarily in Chinese — may be less accessible for English-only users
  • -Requires API tokens or authentication setup before first use

FAQ

What does GitCode API do?
Fetch and query data from GitCode platform via its REST API: repositories, branches, issues, pull requests, commits, tags, users, organizations, search, webh...
What platforms support GitCode API?
GitCode API is available on Claude Code, OpenClaw.
What are the use cases for GitCode API?
Query repository, branch, and issue data from the GitCode platform via REST API. Search for projects, users, and organizations on GitCode. Monitor pull requests, commits, and tags in GitCode repositories.

100+ free AI tools

Writing, PDF, image, and developer tools — all in your browser.

Next Step

Use the skill detail page to evaluate fit and install steps. For a direct browser workflow, move into a focused tool route instead of staying in broader support surfaces.