# GitHub Repository Stats & Search API (`rod_analytics/github-repo-stats`) Actor

Get GitHub repository stats through the official REST API: stars, forks, watchers, issues, PRs, languages, releases, contributors count, commit activity, license and topics. Look up repos, search by language, stars, topics and dates, or list an organization.

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

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Repository Stats & Search API** exports clean **GitHub repository data** through the **official GitHub REST API**. For any repo you get **stars, forks, watchers, open issues, open PRs, languages, license, topics, latest release, contributors count, 52-week commit activity** and dates. Look up repos by URL, **search GitHub** by language, stars, topics and dates, or list every public repo of an **organization**. No browser, no HTML scraping, no personal data.

### What does GitHub Repository Stats & Search API do?

It turns [GitHub](https://github.com) repositories into one flat, typed row each. Paste `facebook/react` or `https://github.com/microsoft/vscode`, or search for `topic:ai-agents stars:>1000 pushed:>=2026-06-01`. The Actor calls `api.github.com`, adds the extras you picked and saves the result to a dataset.

Try it now: the prefilled input fetches **2 famous repositories** in a few seconds, **without a GitHub token**. It uses about 10 of GitHub's 60 free hourly requests. Adding a free GitHub token is recommended; without one, runs share GitHub's 60 requests per hour limit.

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 snapshot of your watchlist
- **Integrations** with Google Sheets, Airtable, Zapier, Make, Slack and webhooks
- **Monitoring** and alerts when a run fails

### Why use a GitHub repository stats scraper?

- **Open source research.** Measure adoption and health of projects: stars, forks, release cadence, commit activity, open issue and PR backlog.
- **Developer tools market analysis.** Map a category, such as vector databases or JavaScript bundlers. Compare language mix, licenses and momentum side by side.
- **VC scouting and deal sourcing.** Find fast-growing repos before they trend. Filter new repos by creation date, stars range and topics, then track them weekly.
- **Trending repos tracking.** Schedule a search sorted by stars or by recent updates and push new entries to Slack.
- **AI agents and LLM tools.** Give an agent one tool that answers "how active is this repo?" with numbers and a source link.
- **Due diligence and dependency risk.** Spot archived, unmaintained or unlicensed dependencies.

### How to get GitHub repository data

1. Open the **Input** tab.
2. Choose a **Mode**: repositories by URL, search, or organization.
3. Enter repo URLs, search filters or organization names.
4. Pick extras: languages, latest release, open PRs, contributors count, commit activity, README.
5. Optional: add your own **GitHub token** for 5,000 requests per hour.
6. Click **Start**. Download results as JSON, CSV, Excel or HTML, or read them through the API.

### Input

See the **Input** tab for full descriptions. Main fields:

| Field                             | Mode        | Notes                                                                                           |
| --------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| `mode`                            | all         | `repos`, `search` or `org`                                                                      |
| `repositories`                    | repos       | `owner/name`, `https://github.com/owner/name`, `.git` URLs all work. Renamed repos are followed |
| `searchQuery`                     | search      | Free text plus any GitHub search qualifier                                                      |
| `language`                        | search      | Primary language, for example `Rust`                                                            |
| `minStars`, `maxStars`            | search      | Stars range                                                                                     |
| `topics`                          | search      | All topics must match                                                                           |
| `createdFrom`, `createdTo`        | search      | Creation date range                                                                             |
| `pushedFrom`, `pushedTo`          | search      | Last push date range                                                                            |
| `sort`, `order`                   | search      | Stars, forks, updated, help wanted issues, best match                                           |
| `organizations`                   | org         | Org or user logins, public repos only                                                           |
| `includeForks`, `includeArchived` | search, org | Filters                                                                                         |
| `maxItems`                        | all         | Default 50                                                                                      |
| `include*`                        | all         | Extras. Each costs 1 GitHub request per repo                                                    |
| `githubToken`                     | all         | Optional, secret. A fine-grained token with no extra permissions is enough                      |
| `maxRateLimitWaitSecs`            | all         | Wait for the hourly reset up to this long, default 600                                          |

Example: new AI agent repos with momentum.

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

### Output

One item per repository. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. Views in the **Output** tab: **Overview**, **Activity** and **Details**. A `RUN_SUMMARY` record in the key-value store lists repos not found, why the run stopped early, if it did, and the remaining rate limit. Repos that do not exist or are private are skipped and not charged.

```json
{
    "fullName": "microsoft/vscode",
    "requestedName": "microsoft/vscode",
    "url": "https://github.com/microsoft/vscode",
    "description": "Visual Studio Code",
    "stars": 193154,
    "forks": 43621,
    "watchers": 3543,
    "openIssues": 18445,
    "openPullRequests": 2705,
    "language": "TypeScript",
    "languages": { "TypeScript": 177927887, "CSS": 2992525, "JavaScript": 1163259 },
    "languagesPercent": { "TypeScript": 96.2, "CSS": 1.6, "JavaScript": 0.6 },
    "topics": ["editor", "electron", "microsoft", "typescript", "visual-studio-code"],
    "license": "MIT",
    "createdAt": "2015-09-03T20:23:38Z",
    "pushedAt": "2026-09-27T08:36:17Z",
    "updatedAt": "2026-09-27T11:16:24Z",
    "archived": false,
    "isFork": false,
    "defaultBranch": "main",
    "latestRelease": {
        "tag": "1.139.1",
        "name": "1.139.1",
        "publishedAt": "2026-09-25T09:58:03Z",
        "url": "https://github.com/microsoft/vscode/releases/tag/1.139.1"
    },
    "contributorsCount": 315,
    "commitActivity52w": { "totalCommits": 33289, "firstWeekStart": "2025-10-05", "weeklyCommits": [403, 388, 706] },
    "commits52w": 33289,
    "homepage": "https://code.visualstudio.com",
    "sizeKb": 1496935,
    "source": "repos",
    "fetchedAt": "2026-09-27T11:16:57.394Z"
}
```

### Data fields

| Field                                           | Description                                                                                  |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `fullName`, `owner`, `name`, `url`              | Repository identity                                                                          |
| `requestedName`                                 | Mode `repos`: your input entry. Differs from `fullName` when GitHub redirects a renamed repo |
| `description`, `homepage`, `topics`             | As set by the maintainers. E-mails are removed                                               |
| `stars`, `forks`, `watchers`                    | `watchers` is real subscribers, not the stars alias                                          |
| `openIssues`, `openPullRequests`                | With the PR extra, `openIssues` excludes PRs                                                 |
| `language`, `languages`, `languagesPercent`     | Primary language, bytes per language, share per language. Shares under 0.05 % are left out   |
| `license`, `licenseName`                        | SPDX id, for example `MIT`, or `Other`                                                       |
| `createdAt`, `pushedAt`, `updatedAt`            | ISO timestamps                                                                               |
| `archived`, `isFork`, `defaultBranch`, `sizeKb` | Repository flags and size                                                                    |
| `latestRelease`                                 | `tag`, `name`, `publishedAt`, `url`                                                          |
| `contributorsCount`                             | Contributors linked to GitHub accounts, count only                                           |
| `commitActivity52w`, `commits52w`               | Weekly commits for the last 52 weeks and their total                                         |
| `readmeExcerpt`                                 | First 2,000 characters of the README, e-mails removed                                        |
| `source`, `fetchedAt`                           | Mode that produced the row and fetch time                                                    |

### How much does it cost to get GitHub repository stats?

Price: **$2 per 1,000 repositories**, all extras included, plus $0.001 per run start. The prefilled run of 2 repos costs half a cent. Repos that are not found are free. Set **Maximum cost per run** and the Actor stops at that budget. With Apify's free $5 monthly credit you can fetch about 2,500 repositories per month.

GitHub's own limits matter more than money:

- **Without a token:** 60 requests per hour per IP. Default options use 5 requests per repo, so about 11 repos per hour. Apify IPs can be shared, so the limit may already be partly used. If it runs out, the Actor keeps what it saved, stops with a clear status message and still finishes as succeeded. You pay only for saved repos.
- **With your token:** 5,000 requests per hour, about 1,000 repos per hour with default extras. Search is limited to 30 queries per minute.

### Tips for faster and cheaper runs

- Add a **GitHub token**. Open [GitHub token settings](https://github.com/settings/personal-access-tokens/new), create a fine-grained token, choose **Public repositories** and add no permissions. Paste it into `githubToken`. 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; the next run usually has it.
- For very large repos, GitHub may refuse the contributor list. Then `contributorsCount` is `null`.
- Raise `maxRateLimitWaitSecs` for jobs larger than your hourly limit, or schedule smaller runs.

### FAQ, disclaimers and support

**Is it legal to collect GitHub repository data?** This Actor uses only the official GitHub REST API and public repositories. It follows GitHub's API Terms and Acceptable Use Policies. It returns **repository-level data only**: no user e-mails, no profile data, contributors only as a count. 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.

**Does it scrape github.com pages?** No. Only `api.github.com` is called.

**Can I get private repositories?** No. The Actor is limited to public repositories on purpose.

**Why is `contributorsCount` lower than the number on GitHub?** The API counts contributors linked to GitHub accounts, and GitHub links at most 500 commit author e-mails per repository. Anonymous contributors are not counted, to avoid handling commit e-mails.

**What happens if my input is invalid?** The run still ends **SUCCEEDED** and you pay only the small start fee. No repository is charged. The dataset gets one help row, and the run status message says the same:

```json
{
    "error": true,
    "errorCode": "EMPTY_INPUT",
    "message": "Mode \"repos\" needs at least one entry in \"repositories\".",
    "howToFix": "Add repositories as \"owner/repo\" or GitHub URLs ..."
}
```

Codes: `EMPTY_INPUT` (nothing to fetch for the chosen mode), `INVALID_INPUT` (a wrong repository or organization name, date, sort or star range), `INVALID_TOKEN` (GitHub rejected `githubToken`), `QUERY_REJECTED` (GitHub rejected the search query) and `NO_RESULTS` (nothing matched, with the names that were not found). Hitting the GitHub rate limit is not an error either: the run keeps what it saved and says when the limit resets. GitHub outages still fail the run.

**Something missing or broken?** Open an issue in the **Issues** tab. Custom data pipelines, for example weekly market maps or trend alerts, are available on request.

# Actor input Schema

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

What to fetch: specific repositories, a repository search, or all public repositories of organizations or users.

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

GitHub repository URLs or full names, for example https://github.com/facebook/react or facebook/react.

## `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.

## `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.

## `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`):

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

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

If the GitHub hourly limit runs out, wait up to this long for the reset. Longer waits stop the run and keep the data saved so far.

## Actor input object example

```json
{
  "mode": "repos",
  "repositories": [
    "microsoft/vscode",
    "https://github.com/python/cpython"
  ],
  "sort": "stars",
  "order": "desc",
  "includeForks": false,
  "includeArchived": true,
  "maxItems": 50,
  "includeLanguages": true,
  "includeLatestRelease": true,
  "includeOpenPullRequests": true,
  "includeContributorsCount": true,
  "includeCommitActivity": false,
  "includeReadme": false,
  "maxRateLimitWaitSecs": 120
}
```

# Actor output Schema

## `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": "repos",
    "repositories": [
        "microsoft/vscode",
        "https://github.com/python/cpython"
    ],
    "maxRateLimitWaitSecs": 120
};

// 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": "repos",
    "repositories": [
        "microsoft/vscode",
        "https://github.com/python/cpython",
    ],
    "maxRateLimitWaitSecs": 120,
}

# 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": "repos",
  "repositories": [
    "microsoft/vscode",
    "https://github.com/python/cpython"
  ],
  "maxRateLimitWaitSecs": 120
}' |
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/ZeA9kqgBGMbljMI0C/openapi.json
