# GitHub Repo Stats & Enrichment (`agentictools/github-repo-stats`) Actor

Enrich GitHub repos or a search query with stars, forks, activity, license, languages, and top contributors.

- **URL**: https://apify.com/agentictools/github-repo-stats.md
- **Developed by:** [Ken Agland](https://apify.com/agentictools) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Repo Stats & Enrichment

Enrich GitHub repos or a search query with stars, forks, activity, license, languages, and top contributors.

Give the Actor a list of repositories or a search query. It returns one clean, structured record per GitHub repository so you can compare projects, track activity, or feed live stats into your own tools.

### What it does

- Search GitHub repositories by query, ranked by stars, or pass an explicit list of `owner/repo` names.
- Per repo: stars, forks, watchers, open issues, primary language, license, topics, and archived status.
- Repo age in days, creation date, and last push date.
- Optional language byte breakdown for each repository.
- Optional top contributors (login and contribution count) for each repository.
- Aggregate summary (repos returned, total stars, most-starred repo) in the run's OUTPUT.

### Example input

Search for the top LLM agent frameworks:

```json
{
  "query": "llm agent framework",
  "limit": 5,
  "includeContributors": true,
  "includeLanguages": true
}
````

Enrich a specific list of repositories:

```json
{
  "repos": [
    "apify/crawlee",
    "langchain-ai/langchain"
  ]
}
```

### Input

| Field | Type | Description |
|---|---|---|
| `query` | string | GitHub search query. Used when no `repos` list is given. |
| `repos` | array | Explicit list of `owner/repo` strings. If set, `query` is ignored. |
| `limit` | integer | How many repositories to return in search mode (default 10, max 100). |
| `includeContributors` | boolean | Fetch top contributors per repo (default true). |
| `includeLanguages` | boolean | Fetch the language byte breakdown per repo (default true). |

### Output

Each dataset item is one repository:

```json
{
  "fullName": "langchain-ai/langchain",
  "description": "Build context-aware reasoning applications",
  "url": "https://github.com/langchain-ai/langchain",
  "stars": 92000,
  "forks": 15000,
  "watchers": 620,
  "openIssues": 280,
  "primaryLanguage": "Python",
  "languages": {
    "Python": 12345678,
    "MDX": 234567
  },
  "license": "MIT",
  "topics": [
    "llm",
    "agents",
    "python"
  ],
  "createdAt": "2022-10-17T02:58:36Z",
  "pushedAt": "2026-07-03T18:22:10Z",
  "ageDays": 991,
  "isArchived": false,
  "topContributors": [
    {
      "login": "hwchase17",
      "contributions": 1200
    }
  ]
}
```

#### Run summary (OUTPUT)

The run's default key-value store record `OUTPUT` holds an aggregate for the whole result set:

```json
{
  "mode": "search",
  "query": "llm agent framework",
  "reposReturned": 5,
  "totalStars": 210000,
  "mostStarredRepo": {
    "fullName": "langchain-ai/langchain",
    "stars": 92000,
    "url": "https://github.com/langchain-ai/langchain"
  },
  "generatedFrom": "https://api.github.com"
}
```

### How it works

The Actor calls the public GitHub REST API. In search mode it queries `search/repositories` sorted by stars. In repos mode it fetches `repos/{owner}/{repo}` for each entry. For each repository it optionally adds the language breakdown and top contributors, then pushes a clean record to the dataset and writes the aggregate to OUTPUT.

It runs unauthenticated by default, which GitHub rate limits to about 60 core requests per hour and 10 search requests per minute. Set a `GITHUB_TOKEN` environment variable to raise those limits. Rate-limit responses are handled gracefully with backoff and retries.

# Actor input Schema

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

GitHub repository search query (e.g. "llm agent framework"). Used when no explicit repos are given. Leave empty if you set the repos list.

## `repos` (type: `array`):

Explicit list of repositories as "owner/repo" strings (e.g. "apify/crawlee"). If set, the search query is ignored.

## `limit` (type: `integer`):

How many repositories to return in search-query mode. Ignored when an explicit repos list is provided.

## `includeContributors` (type: `boolean`):

Fetch the top contributors for each repository (one extra API call per repo).

## `includeLanguages` (type: `boolean`):

Fetch the language byte breakdown for each repository (one extra API call per repo).

## Actor input object example

```json
{
  "query": "web scraping python",
  "repos": [
    "apify/crawlee",
    "langchain-ai/langchain"
  ],
  "limit": 10,
  "includeContributors": true,
  "includeLanguages": true
}
```

# 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 = {
    "query": "llm agent framework"
};

// Run the Actor and wait for it to finish
const run = await client.actor("agentictools/github-repo-stats").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 = { "query": "llm agent framework" }

# Run the Actor and wait for it to finish
run = client.actor("agentictools/github-repo-stats").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "llm agent framework"
}' |
apify call agentictools/github-repo-stats --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=agentictools/github-repo-stats",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "GitHub Repo Stats & Enrichment",
        "description": "Enrich GitHub repos or a search query with stars, forks, activity, license, languages, and top contributors.",
        "version": "0.1",
        "x-build-id": "kwvINju9r4nnUnTJG"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/agentictools~github-repo-stats/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-agentictools-github-repo-stats",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/agentictools~github-repo-stats/runs": {
            "post": {
                "operationId": "runs-sync-agentictools-github-repo-stats",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/agentictools~github-repo-stats/run-sync": {
            "post": {
                "operationId": "run-sync-agentictools-github-repo-stats",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "GitHub repository search query (e.g. \"llm agent framework\"). Used when no explicit repos are given. Leave empty if you set the repos list."
                    },
                    "repos": {
                        "title": "Repositories",
                        "type": "array",
                        "description": "Explicit list of repositories as \"owner/repo\" strings (e.g. \"apify/crawlee\"). If set, the search query is ignored.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "limit": {
                        "title": "Number of repositories",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "How many repositories to return in search-query mode. Ignored when an explicit repos list is provided.",
                        "default": 10
                    },
                    "includeContributors": {
                        "title": "Include top contributors",
                        "type": "boolean",
                        "description": "Fetch the top contributors for each repository (one extra API call per repo).",
                        "default": true
                    },
                    "includeLanguages": {
                        "title": "Include languages",
                        "type": "boolean",
                        "description": "Fetch the language byte breakdown for each repository (one extra API call per repo).",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
