# GitHub Repo Scraper (`artificially/github-repo-scraper`) Actor

Scrape GitHub repository stats, README, languages, contributors, and releases.

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

## Pricing

from $1.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?

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

Scrape detailed information from any public GitHub repository including stats, README content, languages, contributors, and releases.

### Features

- **Repository Stats**: Stars, forks, watchers, open issues, size
- **Repository Info**: Description, license, topics, creation/update dates
- **README Content**: Full README text (optional)
- **Language Breakdown**: Bytes of code per language (optional)
- **Contributors**: List of top contributors with commit counts (optional)
- **Releases**: Recent releases with download links (optional)

### Use Cases

- Track popularity metrics across multiple repositories
- Monitor competitor open-source projects
- Build datasets for research on GitHub trends
- Aggregate documentation from multiple repos
- Track release schedules and changelogs

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `repositories` | array | Yes | - | List of repositories (e.g., `["facebook/react", "https://github.com/vercel/next.js"]`) |
| `includeReadme` | boolean | No | `true` | Include full README content |
| `includeLanguages` | boolean | No | `true` | Include language breakdown |
| `includeContributors` | boolean | No | `false` | Include contributor list |
| `maxContributors` | number | No | `10` | Maximum contributors to fetch |
| `includeReleases` | boolean | No | `false` | Include release history |
| `maxReleases` | number | No | `5` | Maximum releases to fetch |

#### Example Input

```json
{
    "repositories": [
        "facebook/react",
        "vercel/next.js",
        "https://github.com/microsoft/vscode"
    ],
    "includeReadme": true,
    "includeLanguages": true,
    "includeContributors": true,
    "maxContributors": 5
}
```

### Output

Each repository produces a result with:

```json
{
    "repoId": 10270250,
    "name": "react",
    "fullName": "facebook/react",
    "owner": "facebook",
    "ownerType": "Organization",
    "description": "The library for web and native user interfaces.",
    "url": "https://github.com/facebook/react",
    "homepage": "https://react.dev/",
    "stars": 220000,
    "watchers": 220000,
    "forks": 45000,
    "openIssues": 1500,
    "language": "JavaScript",
    "topics": ["declarative", "frontend", "javascript", "library", "react", "ui"],
    "license": "MIT",
    "isPrivate": false,
    "isFork": false,
    "isArchived": false,
    "defaultBranch": "main",
    "createdAt": "2013-05-24T16:15:54Z",
    "updatedAt": "2024-01-15T10:30:00Z",
    "size": 350000,
    "languages": {
        "JavaScript": 5000000,
        "TypeScript": 2000000,
        "HTML": 50000
    },
    "readme": "# React\n\nReact is a JavaScript library...",
    "contributors": [
        {
            "username": "gaearon",
            "contributions": 2500,
            "profileUrl": "https://github.com/gaearon"
        }
    ],
    "scrapedAt": "2024-01-15T12:00:00Z"
}
```

### Cost

This actor uses **pay-per-result** pricing:

| Cost Type | Amount |
|-----------|--------|
| Start fee | $0.05 per run |
| Per repository | $0.001 |

**No API key required** - Uses GitHub's public API (unauthenticated).

#### Example Cost Calculation

- 100 repos: $0.05 + (100 x $0.001) = $0.15
- 1,000 repos: $0.05 + (1000 x $0.001) = $1.05

#### Rate Limits

GitHub's unauthenticated API allows 60 requests per hour. For high-volume scraping:

- Use Apify proxy to distribute requests
- Add delays between repositories
- Consider using a GitHub personal access token

### Tips

1. **Repository formats accepted**:
   - `owner/repo` (e.g., `facebook/react`)
   - Full URL (e.g., `https://github.com/facebook/react`)
   - URL with `.git` suffix is handled automatically

2. **Minimize API calls**: Disable `includeReadme`, `includeLanguages`, `includeContributors`, and `includeReleases` if you don't need that data.

3. **Large repos**: For repositories with many contributors/releases, limit the count to avoid rate limits.

### Support

- **Built by**: [Artificially](https://apify.com/artificially)
- **Issues**: Report bugs or request features via Apify Console

# Actor input Schema

## `repositories` (type: `array`):

List of repositories (e.g., 'facebook/react', 'https://github.com/vercel/next.js')

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

Fetch and include README content

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

Fetch language breakdown with percentages

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

Fetch top contributors with commit counts

## `maxContributors` (type: `integer`):

Maximum contributors to fetch per repo

## `includeReleases` (type: `boolean`):

Fetch recent releases with download counts

## `maxReleases` (type: `integer`):

Maximum releases to fetch per repo

## `includeCommitActivity` (type: `boolean`):

Fetch yearly commit statistics, trends, and activity frequency

## `includeIssueStats` (type: `boolean`):

Fetch issue stats: open/closed ratio, response time, labels, good first issues

## `includePullRequests` (type: `boolean`):

Fetch recent PRs with merge rate and timing stats

## `maxPullRequests` (type: `integer`):

Maximum pull requests to fetch

## `includeDependencies` (type: `boolean`):

Parse package.json, requirements.txt, Cargo.toml, or go.mod for dependencies

## `includeCommunityProfile` (type: `boolean`):

Fetch GitHub community health score (README, contributing guide, code of conduct, etc.)

## `proxyConfiguration` (type: `object`):

Proxy settings for scraping

## Actor input object example

```json
{
  "repositories": [
    "facebook/react"
  ],
  "includeReadme": true,
  "includeLanguages": true,
  "includeContributors": false,
  "maxContributors": 10,
  "includeReleases": false,
  "maxReleases": 5,
  "includeCommitActivity": true,
  "includeIssueStats": true,
  "includePullRequests": false,
  "maxPullRequests": 10,
  "includeDependencies": false,
  "includeCommunityProfile": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `repoId` (type: `string`):

GitHub repository ID

## `name` (type: `string`):

Repository name

## `fullName` (type: `string`):

Full repository name (owner/repo)

## `owner` (type: `string`):

Repository owner username

## `description` (type: `string`):

Repository description

## `url` (type: `string`):

URL to repository on GitHub

## `stars` (type: `string`):

Number of GitHub stars

## `forks` (type: `string`):

Number of forks

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

Primary programming language

## `license` (type: `string`):

License SPDX identifier

## `createdAt` (type: `string`):

ISO 8601 creation date

## `updatedAt` (type: `string`):

ISO 8601 last update date

## `scrapedAt` (type: `string`):

ISO 8601 timestamp when scraped

# 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 = {
    "repositories": [
        "facebook/react"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("artificially/github-repo-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 = {
    "repositories": ["facebook/react"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("artificially/github-repo-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 '{
  "repositories": [
    "facebook/react"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call artificially/github-repo-scraper --silent --output-dataset

```

## MCP server setup

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