Skip to content
Home

/

Blog

/

Web scraping

/

How to Scrape GitHub Trending Repositories (No Official API)

Published · Last updated

9 min read

How to Scrape GitHub Trending Repositories (No Official API)

There is no official GitHub trending API. Here is how to get the daily, weekly and monthly trending repositories as data: the URLs and selectors, a short Python scraper, the Search API alternative, history via GH Archive, and a scheduled no-code version.

Autonoly Team

Autonoly Team

AI Automation Experts

github trending scraper
scrape github trending
github trending api
github.com/trending since daily
github trending weekly
github trending monthly
github trending history
github trending to google sheets

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.

FieldSelector inside article.Box-rowExample
Repository (owner/name)h2 a (use the href)/vercel-labs/agent-browser
DescriptionpOne-line description, may be missing
Primary language[itemprop="programmingLanguage"]Rust (missing for some repos)
Total starsa[href$="/stargazers"]50,019
Forksa[href$="/forks"]3,493
Stars gained in the periodspan.float-sm-right"708 stars today" / "this week" / "this month"
Built bya[data-hovercard-type="user"] imgUp 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:rust finds active, already-popular repos in one language.
  • The stargazers endpoint with the application/vnd.github.star+json media type returns starred_at timestamps, 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 gh CLI.

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?

Frequently Asked Questions

No. GitHub publishes the trending list only as an HTML page at github.com/trending. Third-party "trending APIs" scrape that page for you. The official GitHub Search API can approximate trending by sorting recently created repositories by stars, but it is not the same list.

Put this into action with Autonoly

Related guides and tools to automate what you just read about — no code required.

Related terms, automations and guides

The concepts and workflows referenced in this article.

GuideHow to Scrape and Crawl Dynamic Websites (Why JavaScript Pages Come Back Empty)Why requests, BeautifulSoup and Google Sheets' IMPORTXML return empty results on JavaScript pages, and the four ways to get the data: embedded JSON, the site's own XHR/JSON endpoints, a rendered browser with proper waits, and handling infinite scroll, load-more buttons and JS-built links when crawling.GuideHow to Scrape Product Hunt for Trending Products and Startup IdeasLearn how to scrape Product Hunt for daily trending products, upvotes, taglines, and maker information using browser automation. Export to Google Sheets, schedule daily runs, and build a startup idea database without writing code.GuideHow to Automate Google Sheets: Scrape, Transform, and Report on AutopilotLearn how to automate Google Sheets workflows including data scraping, transformation, and reporting. This guide covers auto-populating spreadsheets from websites, scheduling data updates, building self-refreshing dashboards, and connecting Sheets to your entire tool stack.GuideWeb Scraping Best Practices: Avoiding Blocks, Bans, and Legal IssuesA comprehensive guide to web scraping best practices. Learn how to avoid IP blocks, deal with CAPTCHAs and anti-bot systems, respect legal boundaries, and where AI browser agents help (and where they don't).GuideIs Web Scraping Legal? Court Cases, GDPR and the Rules in 2026Usually yes for public data, but contracts, privacy law and copyright still bite. What hiQ v. LinkedIn, Van Buren and Meta v. Bright Data actually decided, how GDPR and the EU database right apply, what robots.txt means, and a practical checklist.DefinitionPaginationPagination is how websites and APIs split a long list across several pages or loads: page-number URLs, Next links, "Load more" buttons, infinite scroll or cursor tokens. Scraping a paginated site means identifying the pattern, walking every page, knowing when to stop and removing duplicates.DefinitionAI AgentAn AI agent is an autonomous software system that uses large language models to perceive its environment, make decisions, and take actions to accomplish goals with minimal human direction.GuideHow to Scrape Any Website Directly Into Google Sheets Without CodeLearn how to scrape data from any website and send it directly to Google Sheets without writing code. This comprehensive guide covers the end-to-end flow from website to structured spreadsheet data, including handling dynamic sites, pagination, data cleaning, and scheduled runs.TemplateLinkedIn Company Page Scraper AI AgentAutomatically extract comprehensive company information from LinkedIn company pages with this intelligent AI Agent workflow. This template…GuideHow to Scrape Complete Y Combinator Startup Data in 3 Minutes Without Writing a Single Line of CodeLearn how to automatically extract Y Combinator's entire startup database using Autonoly's no-code automation platform. This step-by-step…

Put this into practice

Build this workflow in 2 minutes — no code required

Describe what you need in plain English. The AI agent handles the rest.

Free forever up to 100 tasks/month