# GitHub Scraper: Repo Stats, Stars, Trending & Search (`rod_analytics/github-repo-stats`) Actor

Scrape GitHub trending repositories by language and period with no token. Get repo stats via the official API: stars, forks, watchers, issues, PRs, languages, releases, contributors and commit activity. Search by language, stars, topics and dates, or list an org.

- **URL**: https://apify.com/rod_analytics/github-repo-stats.md
- **Developed by:** [Rod Services](https://apify.com/rod_analytics) (community)
- **Categories:** Developer tools, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 repositories

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**GitHub Scraper** for **repo stats, stars, forks, GitHub trending and repository search**. Export clean GitHub repository data to JSON, CSV or Excel, and track **trending repositories** by language, today, this week or this month, with **no GitHub token needed** for trending.

For any repo you get **stars, forks, watchers, open issues, open PRs, languages, license, topics, latest release, contributors count and 52-week commit activity**. Look up repos by URL, search GitHub by language, stars, topics and dates, list every public repo of an organization, or scrape **github.com/trending**. Repository data only, no personal data.

### What you get

- **Trending mode**: the GitHub trending list with rank, stars, forks, **stars gained in the period**, language, description and the "built by" logins. One page per language, up to 25 repos each. No token, no API requests.
- **Repo stats mode**: one typed row per repository from the official GitHub REST API, with the extras you pick.
- **Search mode**: GitHub repository search by keywords, language, stars range, topics, created and pushed dates. Sorted by stars, forks or updates.
- **Organization mode**: every public repository of an organization or user.
- **Auto mode** (default): fill one section and the Actor picks the mode for you. Handy for AI agents and API calls.

Running on Apify gives you:

- **API access** to runs and datasets from any language, plus an **MCP** endpoint for AI agents
- **Scheduling**, for example a daily trending snapshot or a weekly watchlist refresh
- **Integrations** with Google Sheets, Airtable, Zapier, Make, Slack and webhooks
- **Monitoring** and alerts when a run fails

### Quick start

1. Click **Try for free**. The prefilled input scrapes **today's GitHub trending repositories** across all languages in a few seconds, without a token.
2. To track one language, add it to **Trending languages**, for example `Python`, `Rust` or `TypeScript`, and pick **Today**, **This week** or **This month**.
3. For stats of specific repos, switch **Mode** to repositories (or leave it on Auto) and paste `owner/repo` names or GitHub URLs.
4. Optional: add your own free **GitHub token** for API modes. It raises the GitHub limit from 60 to 5,000 requests per hour.
5. Click **Start**. Download results as JSON, CSV, Excel or HTML, or read them through the API.

### Input examples

Trending Python repos this week, no token:

```json
{
    "mode": "trending",
    "trendingLanguages": ["Python"],
    "trendingPeriod": "weekly",
    "maxItems": 25
}
```

Stats for a watchlist of repos:

```json
{
    "repositories": ["microsoft/vscode", "https://github.com/python/cpython"],
    "includeCommitActivity": true
}
```

New AI agent repos with momentum, by search:

```json
{
    "mode": "search",
    "topics": ["ai-agents"],
    "minStars": 500,
    "createdFrom": "2026-01-01",
    "pushedFrom": "2026-09-01",
    "sort": "stars",
    "maxItems": 200
}
```

Main fields. See the **Input** tab for all of them.

| Field                             | Mode      | Notes                                                                                    |
| --------------------------------- | --------- | ---------------------------------------------------------------------------------------- |
| `mode`                            | all       | `auto` (default), `trending`, `repos`, `search` or `org`                                 |
| `trendingLanguages`               | trending  | Language names as on GitHub, for example `C++` or `Jupyter Notebook`. Empty = all        |
| `trendingPeriod`                  | trending  | `daily` (default), `weekly` or `monthly`                                                 |
| `trendingSpokenLanguage`          | trending  | Optional 2-letter code, for example `en` or `zh`                                         |
| `enrichTrending`                  | trending  | Add full API stats to each trending row. Uses API requests                               |
| `repositories`                    | repos     | `owner/name`, `https://github.com/owner/name` or `.git` URLs. Renamed repos are followed |
| `searchQuery`, `language`         | search    | Free text plus any GitHub search qualifier, and the primary language                     |
| `minStars`, `maxStars`, `topics`  | search    | Stars range, topics that must all match                                                  |
| `createdFrom/To`, `pushedFrom/To` | search    | Date ranges, YYYY-MM-DD                                                                  |
| `organizations`                   | org       | Org or user logins, public repos only                                                    |
| `maxItems`                        | all       | Default 50                                                                               |
| `include*`                        | API modes | Extras. Each costs 1 GitHub request per repo                                             |
| `githubToken`                     | API modes | Optional, secret. A fine-grained token with no extra permissions is enough               |

### Output sample

One item per repository. Views in the **Output** tab: **Trending**, **Overview**, **Activity** and **Details**. A `RUN_SUMMARY` record lists repos not found, why the run stopped early, if it did, and the remaining GitHub limit. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

A trending row:

```json
{
    "trendingRank": 1,
    "fullName": "tester-army/e2e",
    "url": "https://github.com/tester-army/e2e",
    "description": "Next generation e2e testing framework for web and mobile apps.",
    "language": "TypeScript",
    "stars": 3871,
    "forks": 156,
    "starsInPeriod": 1430,
    "trendingPeriod": "daily",
    "trendingLanguage": null,
    "builtBy": ["okwasniewski", "kacperkapusciak"],
    "source": "trending"
}
```

A repo stats row, shortened:

```json
{
    "fullName": "microsoft/vscode",
    "stars": 193154,
    "forks": 43621,
    "watchers": 3543,
    "openIssues": 18445,
    "openPullRequests": 2705,
    "language": "TypeScript",
    "languagesPercent": { "TypeScript": 96.2, "CSS": 1.6, "JavaScript": 0.6 },
    "topics": ["editor", "electron", "microsoft", "typescript", "visual-studio-code"],
    "license": "MIT",
    "pushedAt": "2026-09-27T08:36:17Z",
    "latestRelease": { "tag": "1.139.1", "publishedAt": "2026-09-25T09:58:03Z" },
    "contributorsCount": 315,
    "commits52w": 33289,
    "source": "repos"
}
```

| Field                                          | Description                                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `fullName`, `owner`, `name`, `url`             | Repository identity                                                                        |
| `stars`, `forks`, `watchers`                   | `watchers` is real subscribers, not the stars alias. Trending rows without API stats: null |
| `trendingRank`, `starsInPeriod`, `builtBy`     | Trending only: position, stars gained in the period, contributor logins shown on the page  |
| `openIssues`, `openPullRequests`               | With the PR extra, `openIssues` excludes PRs                                               |
| `language`, `languages`, `languagesPercent`    | Primary language, bytes and share per language                                             |
| `license`, `topics`, `description`, `homepage` | As set by the maintainers. E-mails are removed                                             |
| `createdAt`, `pushedAt`, `updatedAt`           | ISO timestamps                                                                             |
| `latestRelease`, `contributorsCount`           | Latest release tag and date, contributor count only                                        |
| `commitActivity52w`, `commits52w`              | Weekly commits for the last 52 weeks and their total                                       |
| `source`, `fetchedAt`                          | Mode that produced the row and fetch time                                                  |

### Pricing

Pay per result. No subscription. Repos that are not found are free, and help rows for input problems are free.

| Event                 | Free plan | Bronze | Silver | Gold   |
| --------------------- | --------- | ------ | ------ | ------ |
| Repository, per 1,000 | $2.00     | $1.80  | $1.60  | $1.40  |
| Run start             | $0.001    | $0.001 | $0.001 | $0.001 |

The prefilled trending run saves about 10 to 25 repos and costs about 3 to 5 cents. With Apify's free $5 monthly credit you can fetch about 2,500 repositories per month. Set **Maximum cost per run** and the Actor stops at that budget.

GitHub's own limits matter more than money:

- **Trending mode:** no token and no API requests. One page request per language.
- **API modes without a token:** GitHub allows 60 requests per hour per IP, and Apify IPs can be shared. Default extras use 5 requests per repo, so expect about 10 repos per hour. If the limit runs out, the Actor keeps what it saved. If nothing was saved, it ends with one free `RATE_LIMITED` help row that says when the limit resets.
- **API modes with your token:** 5,000 requests per hour, about 1,000 repos per hour with default extras.

### Use with AI agents (MCP)

Add this Actor to Claude, Cursor or any MCP client through [mcp.apify.com](https://mcp.apify.com). Agents can call it with just `{"repositories": ["owner/repo"]}`, `{"trendingLanguages": ["Rust"]}` or `{"searchQuery": "vector database"}`. Auto mode picks the right job.

### Tips

- Add a **GitHub token** for API modes. Open [GitHub token settings](https://github.com/settings/personal-access-tokens/new), create a fine-grained token, choose **Public repositories** and add no permissions. It is stored encrypted and never logged.
- Turn off extras you do not need. Each extra costs 1 request per repo.
- GitHub search returns at most **1,000 results per query**. Split big searches by stars ranges or creation dates.
- **Commit activity** is computed by GitHub on demand. The first call for a repo can come back empty.
- Schedule trending daily or weekly and send new rows to Slack or Google Sheets with an integration.

### FAQ

**Do I need a GitHub token?** Not for trending. For repo stats, search and organization lists, a token is optional but recommended: without one GitHub allows only 60 API requests per hour.

**How does trending work?** The Actor reads the public github.com/trending page, one request per language and period, the same list you see in the browser. GitHub shows up to 25 repositories per page. Turn on `enrichTrending` to add full API stats to each row.

**Is it legal to collect GitHub repository data?** The Actor returns **repository-level data only**: no e-mails and no profile data. Contributors appear only as a count, and trending rows carry only the public logins GitHub shows under "Built by". API modes use the official GitHub REST API. Do not use the data for spam, recruiting outreach or selling personal information, which GitHub forbids. You are responsible for your use of the data.

**Can I get private repositories?** No. Public repositories only.

**What happens if my input is invalid?** The run still ends **SUCCEEDED** and you pay only the start fee. The dataset gets one free help row with `error`, `errorCode`, `message` and `howToFix`. Codes: `EMPTY_INPUT`, `INVALID_INPUT`, `INVALID_TOKEN`, `QUERY_REJECTED`, `NO_RESULTS` and `RATE_LIMITED`.

**Something missing or broken?** Open an issue in the **Issues** tab. We reply fast.

### Related Actors

| Actor                                                                                                               | What it does                                          |
| ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| [Website Content Crawler to Markdown for RAG & LLMs](https://apify.com/rod_analytics/website-to-markdown)           | Crawl a site and get clean Markdown for RAG and LLMs  |
| [PDF to Markdown & Text Extractor with OCR](https://apify.com/rod_analytics/doc-to-markdown)                        | Turn PDF, DOCX and scans into Markdown or text        |
| [SEO Audit Tool: Site Crawler, Broken Links & Score](https://apify.com/rod_analytics/seo-site-audit)                | Crawl a site for broken links and SEO issues          |
| [PageSpeed Insights & Lighthouse Bulk Checker](https://apify.com/rod_analytics/lighthouse-audit)                    | Core Web Vitals and Lighthouse scores for many URLs   |
| [Tech Stack Detector: Wappalyzer & BuiltWith Alternative](https://apify.com/rod_analytics/tech-stack-detector)      | See which CMS, analytics and frameworks a site uses   |
| [Bulk Domain Lookup: DNS, WHOIS, SPF, DMARC & SSL](https://apify.com/rod_analytics/domain-security-audit)           | DNS, mail security and SSL checks for domain lists    |
| [Speech to Text: Audio, Video & Podcast Transcriber](https://apify.com/rod_analytics/media-transcriber)             | Transcribe audio, video and podcasts                  |
| [Email Validator & Verifier: Bulk MX & Disposable Check](https://apify.com/rod_analytics/bulk-email-verifier)       | Clean email lists before you send                     |
| [Website Contact Scraper: Emails, Phones & Social Links](https://apify.com/rod_analytics/company-contact-extractor) | Emails, phones and social links from company websites |
| [VIES VAT Checker & EU Company Registry Lookup](https://apify.com/rod_analytics/eu-company-lookup)                  | Validate EU VAT numbers and look up companies         |
| [Companies House Scraper: UK Company Search & Officers](https://apify.com/rod_analytics/uk-companies-house)         | UK company profiles, officers and filings             |
| [EU TED Tenders Scraper & Alerts: Public Procurement](https://apify.com/rod_analytics/ted-tenders)                  | EU public tenders with daily alerts                   |
| [Greenhouse, Lever & Ashby Job Scraper: 7 ATS in One Feed](https://apify.com/rod_analytics/multi-ats-jobs-api)      | Jobs from 7 ATS platforms in one feed                 |

# Changelog

This Actor's version history is a separate document: https://apify.com/rod_analytics/github-repo-stats/changelog.md

# Actor input Schema

## `mode` (type: `string`):

What to fetch. Auto picks the mode from the section you fill: repositories, organizations, trending, or search filters. Trending reads github.com/trending and needs no GitHub token.

## `trendingLanguages` (type: `array`):

Programming languages as GitHub names them, for example Python, TypeScript, Rust, C++ or Jupyter Notebook. Empty means all languages. One page per language.

## `trendingPeriod` (type: `string`):

Trending today, this week or this month. Default: daily.

## `trendingSpokenLanguage` (type: `string`):

Optional. Only repositories whose README is in this spoken language, as a 2-letter code, for example en, zh, es or de.

## `enrichTrending` (type: `boolean`):

Off: rows hold what the trending page shows (stars, forks, stars in period, language, description, built by). On: each row also gets watchers, open issues, license, topics, dates and the extras below, with about 5 API requests per repository. Without a token GitHub allows 60 per hour, so only the first few rows get details and the rest keep the page data.

## `repositories` (type: `array`):

GitHub repository URLs or full names, for example https://github.com/facebook/react or facebook/react. About 5 GitHub API requests per repository with the default extras.

## `searchQuery` (type: `string`):

Free text or any GitHub search qualifier, for example "llm agent in:name,description" or "org:apache".

## `language` (type: `string`):

Primary language, for example TypeScript, Python, Rust or Go. In trending mode it is used when "Trending languages" is empty.

## `minStars` (type: `integer`):

Only repositories with at least this many stars.

## `maxStars` (type: `integer`):

Only repositories with at most this many stars.

## `topics` (type: `array`):

Repository topics. Every topic must match, for example ai-agents or llm.

## `createdFrom` (type: `string`):

Repository created on or after this date.

## `createdTo` (type: `string`):

Repository created on or before this date.

## `pushedFrom` (type: `string`):

Last push on or after this date. Use it to skip abandoned projects.

## `pushedTo` (type: `string`):

Last push on or before this date.

## `sort` (type: `string`):

Search result order. GitHub returns at most 1,000 results per query.

## `order` (type: `string`):

Sort direction.

## `organizations` (type: `array`):

GitHub organization or user logins, or their URLs, for example vercel or https://github.com/apify. Only public repositories are listed.

## `includeForks` (type: `boolean`):

Include forked repositories in search and organization results.

## `includeArchived` (type: `boolean`):

Include archived (read-only) repositories in search and organization results.

## `maxItems` (type: `integer`):

Maximum number of repositories to save. GitHub search is capped at 1,000 per query, trending at 25 per language.

## `includeLanguages` (type: `boolean`):

Bytes and share per language. 1 extra request per repository.

## `includeLatestRelease` (type: `boolean`):

Tag and publish date of the latest release. 1 extra request per repository.

## `includeOpenPullRequests` (type: `boolean`):

Count open PRs and report open issues without PRs. 1 extra request per repository.

## `includeContributorsCount` (type: `boolean`):

Number of contributors with a GitHub account. Only the count is stored, never profiles. 1 extra request per repository. Very large repositories may return empty.

## `includeCommitActivity` (type: `boolean`):

Weekly commit counts for the last year. GitHub computes these on demand, so the first call can be slow or empty. 1 to 4 extra requests per repository.

## `includeReadme` (type: `boolean`):

First 2,000 characters of the README, with e-mail addresses removed. 1 extra request per repository.

## `githubToken` (type: `string`):

Optional. Your own personal access token for 5,000 API requests per hour instead of 60. A fine-grained token with public repository read access and no other permissions is enough. Not needed for trending. Stored encrypted, never logged or saved to the dataset.

## `maxRateLimitWaitSecs` (type: `integer`):

If the GitHub hourly API limit runs out, wait up to this long for the reset. Longer waits stop the run, keep the data saved so far and explain the limit in a free help row.

## Actor input object example

```json
{
  "mode": "trending",
  "enrichTrending": false,
  "sort": "stars",
  "order": "desc",
  "includeForks": false,
  "includeArchived": true,
  "maxItems": 25,
  "includeLanguages": true,
  "includeLatestRelease": true,
  "includeOpenPullRequests": true,
  "includeContributorsCount": true,
  "includeCommitActivity": false,
  "includeReadme": false,
  "maxRateLimitWaitSecs": 60
}
```

# Actor output Schema

## `trending` (type: `string`):

No description

## `overview` (type: `string`):

No description

## `activity` (type: `string`):

No description

## `details` (type: `string`):

No description

## `allFields` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "trending",
    "maxItems": 25,
    "maxRateLimitWaitSecs": 60
};

// Run the Actor and wait for it to finish
const run = await client.actor("rod_analytics/github-repo-stats").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "trending",
    "maxItems": 25,
    "maxRateLimitWaitSecs": 60,
}

# Run the Actor and wait for it to finish
run = client.actor("rod_analytics/github-repo-stats").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "trending",
  "maxItems": 25,
  "maxRateLimitWaitSecs": 60
}' |
apify call rod_analytics/github-repo-stats --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rod_analytics/github-repo-stats"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/vgJ0Xj01fAhuG0TwC/builds/R7FYSf0btbfNNCsIP/openapi.json
