When to use
Query GitCode data such as repositories/branches/issues/PRs/commits/tags, users and organizations, search, Webhooks, members, releases, etc.Full API overview(functional description and obtainable information for each endpoint) see reference.md, which is the sole API documentation for this skill.
Requests and authentication
- Base URL:
https://api.gitcode.com/api/v5 - Authentication: The following endpoints require a Token (otherwise may return 400/401): pulls, issues, branches, commits, repository details and file lists, tags, releases, members, webhooks, etc.
- How to obtain a Token(in order of priority):
- Provided directly by the user: The user can provide the token directly in the question, e.g. "get the star count of the owner/repo repository on gitcode, the token is xxxxx"
- Environment variable: read from
GITCODE_TOKEN, in order: (1) current process$env:GITCODE_TOKEN(PowerShell) or$GITCODE_TOKEN(bash); (2) Windows user variable[Environment]::GetEnvironmentVariable('GITCODE_TOKEN','User'); (3) Windows system variable[Environment]::GetEnvironmentVariable('GITCODE_TOKEN','Machine')
- Request header: use
PRIVATE-TOKEN: {token}orAuthorization: Bearer {token}, or the query parameteraccess_token={token} - When not configured: Prompt the user to go to GitCode Personal Access Token to create a Token (check read_api, read_repository, etc.), and set the environment variable
GITCODE_TOKEN。
Status codes and rate limiting
| Code | Meaning |
|---|---|
| 200/201/204 | Success |
| 400 | Missing parameters or missing authentication (some endpoints) |
| 401 | Invalid or missing Token |
| 403/404/409/422 | Forbidden/Not found/Conflict/Validation failed |
| 429 | Rate limited (default 50/minute, 4000/hour) |
Endpoints and examples
- Full endpoints: Method / Path / functional description / obtainable information / official documentation links for all v5 endpoints see reference.md(including Repositories, Branch, Issues, Search, PR, Commit, Tag, Labels, Milestone, Users, Orgs, Webhooks, Member, Release, etc.).
- Call examples: see examples.md。
- Official documentation:https://docs.gitcode.com/docs/apis/(each endpoint has a separate page with parameters and responses).
Version history
v1.2.0 (2026-03-15)
- 🔒 Removed
scripts/setup_gitcode_token.py
v1.1.0 (2026-03-14)
- 📝 Optimized the PR comment API description, distinguishing between regular comments and code line comments
v1.0.0 (2026-03-11)
- 🎉 Initial version release
- 🔍 Support API queries for repositories/branches/PRs/commits/tags, etc.