Is There a GitHub Trending API?
No. GitHub has never shipped an official API for the trending page. The list at github.com/trending is only published as HTML, so every "GitHub trending API" you find is either a scraper someone hosts for you or an approximation built from the official Search API. That leaves three practical options:
- Scrape the trending page yourself (a few lines of Python, shown below). This is the only way to get the exact list GitHub shows, including the "stars today" figure.
- Approximate it with the GitHub Search API: official, stable and documented, but it returns "recently created repos with the most stars", not GitHub's trending ranking.
- Use a ready-made scraper or a no-code workflow that runs on a schedule and sends the list to Google Sheets or Slack.
The URLs you need
Everything on the trending page is controlled by the URL, which makes it easy to scrape:
github.com/trending?since=daily: today (this is the default, same asgithub.com/trending)github.com/trending?since=weekly: this weekgithub.com/trending?since=monthly: this monthgithub.com/trending/python?since=weekly: one programming language (use the slug from the Language dropdown, such asrustortypescript)&spoken_language_code=en: filter by the language of the README/descriptiongithub.com/trending/developers: trending developers instead of repositories
The length of the list varies. When we checked on 12 November 2026 the daily list had 10 repositories, the weekly list 13 and the monthly list 16; older snapshots often showed 25. Do not hard-code a row count.
What Data the Trending Page Shows (and the Selectors)
Each repository is an <article class="Box-row"> in the server-rendered HTML, so you do not need a browser to read it. These are the fields and the selectors that matched in November 2026. GitHub can change its markup at any time, so check them if your scraper suddenly returns empty fields.
| Field | Selector inside article.Box-row | Example |
|---|---|---|
| Repository (owner/name) | h2 a (use the href) | /vercel-labs/agent-browser |
| Description | p | One-line description, may be missing |
| Primary language | [itemprop="programmingLanguage"] | Rust (missing for some repos) |
| Total stars | a[href$="/stargazers"] | 50,019 |
| Forks | a[href$="/forks"] | 3,493 |
| Stars gained in the period | span.float-sm-right | "708 stars today" / "this week" / "this month" |
| Built by | a[data-hovercard-type="user"] img | Up to five contributor avatars |
The rank is simply the row's position. The "stars in period" number is the most useful one, because it measures momentum rather than age: a repo with 300 total stars and 200 stars today is a breakout; a repo with 100,000 stars and 50 today is a perennial.
GitHub does not document how trending is calculated, so treat it as a ranking signal, not a precise metric. Stars in period is the closest thing to a number you can compare across days.
Method 1: Scrape GitHub Trending With Python
Because the page is plain HTML, requests and BeautifulSoup are enough. Install them with pip install requests beautifulsoup4:
import re, requests
from bs4 import BeautifulSoup
def num(text):
m = re.search(r"[\d,]+", text or "")
return int(m.group().replace(",", "")) if m else None
def trending(language="", since="daily"):
url = f"https://github.com/trending/{language}?since={since}"
html = requests.get(url, headers={"User-Agent": "trending-digest ([email protected])"}, timeout=30).text
soup = BeautifulSoup(html, "html.parser")
rows = []
for rank, art in enumerate(soup.select("article.Box-row"), start=1):
link = art.select_one("h2 a")
desc = art.select_one("p")
lang = art.select_one('[itemprop="programmingLanguage"]')
stars = art.select_one('a[href$="/stargazers"]')
forks = art.select_one('a[href$="/forks"]')
gained = art.select_one("span.float-sm-right")
rows.append({
"rank": rank,
"repo": link["href"].strip("/"),
"description": desc.get_text(strip=True) if desc else "",
"language": lang.get_text(strip=True) if lang else "",
"stars": num(stars.get_text() if stars else ""),
"forks": num(forks.get_text() if forks else ""),
"stars_in_period": num(gained.get_text() if gained else ""),
"since": since,
})
return rows
for r in trending(since="daily"):
print(r)A few practical notes:
- One request per view. Daily, weekly and monthly for the main page plus a handful of languages is ten or so requests a day. There is no pagination to handle.
- Numbers are text. Stars and forks come with thousands separators, and the period count includes words ("1,078 stars today"), so parse the digits as the
num()helper does. - Empty is a valid result. The trending page is occasionally empty or shorter than usual. Log it instead of failing the run.
- Add a date column when you store results. The page has no history, so the date you scraped it is the only timestamp you will have.
- Identify yourself with a descriptive User-Agent and keep the request rate low. You are reading one page, not crawling GitHub.
Method 2: Approximate Trending With the GitHub Search API
If you need an official, documented source (for example inside a company that does not allow scraping), the GitHub Search API can approximate trending. The most common query is "repositories created recently, sorted by stars":
# New repositories created in the last 7 days, most-starred first
curl -s -H "Accept: application/vnd.github+json" \
"https://api.github.com/search/repositories?q=created:>2026-11-05&sort=stars&order=desc&per_page=25"Be clear about what this is: it finds new repositories with the most stars, while GitHub Trending also surfaces old repositories that are suddenly gaining stars. Other options in the official API:
q=pushed:>2026-11-05 stars:>500 language:rustfinds active, already-popular repos in one language.- The stargazers endpoint with the
application/vnd.github.star+jsonmedia type returnsstarred_attimestamps, so you can compute stars gained per day for a specific repo. - The Search API has its own low rate limit (it is separate from the main REST limit and much smaller), so authenticate with a token and cache results.
Historical trending data
GitHub keeps no archive of past trending lists. If you need history from before you started scraping, the public GH Archive dataset records every public star event (WatchEvent) and can be queried to reconstruct which repos gained the most stars on a given day. It will not match GitHub's ranking exactly, but it is the most complete free source. Going forward, the simplest archive is your own daily scrape.
Method 3: A Scheduled GitHub Trending Scraper in Autonoly
If you would rather not maintain a script and a server, you can build the same scraper in Autonoly without code and run it on a schedule.
1. Ask the agent once
Start a session with the AI agent and describe the job, for example:
"Open github.com/trending?since=daily. For every repository row, extract the owner/name, description, language, total stars, forks and stars today. Then append the rows to my 'GitHub Trending' Google Sheet with today's date in the first column."
The agent opens the page in a real Chromium browser (you can watch it in the live view), extracts the repeated rows with the data extraction step for lists (the item selector is article.Box-row), and writes the result with the Google Sheets integration, which appends rows by default.
2. Convert it to a workflow and schedule it
Once the output looks right, convert the session into a workflow. The saved workflow is the same steps without the chat: open the URL, extract the list, append to the sheet. Add a schedule trigger (a cron schedule with your timezone), for example every day at 23:00.
3. Add more views
Saved workflows do not have a loop node, so each extra view (weekly, monthly, /trending/python, /trending/rust) is its own navigate and extract pair in the workflow, plus a column that records which view the row came from. That is fine for a handful of views. Opening every trending repo to summarise its README is a job for the agent in chat rather than a scheduled workflow, for the same reason.
Want it in Slack instead?
If the goal is a daily digest for your team rather than a dataset, see get GitHub trending repos in Slack automatically, which walks through the Slack message format, per-channel language filters and comparing today's list with yesterday's.
What to Do With a Trending Dataset
A single day of trending is a curiosity; a few months of it is a dataset. Once you have a date column, a few analyses are worth setting up:
- Repeat trending. Count the distinct days each repo appears. Repos that trend on many separate days have sustained interest; one-day spikes are often launches or Hacker News posts.
- Breakouts. Filter for low total stars and high stars in period. These are new projects early in their growth.
- Language share. Count trending repos per language per week to see which ecosystems are getting attention.
- New entries only. Compare today's list with yesterday's and keep only repos you have not seen before. That turns a noisy daily list into a short "what is new" feed.
- Enrichment. For the repos you care about, call the GitHub REST API for license, topics, open issues and last push date. In Autonoly the agent can do this in its terminal with Python or the
ghCLI.
Store the repo as owner/name and treat it as the key. Expect the same repo to appear on the daily, weekly and monthly lists at once and on language pages too, so keep the view column rather than de-duplicating it away.
GitHub's Rules on Scraping
GitHub's Acceptable Use Policies define scraping as extracting information from the service by an automated process and address it directly: researchers may use public, non-personal information for research, archivists may use public information for archiving, and nobody may use information from GitHub for spam or to sell personal information (for example to recruiters). The policies also prohibit "excessive automated bulk activity".
Reading the trending page a few times a day to track projects sits comfortably inside that. Harvesting the profiles or email addresses of the "Built by" contributors for outreach does not. If you need large volumes of repository data, use the REST or GraphQL API with a token, which is what it is for. For the general legal picture, see is web scraping legal?