# GitHub Trending Scraper — Repos & Developers (`junipr/github-trending-scraper`) Actor

Scrape GitHub Trending repositories and developers by language and time range with stars, forks, descriptions, owners, and ranking data.

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

## Pricing

from $1.95 / 1,000 repo scrapeds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## GitHub Trending Scraper — Repos & Developers

Scrape trending repositories and developers from [GitHub Trending](https://github.com/trending). Get full metadata including star counts, forks, contributors, programming language, and stars gained during the trending period — all as clean, structured JSON ready for pipelines, dashboards, or LLM workflows.

***

### What This Actor Does

GitHub Trending is one of the most reliable signals for discovering new open-source projects, tracking developer activity, and spotting which technologies are gaining momentum. This actor automates full extraction of the trending page — both repositories and developers — with support for language filtering, date range selection, and spoken language filters.

- **Trending Repositories** — extract rank, full name, owner, description, language, total stars, total forks, stars gained in the period, and top contributors
- **Trending Developers** — extract rank, username, display name, avatar, and their featured popular repository with description
- **Language Filters** — narrow results to any programming language GitHub supports (Python, TypeScript, Rust, Go, etc.)
- **Date Range** — choose daily, weekly, or monthly trending windows
- **Spoken Language** — filter repos by their README/documentation language (English, Chinese, Japanese, etc.)
- **Zero-Config Defaults** — runs out of the box with no configuration required; defaults to daily trending repositories across all languages

***

### Input Configuration

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `type` | string | `"repositories"` | What to scrape: `"repositories"` or `"developers"` |
| `language` | string | `""` | Programming language filter (e.g., `"python"`, `"rust"`). Empty = all languages |
| `dateRange` | string | `"daily"` | Trending window: `"daily"`, `"weekly"`, or `"monthly"` |
| `spokenLanguage` | string | `""` | ISO 639-1 spoken language code (e.g., `"en"`, `"zh"`). Only applies to repositories. Empty = all |
| `maxResults` | integer | `1` | Maximum repositories or developers to deliver (1-25) |

**Example Input — Trending Python repos this week:**

```json
{
  "type": "repositories",
  "language": "python",
  "dateRange": "weekly",
  "spokenLanguage": "",
  "maxResults": 10
}
```

**Example Input — Trending developers in Rust:**

```json
{
  "type": "developers",
  "language": "rust",
  "dateRange": "daily",
  "spokenLanguage": "",
  "maxResults": 10
}
```

***

### Output Schema

#### Repository Output Example

```json
{
  "rank": 1,
  "name": "openai/whisper",
  "owner": "openai",
  "repoName": "whisper",
  "url": "https://github.com/openai/whisper",
  "description": "Robust Speech Recognition via Large-Scale Weak Supervision",
  "language": "Python",
  "stars": 73500,
  "forks": 8900,
  "starsToday": 412,
  "builtBy": [
    {
      "username": "rbreaves",
      "avatarUrl": "https://avatars.githubusercontent.com/u/1234567",
      "profileUrl": "https://github.com/rbreaves"
    }
  ],
  "extractedAt": "2026-03-11T12:00:00.000Z"
}
```

#### Developer Output Example

```json
{
  "rank": 1,
  "username": "torvalds",
  "displayName": "Linus Torvalds",
  "url": "https://github.com/torvalds",
  "avatarUrl": "https://avatars.githubusercontent.com/u/1024025",
  "popularRepo": "linux",
  "popularRepoDescription": "Linux kernel source tree",
  "popularRepoUrl": "https://github.com/torvalds/linux",
  "extractedAt": "2026-03-11T12:00:00.000Z"
}
```

***

### Use Cases

- **Tech Trend Monitoring** — track which languages and frameworks are gaining momentum over time by running the actor daily and storing results
- **Developer Outreach** — identify trending project maintainers for partnership, sponsorship, or hiring outreach
- **Content Creation** — automatically populate "trending repos this week" newsletters or blog posts
- **Market Research** — understand which open-source ecosystems are growing, useful for product planning or investment research
- **Portfolio Discovery** — surface new libraries or tools worth evaluating before they go mainstream
- **Competitive Intelligence** — watch when competitors or competing technologies appear on trending lists
- **LLM Context Enrichment** — feed trending repo data into AI workflows to answer questions about what's popular on GitHub right now

***

### How It Works

The actor uses a lightweight CheerioCrawler (no browser, no Playwright) because GitHub's trending page is server-rendered HTML — no JavaScript execution is needed. This makes runs fast and cost-effective.

1. Constructs the appropriate GitHub Trending URL based on your inputs
2. Fetches the page through Apify's proxy infrastructure (bypasses rate limits, ensures reliability)
3. Parses `article.Box-row` elements for repositories, or `article` elements for developers using Cheerio
4. Extracts all fields including the star counts, forks, language badges, and contributor avatars
5. Charges one `repo-scraped` event per delivered result, up to `maxResults`
6. Pushes all results to the Apify dataset as clean, flat JSON records

***

### Pricing

This actor uses Pay-Per-Event billing: **$1.95 per 1,000 repositories or developers scraped** ($0.00195 per `repo-scraped` event). The bounded default delivers one item. Apify platform usage follows the live Store pricing entry.

***

### Related Actors

- **[Hacker News Scraper](https://apify.com/junipr/hacker-news-scraper)** — scrape stories, comments, and user profiles from Hacker News with full thread support
- **[Reddit Scraper](https://apify.com/junipr/reddit-scraper)** — extract posts, comments, and subreddit data from Reddit

***

### Frequently Asked Questions

#### How many results does each run return?

GitHub Trending displays up to 25 repositories or developers per page. Set `maxResults` from 1 to 25; the bounded default is 1.

#### Why did I get 0 results?

This can happen if you use a very specific language + spoken language combination that has no trending results today. Try removing filters (set `language` and `spokenLanguage` to empty strings) to verify the actor is working, then narrow down your filters.

#### Does this work with all programming languages?

Yes — any language slug that GitHub Trending supports works. Use the exact slug from the GitHub Trending URL. For example, `https://github.com/trending/typescript` uses the slug `typescript`. If an invalid language is provided, GitHub redirects to the all-languages page.

#### Can I schedule this to run automatically?

Yes. Use Apify Schedules to run the actor daily, weekly, or on any cron schedule. Combine with Apify Webhooks or the API to pipe results into your own database or notification system.

#### What does `starsToday` mean for weekly/monthly runs?

The `starsToday` field reflects stars gained during the selected `dateRange` period — not necessarily just today. For weekly runs it's stars this week, for monthly runs it's stars this month. The field name reflects its origin in GitHub's UI text.

#### Is GitHub Trending scraping allowed?

Review GitHub's current terms and applicable rules for your use case. Configure modest limits and use the extracted public data responsibly.

#### Can I get more than 25 results?

No. GitHub only shows 25 items per trending page, and `maxResults` is capped at 25. For broader coverage, use separate runs with different language or date-range filters.

# Actor input Schema

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

Whether to scrape trending repositories or trending developers. 'repositories' returns repo data with stars, forks, and contributors. 'developers' returns developer profiles with their popular repository.

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

Filter trending results by programming language. Use the GitHub language slug (e.g., 'javascript', 'python', 'typescript', 'rust', 'go'). Leave empty to get all languages.

## `dateRange` (type: `string`):

Time range for trending calculation. 'daily' shows what's trending today, 'weekly' shows trending this week, 'monthly' shows trending this month.

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

Filter repositories by the spoken language of their README/description. Use ISO 639-1 codes (e.g., 'en' for English, 'zh' for Chinese, 'ja' for Japanese). Leave empty to include all spoken languages. Only applies when type is 'repositories'.

## `maxResults` (type: `integer`):

Maximum number of trending repositories or developers to deliver.

## Actor input object example

```json
{
  "type": "repositories",
  "language": "",
  "dateRange": "daily",
  "spokenLanguage": "",
  "maxResults": 1
}
```

# Actor output Schema

## `results` (type: `string`):

Trending repositories or developers from GitHub with full metadata including stars, forks, contributors, and programming language.

# 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 = {
    "type": "repositories",
    "language": "",
    "dateRange": "daily",
    "spokenLanguage": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("junipr/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 = {
    "type": "repositories",
    "language": "",
    "dateRange": "daily",
    "spokenLanguage": "",
}

# Run the Actor and wait for it to finish
run = client.actor("junipr/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 '{
  "type": "repositories",
  "language": "",
  "dateRange": "daily",
  "spokenLanguage": ""
}' |
apify call junipr/github-trending-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,junipr/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/gOR2mWnKiMOR2qHpD/builds/fQ5XE56JvdnNlU5Wn/openapi.json
