GitHub Trending API
Read-only JSON API for daily, weekly and monthly snapshots. No API key required.
Available archives
These dates and counts are queried from the current database each time this page is opened. All archive dates use UTC.
| Period | Earliest date | Latest date | Dates available |
|---|---|---|---|
| daily | 2026-09-23 | 2026-10-18 | 26 |
| weekly | 2026-10-11 | 2026-10-18 | 8 |
| monthly | 2026-10-11 | 2026-10-18 | 8 |
Dates between the earliest and latest snapshot may be missing. A missing snapshot does not mean a repository never appeared on the live list.
Quick start
Base URL: https://gitstock.org/api/v1/github. Use HTTP GET. Responses are JSON. No authentication is required. Public responses support cross-origin browser GET requests.
curl 'https://gitstock.org/api/v1/github/trending?period=daily'
const response = await fetch('https://gitstock.org/api/v1/github/trending?period=weekly');
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const snapshot = await response.json();
console.log(snapshot.date, snapshot.items);
GET /trending
Returns one saved ranking, ordered by rank. Omit the date to get the latest available snapshot for the selected period; it may be older than today.
| Parameter | Default | Meaning |
|---|---|---|
period | daily | daily, weekly or monthly. |
date | Latest available | UTC snapshot date in YYYY-MM-DD format. For weekly/monthly, this is the capture date, not the start of the week/month. |
description_lang | Original description | Optional. Omit it, leave it empty, or use en for the original description; use de for German or zh (also zh-Hans) for Simplified Chinese. If a translation is not ready, the original description is returned. |
Try the earliest currently available daily snapshot:
curl 'https://gitstock.org/api/v1/github/trending?period=daily&date=2026-09-23'
Request German descriptions:
curl 'https://gitstock.org/api/v1/github/trending?description_lang=de'
Request Simplified Chinese descriptions:
curl 'https://gitstock.org/api/v1/github/trending?description_lang=zh'
Response fields
Top level: date (string), period (string), timezone (always UTC), and items (array).
| Item field | Type | Meaning |
|---|---|---|
rank | integer | Position in the captured list, starting at 1. |
owner, repo | string | Repository owner and name. |
description | string | Description at capture time, optionally translated into German or Simplified Chinese; may be empty. |
language, language_color | string | Primary language and display color; may be empty. |
stars, forks | integer | Totals shown on the Trending page at capture time. |
stars_gained | integer | Stars gained for the selected daily, weekly or monthly period, as shown by GitHub. |
captured_at | integer | Capture time as Unix seconds; not the repository creation time. |
github_url, gitstock_url | string | Links to the repository and its GitStock page. |
GET /trending/coverage
Check the available archive range before making historical requests. No parameters are required.
curl 'https://gitstock.org/api/v1/github/trending/coverage'Returns timezone and a periods array. Each entry contains period, earliest_date, latest_date, and snapshot_count (the number of distinct saved dates). Empty periods return empty date strings and a count of zero.
Errors
Error responses use an integer code matching the HTTP status, a msg string and data: null.
| HTTP status | JSON code (integer) | Meaning |
|---|---|---|
| 400 | 400 | Unsupported period, invalid calendar date, unsupported description language, or an explicitly empty date. |
| 404 | 404 | No saved snapshot for the requested date and period, or no snapshots collected yet. |
| 503 | 503 | Database temporarily unavailable. Retry later. |
{"code":404,"msg":"No snapshot is available for this date and period.","data":null}Data notes
- GitStock captures GitHub's all-language repository Trending lists at startup and hourly while the service is running.
- Each UTC date retains the last successful capture for each period. Earlier hourly captures on that date are replaced.
- Historical coverage starts with collected data. Missing dates are not reconstructed.
- This API covers the all-language list. Language-specific GitHub rankings and developer rankings are not included.
- There is no full commit-history dataset in these responses. GitStock is an independent service, not an official GitHub API.
For integrations, keep requests modest, avoid tight polling loops, and link to the relevant GitStock archive or project page when citing the data. Need help? Contact us.