# GitHub Trending Matrix — Deduplicated Charts (`protective_flatland/github-trending-matrix`) Actor

Merge language and time-window GitHub Trending charts into unique repositories with all observed ranks and star gains.

- **URL**: https://apify.com/protective_flatland/github-trending-matrix.md
- **Developed by:** [zsdy](https://apify.com/protective_flatland) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.15 / 1,000 unique repositories

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 Matrix

### Try it first

In **Input → JSON**, run this small example, then open **Dataset → Export** for CSV or JSON. Before running, check the Store Pricing tab: the maximum event charge is `maxItems × current per-repository price + any start event`. Current Store pricing is authoritative.

```json
{
  "languages": [
    "python"
  ],
  "periods": [
    "daily",
    "weekly"
  ],
  "maxItems": 3
}
```

Merge up to three language filters and three GitHub Trending time windows into one row per unique repository. Each row retains its rank, star gain and source URL in every requested chart where it appears. Use it to compare daily versus weekly momentum without double-counting repositories in an export.

```json
{"languages":["python","javascript"],"periods":["daily","weekly"],"maxItems":50,"excludeRepositories":[]}
```

`languages`: 1–3 distinct lowercase GitHub Trending language slugs; `all` selects the unfiltered chart and must be used alone. Default `["python"]`. Slugs must match GitHub (for example `c++`); uppercase, unsupported or empty charts fail explicitly. `periods`: 1–3 distinct values from `daily`, `weekly`, `monthly`, default `["daily","weekly"]`. Duplicate filters/windows are rejected. `maxItems`: integer 1–225, default 50, limits unique rows after merging. `excludeRepositories`: at most 1000 case-insensitive `owner/repository` names, default empty. Store previous output names and pass them here for caller-managed incremental exports. This Actor does not persist history.

Each row contains `repository` (owner/name), `url`, nullable `description` and `language`, integer total `stars` and `forks`, `capturedAt` (UTC capture timestamp), and `charts`. Each chart observation has `languageFilter`, `period`, 1-based `rank`, integer `starsGained` for that window, and `sourceUrl`. Total stars/forks and descriptive fields use the first occurrence. Charts are requested in input language order, then period order; output uses first-seen chart rank order, not a combined ranking. A maxItems cut retains all matching chart observations for each returned repository. Gains from overlapping windows must not be summed.

The source is the public GitHub Trending HTML page, not the GitHub search API. Only currently displayed repositories are available; no historical backfill or comprehensive discovery. Source update latency and chart selection are controlled by GitHub. No login, API key, browser or proxy is used. A reachable page is not a guarantee of future availability from Apify datacenter IPs.

All requested charts must fetch and parse before results are saved. Missing cards, unexpected counters, blocked/redirected pages or an upstream failure fail the run rather than returning a partial chart matrix. Network/429/5xx errors have at most one retry, 12-second request timeouts. At most nine distinct charts are fetched sequentially. An entirely excluded set returns an empty dataset successfully. Missing descriptions and languages are valid null values. Input errors fail the run.

Billing: $0.00115 per unique repository saved to the default dataset ($1.15/1000), plus a separate $0.00005 synthetic start event at the fixed 256 MB memory. Chart observations nested in a row have no extra fee. No hidden events; platform usage is not passed to users. The per-row price is the FREE-tier main repository event from one directly comparable Actor (small sample, not a market-wide estimate); live platform pricing is authoritative. User spending limits can truncate the saved rows. The code stops when the SDK reports the charge limit. Build and platform resource costs are separate from an owner test's $0.02 user-charge cap.

# Actor input Schema

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

1–3 lowercase GitHub language slugs, such as python, javascript, c++ or all. A language with no chart fails the run.

## `periods` (type: `array`):

Choose 1–3 distinct windows: daily, weekly or monthly. Other values and duplicates are rejected.

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

Applied after chart merging and exclusions; not a per-chart limit.

## `excludeRepositories` (type: `array`):

Up to 1000 owner/repository names. Case-insensitive exclusion; caller manages history.

## Actor input object example

```json
{
  "languages": [
    "python"
  ],
  "periods": [
    "daily",
    "weekly"
  ],
  "maxItems": 25,
  "excludeRepositories": []
}
```

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("protective_flatland/github-trending-matrix").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("protective_flatland/github-trending-matrix").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 protective_flatland/github-trending-matrix --silent --output-dataset

```

## MCP server setup

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

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/vjr3FaLdeXKukidZI/builds/vBCtg02gmvvUjjc94/openapi.json
