# GitHub Scraper (`alleserojje/github-scraper`) Actor

Search GitHub repositories and pull structured repo, user and org data via the official GitHub API. Trending, star counts, languages, topics. Pay per record.

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

## Pricing

from $1.00 / 1,000 github scrapers

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/platform/actors/running/actors-in-store#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 Scraper

**GitHub Scraper** pulls structured data from GitHub using the **official GitHub REST API** — search repositories, look up repos and users/orgs, and list a user's entire repository set. Star counts, forks, languages, topics, license, activity dates, follower counts and more. Pay only per record.

### What this GitHub scraper does

- **Search repositories** with GitHub's full qualifier syntax (`language:rust stars:>5000`, `topic:llm`, `created:>2026-01-01`, …).
- **Look up** specific repos (`owner/name`) or **users/orgs** for full profile data.
- **List every repository** owned by a user or organization.
- Sort by **stars, forks or recent activity** — perfect for trending, star-velocity and maintainer research.

### API token (recommended)

GitHub allows 60 requests/hour unauthenticated. Add a **GitHub personal access token** in the `githubToken` input to lift that to **5,000 requests/hour** for larger runs. The token is stored as a secret.

### Input

| Field | Description |
|---|---|
| `repoQueries` | GitHub search queries (qualifier syntax). |
| `repos` | Specific repos to look up (`owner/name`). |
| `users` | Usernames/orgs to fetch profiles for. |
| `userRepos` | Users/orgs whose full repo list to return. |
| `sort` / `order` | Sort repositories by stars/forks/updated. |
| `githubToken` | Optional token for higher rate limits. |

### Output

Repo records: `fullName`, `owner`, `description`, `language`, `topics`, `stars`, `forks`, `watchers`, `openIssues`, `license`, `createdAt`, `updatedAt`, `pushedAt`, `url`. User records: `login`, `name`, `company`, `location`, `bio`, `followers`, `following`, `publicRepos`, `url`.

### Pricing

**Pay per event:** billed once per record returned. No monthly rental.

# Actor input Schema

## `repoQueries` (type: `array`):

GitHub search qualifiers, e.g. 'language:rust stars:>5000' or 'topic:llm'.

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

Specific repos to look up, e.g. facebook/react.

## `users` (type: `array`):

Usernames or orgs to look up (profile data).

## `userRepos` (type: `array`):

Return every repository owned by these users/orgs.

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

How to sort repository search results.

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

Sort order for repository search results.

## `perQuery` (type: `integer`):

Maximum repositories returned per search query (1-1000).

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

Stop after this many records across all inputs. 0 = no limit.

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

A GitHub personal access token lifts rate limits from 60/hr to 5,000/hr. Recommended for larger runs.

## `proxy` (type: `object`):

Not required. Datacenter proxy available if you want it.

## Actor input object example

```json
{
  "repoQueries": [
    "language:python stars:>20000"
  ],
  "sort": "stars",
  "order": "desc",
  "perQuery": 50,
  "maxItems": 0,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (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 = {
    "repoQueries": [
        "language:python stars:>20000"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("alleserojje/github-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 = { "repoQueries": ["language:python stars:>20000"] }

# Run the Actor and wait for it to finish
run = client.actor("alleserojje/github-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 '{
  "repoQueries": [
    "language:python stars:>20000"
  ]
}' |
apify call alleserojje/github-scraper --silent --output-dataset

```

## MCP server setup

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