Gitee APIgitee.com ↗
Access Gitee repository metadata, user profiles, commit history, and file contents via 7 structured endpoints. Search repos, list files, and retrieve GVP status.
What is the Gitee API?
The Gitee API exposes 7 endpoints for querying repositories, user profiles, commit history, and directory contents from Gitee.com, China's largest Git hosting platform. The get_repository endpoint returns over 10 metadata fields including license, language, namespace, and star count. Other endpoints cover repository search by keyword, per-user repo listings, commit history with full author objects, and file tree traversal — all returning structured JSON.
curl -X GET 'https://api.parse.bot/scraper/07f5a5e4-6e57-4928-b7ae-67bf6023e7d8/get_repository?repo=docs&owner=openharmony' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace gitee-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Gitee Repository API — explore repos, users, commits, and contents."""
from parse_apis.gitee_repository_api import Gitee, Owner, Repo, Username, NotFound
client = Gitee()
# Fetch a repository by owner/repo and inspect its metadata.
repo = client.repositories.get(owner=Owner.OPENHARMONY, repo=Repo.DOCS)
print(f"Repository: {repo.full_name} | Language: {repo.language} | Stars: {repo.stargazers_count}")
# Instance methods: get classification info from the fetched repo.
type_info = repo.type_info()
print(f"GVP: {type_info.gvp} | Recommend: {type_info.recommend} | Labels: {type_info.project_labels}")
# List recent commits for this repository (bounded).
for commit in repo.commits(limit=3):
print(f"Commit {commit.sha[:8]}")
# Browse root directory contents of the fetched repo.
for item in repo.contents(limit=5):
print(f" {item.type}: {item.name} ({item.path})")
# Fetch a user profile, then list their repos.
user = client.users.get(login=Username.LANDWIND)
print(f"\nUser: {user.name} | Public repos: {user.public_repos} | Followers: {user.followers}")
for r in user.repos(limit=3):
print(f" {r.full_name} — {r.language} ★{r.stargazers_count}")
# Typed error handling: catch NotFound for a missing user.
try:
client.users.get(login="nonexistent_user_xyz_12345")
except NotFound as exc:
print(f"\nExpected error: {exc}")
print("\nExercised: repositories.get / repo.type_info / repo.commits / repo.contents / users.get / user.repos")
Fetch full details of a single repository by owner and repo name. Returns comprehensive metadata including stars, forks, language, project labels, namespace information, license, and timestamps. The response includes the full owner/assigner user objects and project membership details.
| Param | Type | Description |
|---|---|---|
| reporequired | string | Repository name path. |
| ownerrequired | string | Repository owner (user or organization) path. |
{
"type": "object",
"fields": {
"id": "integer repository ID",
"name": "string repository display name",
"owner": "object with id, login, name, avatar_url fields",
"license": "string license identifier or null",
"language": "string primary programming language or null",
"full_name": "string owner/repo path",
"namespace": "object with id, type, name, path fields",
"created_at": "string ISO datetime",
"updated_at": "string ISO datetime",
"description": "string repository description or null",
"forks_count": "integer fork count",
"default_branch": "string default branch name",
"project_labels": "array of label objects",
"watchers_count": "integer watcher count",
"stargazers_count": "integer star count"
},
"sample": {
"data": {
"id": 10919030,
"gvp": false,
"name": "docs",
"owner": {
"id": 7928036,
"name": "openharmony",
"login": "openharmony_admin",
"avatar_url": "https://foruda.gitee.com/avatar/1677102952566165682/7928036_openharmony_admin_1622551091.png"
},
"license": "CC-BY-4.0",
"language": "other",
"full_name": "openharmony/docs",
"namespace": {
"id": 6486504,
"name": "OpenHarmony",
"path": "openharmony",
"type": "group"
},
"recommend": false,
"created_at": "2020-08-14T14:49:40+08:00",
"updated_at": "2026-06-11T09:02:10+08:00",
"description": "OpenHarmony documentation",
"forks_count": 8089,
"default_branch": "master",
"project_labels": [],
"watchers_count": 1415,
"stargazers_count": 7578
},
"status": "success"
}
}About the Gitee API
Repository Data
The get_repository endpoint accepts owner and repo path parameters and returns a detailed object including id, full_name, language, license, namespace (with type and path), owner (with login, name, and avatar_url), plus created_at and updated_at ISO timestamps. A companion endpoint, get_repository_type, returns classification metadata for the same repo: the gvp boolean indicates Gitee Most Valuable Project designation, recommend flags editorially promoted projects, and project_labels carries an array of category tag strings that may be empty.
Search and User Listings
The search_repositories endpoint takes a query string with optional page and per_page pagination parameters. Results come back under a hits object that includes a total value and an array of scored result objects — useful for discovery by keyword or topic. The list_user_repos endpoint takes a username and returns a paginated array of full repository objects including stargazers_count, forks_count, language, and description, with up to 100 results per page.
Commit History and File Contents
list_repo_commits returns commits for any public repository in descending date order. Each item in the items array contains the commit sha, a nested commit object with author, committer, and message, plus top-level author and committer user objects and a parents array. list_repo_contents traverses the file tree: pass an optional path parameter to inspect a subdirectory, or omit it to retrieve root-level entries. Each item in the response carries type (dir or file), name, path, sha, url, html_url, and download_url.
User Profiles
get_user fetches a public Gitee profile by username, returning id, login, name, bio, avatar_url, followers, following, public_repos, and account timestamps. The endpoint returns a 404 response for usernames that do not exist on Gitee.
The Gitee API is a managed, monitored endpoint for gitee.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when gitee.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official gitee.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Track star and fork counts for Gitee-hosted open source projects over time using
get_repository. - Identify GVP-designated or editorially recommended projects by querying
get_repository_typefor thegvpandrecommendflags. - Search Gitee for repositories by keyword and rank results by
_scorereturned in thesearch_repositorieshits array. - Audit commit history for a repository by paginating through
list_repo_commitsand extracting author names and messages. - List all public repositories for a Gitee user and filter by
languageorstargazers_countusinglist_user_repos. - Enumerate repository file structures or locate specific directories by calling
list_repo_contentswith apathparameter. - Build a Gitee developer directory by collecting profile fields like
followers,public_repos, andbiofromget_user.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Gitee have an official developer API?+
What does `get_repository_type` return that `get_repository` does not?+
get_repository_type returns classification and curation fields specifically: gvp (Gitee Most Valuable Project boolean), recommend (editorial recommendation flag), outsourced, namespace_type, and the project_labels tag array. These fields do not appear in the get_repository response, which focuses on core repository metadata like stars, forks, license, and timestamps.Does the API return issues, pull requests, or wiki content?+
Can I retrieve the raw content of a specific file, not just the directory listing?+
list_repo_contents returns a download_url field for each file entry, but the API does not currently include a dedicated endpoint that fetches and returns the raw file bytes directly. You can fork this API on Parse and revise it to add a file-content endpoint using the owner, repo, and path parameters.Does `list_repo_commits` support filtering by branch, date range, or author?+
owner, repo, and page parameters only. Branch selection, date-range filtering, and author filtering are not exposed. You can fork this API on Parse and revise it to add those filter parameters.