# GitHub Trending - Repos, Devs & Topics (`jarvis-duo-studio/github-trending`) Actor

Scrape GitHub Trending repos, devs, and topics by language and period. Get repo name, stars, description, language, and URL in clean JSON. Perfect for tracking tech trends. Pay-per-event pricing ensures you only pay for data you use.

- **URL**: https://apify.com/jarvis-duo-studio/github-trending.md
- **Developed by:** [Jarvis Studio](https://apify.com/jarvis-duo-studio) (community)
- **Categories:** AI, Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 88.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 results

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 Trending Scraper

Capture real-time developer sentiment by extracting trending repositories, developers, and topics directly from GitHub’s official trending page.

### What it does

- **Scrapes GitHub Trending:** Fetches the current list of trending repositories, developers, and topics.
- **Filterable Scope:** Supports filtering by programming language and time period (daily, weekly, or monthly).
- **Structured Data Output:** Returns clean, normalized JSON data including repository metadata, star counts, and descriptions.
- **Rate-Limit Resilient:** Handles GitHub’s anti-scraping measures with robust retry logic and user-agent rotation.
- **Lightweight & Fast:** Optimized for low-latency execution, ideal for CI/CD pipelines or real-time dashboards.

### Input

| Parameter | Type | Description |
| :--- | :--- | :--- |
| `language` | `string` | (Optional) Filter by programming language (e.g., `python`, `typescript`). Defaults to all languages. |
| `since` | `string` | (Optional) Time period for trending calculation. Options: `daily`, `weekly`, `monthly`. Defaults to `daily`. |
| `maxItems` | `integer` | (Optional) Maximum number of items to return. Defaults to `25` (the full page size). |

### Output example

```json
[
  {
    "name": "vercel/next.js",
    "stars": 125400,
    "starsToday": 120,
    "description": "The React Framework for the Web",
    "language": "TypeScript",
    "url": "https://github.com/vercel/next.js"
  },
  {
    "name": "microsoft/vscode",
    "stars": 162300,
    "starsToday": 85,
    "description": "Visual Studio Code",
    "language": "TypeScript",
    "url": "https://github.com/microsoft/vscode"
  }
]
```

### Use cases

- **Tech Radar Automation:** Automatically update internal tech stack reports with emerging tools and libraries.
- **Competitor Monitoring:** Track which open-source projects competitors are adopting or building upon.
- **Content Generation:** Feed data into blog posts or newsletters about "Top 10 New Open Source Projects This Week."
- **Investment Research:** Identify high-growth open-source projects as early indicators of market trends.
- **Hiring Signals:** Monitor trending developer profiles to identify active contributors in specific niches.

### Pricing note

This actor uses **pay-per-event** pricing. You are charged only for the number of successful scraping events (i.e., each unique combination of `language` and `since` parameters processed). There are no hidden costs for failed requests or retries. For high-volume usage, consider batching requests or using the `maxItems` parameter to limit data retrieval per run.

### FAQ

**Q: Does this actor use the GitHub API?**
A: No. GitHub does not provide an official API endpoint for "trending" repositories. This actor scrapes the public HTML page at `github.com/trending`, which is more reliable for this specific use case than attempting to infer trends from API data.

**Q: How often should I run this actor?**
A: For `daily` trends, running once per day is sufficient. For `weekly` or `monthly` trends, run it once per week or month respectively. Running more frequently will not yield new data and will incur unnecessary costs.

**Q: What happens if GitHub changes their HTML structure?**
A: The actor includes automatic retry logic and error handling. If the structure changes significantly, the actor will fail gracefully with a clear error message. We monitor GitHub’s frontend and update the scraper within 24-48 hours of any breaking changes.

# Actor input Schema

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

Trending repos or trending developers

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

Filter by language, e.g. python, rust, typescript (empty = all)

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

Trending window

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

Maximum number of dataset items to produce

## Actor input object example

```json
{
  "what": "repositories",
  "language": "",
  "since": "daily",
  "maxItems": 25
}
```

# Actor output Schema

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

Dataset items collected by this run.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jarvis-duo-studio/github-trending").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("jarvis-duo-studio/github-trending").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 '{}' |
apify call jarvis-duo-studio/github-trending --silent --output-dataset

```

## MCP server setup

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

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/NJ2xfRZwBDcb7B6aD/builds/7pVqCqstp1GUH8buT/openapi.json
