# GitHub Trending Repos Scraper (`w3crawler/github-trending-repos-scraper`) Actor

Scrape current public GitHub Trending repositories with bounded browser/HTTP extraction and optional public REST enrichment. Produces normalized repository identity, trending metrics, ownership, licensing, and provenance.

- **URL**: https://apify.com/w3crawler/github-trending-repos-scraper.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 trending repositories

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

### What does GitHub Trending Repos Scraper do?

This Actor collects public repositories shown on [GitHub Trending](https://github.com/trending). Each dataset row contains the visible Trending rank, repository identity, description, language, stars, forks, period-star gain, contributor signals, and public repository links. Optional enrichment reads public repository metadata from GitHub's documented REST API.

The Actor uses public GitHub pages and public repository metadata only. It does not access private repositories, private profiles, authenticated-only content, or protected endpoints. If GitHub presents a CAPTCHA, access denial, rate-limit page, or device verification boundary, the Actor emits a small diagnostic record and records the run state in OUTPUT\_SUMMARY.

### Why use this Actor?

- Filter by programming language, spoken language, and daily, weekly, or monthly period.
- Collect up to 100 public Trending rows with stable field names and normalized numbers, URLs, and timestamps.
- Optionally enrich rows with public topics, default branch, license, owner, repository health flags, and timestamps.
- Disable repository enrichment for a fast Trending-page snapshot.
- Disable media fields when avatar URLs are not needed.
- Bound public request concurrency, pacing, retries, and timeouts.
- Use optional Apify proxy configuration for the public browser, fallback, and REST requests.

GitHub's public Trending page currently exposes a bounded list without a visible pagination control. The Actor does not invent page URLs, ratings, review counts, or product prices.

### What data can this Actor extract?

| Field | Type | Description |
|---|---|---|
| trendingRank | integer | One-based position on the observed Trending page. |
| fullName | string | Repository owner and name. |
| repositoryUrl | string | Public GitHub repository URL. |
| repositorySummary | string | Public repository description. |
| primaryLanguage | string | Primary language shown by GitHub. |
| starsCount, forksCount | integer | Current public repository metrics when available. |
| trendingStarsGained | integer | Stars shown as gained in the selected period. |
| contributors | array | Public contributor logins and optional public avatar URLs. |
| topics, licenseName, licenseSpdxId | array/string | Public REST enrichment when requested and available. |
| createdAt, updatedAt, pushedAt | string | Public repository timestamps when available. |
| apiMetadataAvailable | boolean | Whether public REST enrichment returned metadata. |
| sourceUrl, scrapedAt | string | Public source page and collection timestamp. |

When public REST enrichment is unavailable, the Actor keeps the truthful Trending-page fields and omits unavailable optional fields. It does not fabricate placeholders.

### Input

The main inputs are:

- trendingUrl, or the separate language, since, and spokenLanguage filters.
- maxItems from 1 to 100.
- includeRepositoryDetails and includeMedia.
- apiConcurrency from 1 to 5 and apiRequestDelayMs from 0 to 2,000.
- Bounded retry, request-timeout, and navigation-timeout settings.
- Optional proxyConfiguration.
- Optional githubToken, accepted only as a secret to increase public REST rate limits. It is never written to dataset rows or logs.

Example:

```
{
  "trendingUrl": "https://github.com/trending/python?since=weekly&spoken_language_code=en",
  "maxItems": 10,
  "includeRepositoryDetails": true,
  "includeMedia": false
}
```

### Output

A normal record is shaped like this:

```
{
  "sourceUrl": "https://github.com/trending?since=daily",
  "trendingRank": 1,
  "fullName": "example-owner/example-repository",
  "repositoryUrl": "https://github.com/example-owner/example-repository",
  "repositorySummary": "Example tools for building reliable data workflows.",
  "primaryLanguage": "Python",
  "starsCount": 15000,
  "forksCount": 1200,
  "trendingStarsGained": 1234,
  "trendingPeriod": "daily",
  "apiMetadataAvailable": false,
  "scrapedAt": "2026-01-15T12:00:00.000Z"
}
```

OUTPUT\_SUMMARY contains operational counts and whether a public-source boundary was detected. Diagnostic dataset rows contain only url, error, errorCode, and scrapedAt.

### How to run

1. Review the input tab.
2. Set the Trending filters and maxItems.
3. Choose whether to request public REST details and avatar media URLs.
4. Run the Actor and inspect the dataset and OUTPUT\_SUMMARY.

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Cost and rate limits

The Actor uses Apify compute units according to browser and request duration. Public REST enrichment makes up to one request per unique Trending repository, so disabling includeRepositoryDetails can reduce request volume and runtime. Keep concurrency modest and use request pacing to reduce rate-limit pressure.

### Ethical use

This Actor collects public GitHub content only. Results may still contain personal data that a user chose to publish, so use the data lawfully and with a legitimate purpose. Do not use the Actor to bypass authentication, CAPTCHAs, access controls, or other protected boundaries.

# Changelog

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

# Actor input Schema

## `trendingUrl` (type: `string`):

Optional HTTPS GitHub Trending URL, such as https://github.com/trending/python?since=weekly\&spoken\_language\_code=en. When provided, its path and filters take precedence over the separate filter fields.

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

Filter by programming language (for example, javascript, python, or typescript). Leave empty for all languages when trendingUrl is not set.

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

Trending time range: daily, weekly, or monthly.

## `spokenLanguage` (type: `string`):

Filter by spoken language code, such as en, zh, or es. Leave empty for any when trendingUrl is not set.

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

Maximum number of valid trending repositories to push, from 1 to 100.

## `includeRepositoryDetails` (type: `boolean`):

Fetch public GitHub REST repository metadata for each result. Disable to avoid enrichment requests while retaining the stable dataset contract.

## `includeMedia` (type: `boolean`):

Keep public owner and trending-contributor avatar URLs. Disable to replace those media fields with not\_available markers.

## `apiConcurrency` (type: `integer`):

Maximum number of public GitHub REST enrichment requests in flight at once.

## `apiRequestDelayMs` (type: `integer`):

Delay before each public REST request in each worker, from 0 to 2,000 milliseconds.

## `maxRequestRetries` (type: `integer`):

Retries for browser, HTTP fallback, and public REST requests after the initial attempt.

## `requestTimeoutSecs` (type: `integer`):

Bounded handler and public REST request timeout in seconds.

## `navigationTimeoutSecs` (type: `integer`):

Bounded browser navigation and Trending row readiness timeout in seconds.

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

Optional Apify proxy settings honored by the browser crawler, HTTP fallback, and public GitHub REST enrichment.

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

Optional fine-grained token for higher GitHub REST API rate limits. It is never written to the dataset or logs.

## `fingerprintProfile` (type: `string`):

User-agent profile used for the Trending page, HTTP fallback, and public REST requests.

## Actor input object example

```json
{
  "trendingUrl": "",
  "language": "",
  "since": "daily",
  "spokenLanguage": "",
  "maxItems": 25,
  "includeRepositoryDetails": true,
  "includeMedia": true,
  "apiConcurrency": 2,
  "apiRequestDelayMs": 250,
  "maxRequestRetries": 2,
  "requestTimeoutSecs": 90,
  "navigationTimeoutSecs": 60,
  "fingerprintProfile": "chromium"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped GitHub Trending repository records.

## `outputSummary` (type: `string`):

No description

## `sourceMetadata` (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 = {
    "trendingUrl": "",
    "language": "",
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/github-trending-repos-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 = {
    "trendingUrl": "",
    "language": "",
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/github-trending-repos-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 '{
  "trendingUrl": "",
  "language": "",
  "maxItems": 25
}' |
apify call w3crawler/github-trending-repos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/github-trending-repos-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/wvFOkUif2TBcB9Vdd/builds/tRcsZDgfEdLvUtDyI/openapi.json
