# GitHub Trending Scraper (`fetch_cat/github-trending-scraper`) Actor

Scrape GitHub Trending repositories by language and time window for developer research, newsletters, and market intelligence.

- **URL**: https://apify.com/fetch_cat/github-trending-scraper.md
- **Developed by:** [Fetch Cat](https://apify.com/fetch_cat) (community)
- **Categories:** Developer tools, Business, News
- **Features:** Limited permissions
- **Stats:** 5 total users, 4 monthly users, 98.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 trending repository saveds

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

Export public GitHub Trending repositories by programming language and daily, weekly, or monthly window. Get page ranks, descriptions, stars, forks, stars gained and contributor links, with optional README text for research and newsletter workflows.

GitHub shows a finite Trending list, not every repository matching a topic. Results preserve GitHub's page order. This Actor does not filter for AI projects or globally sort multiple languages by star growth.

### Quick start

1. Choose languages, or use an empty list for overall Trending.
2. Select a time window and a small total result limit.
3. Start the Actor and download the dataset as CSV, JSON or Excel.

```json
{
  "languages": ["python"],
  "since": "weekly",
  "maxItems": 10,
  "includeReadme": false,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

Prefer a video guide? This short Apify walkthrough shows you how to set up and run an Actor. It uses a different Actor, but the setup steps are the same.

https://youtu.be/1OW8gOqlZbY?t=25

### Ready-to-run examples

Choose a public example to see its settings before starting a run:

- [Scrape weekly Python repositories from GitHub Trending](https://apify.com/fetch_cat/github-trending-scraper/examples/scrape-python-github-trending-weekly)
- [Scrape overall GitHub Trending today](https://apify.com/fetch_cat/github-trending-scraper/examples/scrape-overall-github-trending-today)

### What you get

One repository row within a requested language and time-window snapshot, with its page-local rank and available description, star, fork and selected-window growth values. A repository can appear in multiple language snapshots. Optional public README text and warnings remain source-dependent.

### Who is it for?

- **Developer-newsletter editors** preparing a repository shortlist for manual reading.
- **Technology researchers** reviewing current language-specific Trending snapshots.
- **Text-analysis teams** collecting a small amount of available public README text.
- **Data teams** connecting dated snapshots to their own reporting tools.

### How you can use the data

- **Prepare a weekly Python editorial shortlist.** Use the existing Python weekly recipe with a small total cap. Keep `repoUrl`, `repositoryDescription`, `rank` and available `starsGained` together before reading repositories and selecting items yourself.
- **Review overall Trending today.** Use an empty language list and the daily window. Keep page-local ranks and source URLs rather than combining them into an invented global ranking across separately collected languages.
- **Inspect a small README sample.** Enable text enrichment for a few repositories when available descriptions are insufficient. Use the returned README URL, text and truncation flag as input to your own reading or analysis rather than assuming every repository has an accessible README.
- **Compare dated observations downstream.** Preserve language, window, snapshotKey and `scrapedAt` with each export. Compare saved records in your own system without treating selected-window source metrics as a calculated historical star-growth series or expecting built-in alerts.

### Input settings

| Setting | JSON key | Purpose |
| --- | --- | --- |
| Languages | `languages` | Up to 20 language names/slugs. Empty means overall Trending. |
| Resume pending languages | `resumePendingLanguages` | Optional recovery list. Replaces `languages` for this run. |
| Time window | `since` | `daily` (default), `weekly` or `monthly`. |
| Maximum repositories | `maxItems` | Total cap of 1–500, default 20. |
| Include README text | `includeReadme` | Optional enrichment, off by default. At most 25 repositories. |
| Proxy configuration | `proxyConfiguration` | Optional connection settings. The form defaults to disabled. See field help for details. |

The form prefills JavaScript and Python.  API inputs without `languages` select overall Trending. Languages are visited in input order, so an early page can use the entire result limit. Counts may be lower than requested.

For a small text-enriched input, use the quick-start JSON with `maxItems: 3` and `includeReadme: true`.

#### Example inputs

Use the Quick start input as a small first run. Adjust the fields described above for your own data.

### Output data

Each saved row represents a repository within one language/time-window snapshot. The same repository may occur in multiple language snapshots. Missing source metrics are `null`.  README fields are optional.

Illustrative output shape only (not a measured current repository snapshot):

```json
{
  "rank": 1,
  "owner": "example-org",
  "repo": "example-project",
  "fullName": "example-org/example-project",
  "repoUrl": "https://github.com/example-org/example-project",
  "repositoryDescription": null,
  "language": "Python",
  "stars": null,
  "forks": null,
  "starsGained": null,
  "builtBy": [],
  "since": "weekly",
  "trendingLanguage": "python",
  "trendingUrl": "https://github.com/trending/python?since=weekly",
  "scrapedAt": "2026-10-24T12:00:00.000Z",
  "snapshotKey": "weekly:python:example-org/example-project",
  "source": "github-trending-html",
  "parserVersion": "2026-07-17"
}
```

| Fields | Meaning |
| --- | --- |
| `rank`, `owner`, `repo`, `fullName`, `repoUrl` | Page rank and repository identity. |
| `repositoryDescription`, `language` | Description and programming language when shown. |
| `stars`, `forks`, `starsGained` | Visible counts. Stars gained covers the selected window. |
| `builtBy` | Contributor usernames, profile links and avatar URLs shown on Trending. |
| `since`, `trendingLanguage`, `trendingUrl` | Requested snapshot scope and source page. |
| `scrapedAt`, `snapshotKey`, `source`, `parserVersion` | Snapshot timestamp, identity and provenance. |
| `readmeUrl`, `readmeText`, `readmeTruncated` | Optional README location, text and truncation flag. |
| `warning` | Optional explanation when README enrichment is unavailable or skipped. |

The run's key-value store contains `RUN_SUMMARY` with saved count, completed/pending languages and warnings. `PENDING_SCOPES` may contain a recovery list after an interruption. Previously saved rows remain available if later work fails. Inspect the summary and platform status before treating the dataset as a complete snapshot.

#### Download your results

Open your run's dataset, choose **Export** and select JSON, CSV or Excel. JSON keeps nested fields together. CSV and Excel are useful when you want to review the records in a spreadsheet.

See [Apify's download and export guide](https://docs.apify.com/storage/dataset#apify-console) for the available formats and field options.

### Pricing

Pay-per-event pricing uses `apify-actor-start` as the start event and an `item` event per repository saved. README enrichment does not create a separate paid result row. A start charge can apply when later extraction fails, and diagnostics are not paid rows.

See the live [Pricing tab](https://apify.com/fetch_cat/github-trending-scraper/pricing) for current rates and Store discounts.

### Tips for best results

- **Start with one language and a small total cap.** Earlier language pages can use the entire cap before later pages are visited.
- **Choose overall or language-specific scope deliberately.** An empty API language list selects overall Trending, while the form prefills languages.
- **Enable README text only for a small sample.** Review text availability, warnings and truncation before analysis.
- **Keep rank with its source page and window.** It is not a combined ranking across languages.
- **Inspect completed and pending scopes before continuing.** Saved progress records do not make every interrupted snapshot complete or guarantee automatic recovery.

### Limits and caveats

GitHub exposes a finite public Trending list rather than every repository matching a topic. Results preserve page order, with page-local ranks and no global sorting or calculated historical star-growth series. There is no AI-project, topic or full repository-search filter, and no private or account-only content is supported.

Languages run in input order under the shared cap. The same repository can occur in several language/window snapshots, so preserve scope with its snapshot key. Counts can be lower than requested, and optional metrics remain null.

README enrichment checks only public README.md files on common main or master branches. Text is capped at 50,000 characters and enrichment at 25 repositories. Missing files or limited remaining time can leave warnings rather than text.

GitHub layout changes, rate limits or access challenges can interrupt collection and are not treated as empty results. When GitHub explicitly reports no trending repositories for a language/time window, the scope completes successfully without dataset rows, with a user-visible warning and an `emptyScopes` reason in `RUN_SUMMARY`. This can also happen for an unknown language slug; check its spelling or try another window. Mixed batches keep repositories from other scopes. Already-saved rows remain available when later work fails.

RUN_SUMMARY records saved counts, completed/pending languages and warnings. PENDING_SCOPES can contain a recovery list after interruption, and resumePendingLanguages replaces the regular language list for that run. Inspect platform status and those records rather than assuming a complete snapshot or unconditional resume. Cross-run history and alerts belong in your own workflow.

### Automation and integrations

#### Save your settings for next time

Once you have an input that works for you, [save it as an Apify task](https://docs.apify.com/actors/running/tasks). This keeps your settings together so you can use them again without filling in the form from scratch.

#### Run on a schedule

Need fresh results regularly? You can [schedule the Actor or a saved task](https://docs.apify.com/actors/running/schedules) to run at a time that suits you.

Each scheduled run collects the data again. If you want to compare results or highlight changes, add that step in your own workflow.

#### Send results to your other tools

Use **n8n, Make or Zapier** to connect this scraper to the rest of your workflow. For example, you could pass its results to an AI assistant or add records to a spreadsheet. Follow the [Apify integration guides](https://docs.apify.com/integrations) for your chosen tool.

For a custom connection, an [Apify webhook](https://docs.apify.com/integrations/webhooks) can notify your app when a run finishes or fails. Your app can then fetch the results or handle the failure.

### API usage

Want to collect this data from your own app or automation? The examples below send input to the scraper and show how to collect its results.

The Node.js and Python examples wait for the run to finish before reading its results. The cURL example starts the run and returns its details. Wait for that run to finish, then use its `defaultDatasetId` to fetch the results.

For setup instructions, see Apify's [JavaScript client guide](https://docs.apify.com/api/client/js), [Python client guide](https://docs.apify.com/api/client/python) and [Actor runs API reference](https://docs.apify.com/api/v2/acts-runs-post).

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/fetch_cat~github-trending-scraper/runs' \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  --data @- <<'JSON'
{
  "languages": [
    "python"
  ],
  "since": "weekly",
  "maxItems": 10,
  "includeReadme": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
JSON
```

#### Node.js

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/github-trending-scraper').call({
  "languages": [
    "python"
  ],
  "since": "weekly",
  "maxItems": 10,
  "includeReadme": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('fetch_cat/github-trending-scraper').call(run_input={'languages': ['python'], 'since': 'weekly', 'maxItems': 10, 'includeReadme': False, 'proxyConfiguration': {'useApifyProxy': False}})
print(client.dataset(run['defaultDatasetId']).list_items().items)
```

### MCP and AI agents

You can ask your AI assistant to collect data with **GitHub Trending Scraper** and help you work with the results. The scraper returns the data, and your assistant can then summarize it, compare records or prepare notes.

Connect your assistant through the [Apify MCP server](https://mcp.apify.com/). MCP gives your assistant a way to find this scraper, run it and read the results. Follow the [official setup and sign-in guide](https://docs.apify.com/mcp) for your app.

#### Easier setup with an Apify plugin

If you use a supported coding assistant, the [official Apify plugin](https://docs.apify.com/agents/plugins) can set up the connection for you. It connects your assistant to Apify and includes instructions for common tasks. Follow the guide for your particular app.

#### Use Apify AI in Console

Prefer to keep everything in Apify? Open [Apify AI in Console](https://docs.apify.com/account/apify-ai) and ask it to find Fetch Cat's **GitHub Trending Scraper**. You can describe the data you want and ask questions about the results.

Apify AI is currently in beta. It asks for confirmation before starting an Actor, and normal run charges apply.

#### Choose your assistant

- **Claude and Claude Code (Anthropic):** [Apify setup guide](https://docs.apify.com/integrations/claude).
- **ChatGPT and Codex (OpenAI):** [Apify setup guides](https://docs.apify.com/integrations/openai).
- **Grok Bot (xAI):** [Apify plugin guide](https://docs.apify.com/integrations/grok-bot).
- **Gemini CLI (Google):** [MCP server setup guide](https://geminicli.com/docs/tools/mcp-server/). Use the server URL below with the HTTP configuration supported by Gemini CLI.

#### Connect just this scraper

To keep your setup focused on this scraper, add this server configuration to a compatible MCP client:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/github-trending-scraper"
    }
  }
}
```

Sign in to Apify when your client asks. If your client uses a Bearer token instead, follow its setup guide and keep the token in its secure configuration. Configuration formats vary by app, so use the linked guide if your client needs a different format.

#### Use Apify's general server

Already connected to the general Apify MCP server at `https://mcp.apify.com`? You can use it to find this scraper without adding another server. Ask your assistant to use **GitHub Trending Scraper** by Fetch Cat, or give it the identifier `fetch_cat/github-trending-scraper`.

Your assistant can check the available settings and retrieve the results from the returned run. If the run is still working, it should follow that run rather than start it again. Both connection options use Apify's hosted service.

#### Example requests

- “Use Fetch Cat’s GitHub Trending Scraper to collect up to 5 weekly Python repositories with README enrichment off. Show source links, descriptions and available stars gained for a newsletter shortlist, keeping page ranks in context.”
- “Collect up to 5 overall GitHub Trending repositories for the daily window with the language list empty. Keep source-page links and collection times without claiming every GitHub project is represented.”
- “Retrieve up to 3 weekly Python Trending repositories with public README text enabled. Show README URLs, available text and truncation warnings for my own reading, without inventing missing files or calculating historical growth.”

Normal Apify charges apply. Check the [live Pricing tab](https://apify.com/fetch_cat/github-trending-scraper/pricing) before asking your assistant to run a larger batch.

### Pay with x402

If your AI agent has a funded wallet, it can pay for Apify usage through [x402](https://docs.apify.com/integrations/x402). This experimental option lets an agent use Apify without a conventional account.

[Apify AGI](https://agi.apify.com/) provides a prepaid API token with a spending cap after payment. Your agent can use that token to run this scraper through the Apify API or an authenticated MCP connection.

Some MCP setups also support paying for each request directly. That is a different payment option, so check the official guide for its availability.

Follow the official guide for wallet setup, supported payment options and current terms. Apify handles the payments. Keep wallet keys and payment tokens in your agent's secure configuration.

#### Other ways for agents to pay

Apify also supports **MPP** for prepaid access through AGI and **Skyfire** for eligible Actors. If your agent already uses one of these, see the [agentic payment guide](https://docs.apify.com/agents/payments) to choose the right setup.

### FAQ

#### Is this a GitHub Trending API alternative?

It provides structured snapshots of the public Trending page through Apify's API. It is not an official GitHub API and does not offer arbitrary repository search or authenticated GitHub data.

#### Can I export GitHub Trending as CSV or JSON?

Yes. Download the saved Apify dataset as CSV, JSON or Excel, or retrieve it through the Dataset API. Nested contributor arrays are most convenient in JSON.

#### Why did I get fewer repositories than `maxItems`?

The requested GitHub pages contain a finite list. The limit is shared across languages. Interruption can also leave a partial dataset. Check `RUN_SUMMARY` and the run status.

#### Why is README text missing?

A repository may use a different branch or filename, have no README, exceed the per-run enrichment cap, or be skipped to preserve time for saving results. Check the row's `warning` when present.

### Related Actors

- [GitHub Repositories Search Scraper](https://apify.com/fetch_cat/github-repositories-search-scraper) — Search repositories beyond the Trending list.
- [Hacker News Search Scraper](https://apify.com/fetch_cat/hacker-news-search-scraper) — Research developer discussions.
- [Stack Exchange Questions Scraper](https://apify.com/fetch_cat/stack-exchange-questions-scraper) — Collect technical questions.
- [Product Hunt Scraper](https://apify.com/fetch_cat/product-hunt-scraper) — Explore product launches.
- [DEV.to Articles Scraper](https://apify.com/fetch_cat/devto-articles-scraper) — Research articles from developer communities.

### Support and feedback

For custom additions or integrations, email <hello@fetchcat.dev>.

Found an error or have a feature request? [Open an issue](https://apify.com/fetch_cat/github-trending-scraper/issues) with the run URL, a non-sensitive input example and what you expected.

Need help sharing it? See [Apify’s guide to sharing a run when reporting an issue](https://docs.apify.com/account/collaboration/general-resource-access#automatically-sharing-runs-via-actor-issues). Sharing a run can give the developer access to its input, logs and results, so use a run that contains no sensitive data. Please leave out API tokens, passwords, cookies, private documents and personal data. Use a public sample URL or a redacted example instead.

Tried this scraper? We'd love to hear how it worked for you. [Leave a review](https://apify.com/fetch_cat/github-trending-scraper/reviews) to help others choose the right tool and help us improve it. Your feedback means a lot to us.

Made with care for curious people, AI agents and the possibilities in data. ♥

# Changelog

This Actor's version history is a separate document: https://apify.com/fetch_cat/github-trending-scraper/changelog.md

# Actor input Schema

## `languages` (type: `array`):

Up to 20 GitHub language slugs or names, such as `javascript`, `python`, or `TypeScript`. Empty selects overall Trending. The form starts with JavaScript and Python; API inputs without a language list select overall Trending. Pages are processed in list order until Maximum repositories is reached, not globally sorted by stars.

## `resumePendingLanguages` (type: `array`):

Optional language list copied from the previous run's PENDING_SCOPES record. When supplied, it replaces Languages for this run so a cutoff can be resumed safely.

## `since` (type: `string`):

GitHub Trending time window to scrape.

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

Save 1–500 repositories total across all requested pages, in page order. This is a cap, not a guarantee: GitHub exposes a finite list per language and time window. The same repository can appear in more than one language snapshot.

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

Fetch up to 25 public README files from common main/master paths. This adds extra requests and is best for smaller runs; a missing README remains a row-level warning.

## `proxyConfiguration` (type: `object`):

The form defaults to no proxy (`useApifyProxy: false`). You may explicitly supply Apify Proxy settings or your own `proxyUrls`; existing SDK settings are passed through unchanged. A configured proxy is used from the first request, including README requests; there is no automatic direct-to-proxy fallback. Explicit settings are not overridden by form defaults. `useApifyProxy` must be a boolean, not a string; invalid options are rejected rather than selecting a paid route. For API calls, send an explicit opt-out object to request no proxy instead of relying on an omitted configuration.

## Actor input object example

```json
{
  "languages": [
    "javascript",
    "python"
  ],
  "since": "daily",
  "maxItems": 20,
  "includeReadme": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "languages": [
        "javascript",
        "python"
    ],
    "since": "daily",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/github-trending-scraper").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 = {
    "languages": [
        "javascript",
        "python",
    ],
    "since": "daily",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/github-trending-scraper").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 '{
  "languages": [
    "javascript",
    "python"
  ],
  "since": "daily",
  "maxItems": 20
}' |
apify call fetch_cat/github-trending-scraper --silent --output-dataset

```

## MCP server setup

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

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/8bGq5K6a619Zk6u3b/builds/9Wywwx45dGphexwl4/openapi.json
