# Github Repositry Scraper (`crawlforge/github-repositry-scraper`) Actor

Scrape GitHub repos by URL, search, or trending. Extract stars, forks, topics, languages, contributors & more. No login needed.

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

## Pricing

from $0.01 / 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?

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

Extract comprehensive data from GitHub repositories — by direct URL, keyword search, or trending. No login, no API keys required.

Perfect for **competitive analysis**, **lead generation**, **market research**, **AI training data**, and **developer tooling pipelines**.

***

### 🚀 3 Modes — Pick One

> ⚠️ **Each mode uses different input fields. Only fill in fields for the mode you choose.**

| Mode | When to use it |
|------|---------------|
| `repos` | You already have specific GitHub URLs you want to scrape |
| `search` | You want to discover repos by keyword or language |
| `trending` | You want GitHub's trending repos right now |

***

### ⚙️ Input by Mode

#### Mode: `repos` — Scrape specific repositories

```json
{
  "mode": "repos",
  "repoUrls": [
    "https://github.com/facebook/react",
    "https://github.com/vercel/next.js"
  ],
  "maxResults": 10,
  "includeReadme": false
}
```

| Field | Required | Description |
|---|---|---|
| `mode` | ✅ | Set to `"repos"` |
| `repoUrls` | ✅ | List of GitHub repo URLs to scrape |
| `maxResults` | optional | Max repos to scrape (default: 10) |
| `includeReadme` | optional | Also fetch README content (default: false) |

***

#### Mode: `search` — Find repos by keyword

```json
{
  "mode": "search",
  "searchQuery": "machine learning",
  "searchLanguage": "Python",
  "searchSort": "stars",
  "maxResults": 50,
  "includeReadme": false
}
```

| Field | Required | Description |
|---|---|---|
| `mode` | ✅ | Set to `"search"` |
| `searchQuery` | ✅ | Keywords to search (e.g. `"web scraper"`) |
| `searchLanguage` | optional | Filter by language e.g. `"Python"`, `"JavaScript"` |
| `searchSort` | optional | Sort by `"stars"`, `"forks"`, or `"updated"` (default: `"stars"`) |
| `maxResults` | optional | Max repos to return, up to 300 (default: 10) |
| `includeReadme` | optional | Also fetch README content (default: false) |

***

#### Mode: `trending` — Get GitHub's trending repos

```json
{
  "mode": "trending",
  "trendingLanguage": "python",
  "trendingPeriod": "weekly",
  "maxResults": 25,
  "includeReadme": false
}
```

| Field | Required | Description |
|---|---|---|
| `mode` | ✅ | Set to `"trending"` |
| `trendingLanguage` | optional | Filter by language e.g. `"python"`, `"rust"` — leave empty for all |
| `trendingPeriod` | optional | `"daily"`, `"weekly"`, or `"monthly"` (default: `"daily"`) |
| `maxResults` | optional | Max repos to return (default: 10) |
| `includeReadme` | optional | Also fetch README content (default: false) |

***

### 📦 Output Fields

Each scraped repository returns:

```json
{
  "url": "https://github.com/facebook/react",
  "fullName": "facebook/react",
  "owner": "facebook",
  "name": "react",
  "repoId": "10270250",
  "description": "The library for web and native user interfaces.",
  "website": "https://react.dev/",
  "topics": ["react", "javascript", "library", "ui", "frontend"],
  "primaryLanguage": "JavaScript",
  "languages": { "JavaScript": "68.1%", "TypeScript": "29.0%" },
  "license": "MIT",
  "stars": 243937,
  "starsDisplay": "244k",
  "forks": 50761,
  "watchers": 6700,
  "openIssues": 809,
  "openPullRequests": 355,
  "commits": 21425,
  "contributors": 1734,
  "totalReleases": 118,
  "latestRelease": "19.2.4",
  "defaultBranch": "main",
  "lastCommitAt": "2026-01-26T18:29:43Z",
  "scrapedAt": "2026-03-13T10:00:00.000Z"
}
```

Enable `includeReadme: true` to also get `readmeText` and `readmeHtml` fields — useful for AI/LLM pipelines.

***

### 🎯 Use Cases

- **Market research** — Track star growth and activity across competing repos
- **Lead generation** — Find active contributors in a technology stack
- **AI training data** — Bulk-collect repo descriptions, READMEs, and topics
- **Investment research** — Monitor open-source adoption signals
- **Competitive intelligence** — Benchmark your repo vs competitors

***

### 💰 Pricing

Pay Per Result — you only pay for repos successfully scraped.

| Volume | Cost |
|--------|------|
| 10 repos | ~$0.02 |
| 100 repos | ~$0.20 |
| 1,000 repos | ~$2.00 |

***

### ⚡ Performance

- Uses **Cheerio** — no heavy browser, very low compute cost
- Up to 3 concurrent requests
- \~50–100 repos/minute
- No proxies needed for normal volumes

***

### ❓ FAQ

**Can I use all input fields at once?**
No. Each mode uses its own fields. Set `mode` first, then only fill in fields for that mode — other fields are ignored.

**Does this require a GitHub account or API key?**
No. Scrapes only public GitHub data, no login needed.

**Can I scrape private repos?**
No — public repos only.

**Can I schedule this to run daily?**
Yes. Use Apify's built-in scheduler with a cron expression.

**Will I get blocked?**
Unlikely for normal volumes. The Actor uses proper headers and rate limiting. For 1000+ repos, enable Apify proxy.

***

Built with [Apify SDK](https://docs.apify.com/sdk/js/) + [Crawlee](https://crawlee.dev/).
Issues or feature requests? Leave a comment on the Actor page.

# Actor input Schema

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

Choose how to find repositories: by direct URL, keyword search, or trending.

## `repoUrls` (type: `array`):

List of GitHub repository URLs to scrape. Used when mode is 'repos'.
Example: https://github.com/facebook/react

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

Keyword(s) to search for repositories. Used when mode is 'search'.
Example: 'machine learning' or 'web scraping python'

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

Optional: Filter search results by programming language.
Examples: Python, JavaScript, TypeScript, Go, Rust

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

How to sort search results.

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

Optional: Filter trending by programming language. Leave empty for all languages.
Examples: javascript, python, rust, go

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

Time period for trending repositories.

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

Maximum number of repositories to scrape. Max 300.

## `includeReadme` (type: `boolean`):

If enabled, also scrapes the README text and HTML from each repository page. Useful for AI/NLP pipelines.

## Actor input object example

```json
{
  "mode": "repos",
  "repoUrls": [
    "https://github.com/facebook/react",
    "https://github.com/vercel/next.js"
  ],
  "searchQuery": "machine learning",
  "searchLanguage": "Python",
  "searchSort": "stars",
  "trendingLanguage": "python",
  "trendingPeriod": "daily",
  "maxResults": 10,
  "includeReadme": false
}
```

# 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("crawlforge/github-repositry-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 = {}

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

```

## MCP server setup

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