# GitHub Scraper — Repos, Issues, PRs & Code (`khadinakbar/github-deep-scraper`) Actor

Scrape GitHub deeply — repos, issues, PRs, code search, contributors, releases, READMEs, commits, users, trending. 11 modes in one actor for AI coding agents (Claude Code, Cursor, Copilot). Optional PAT for 5K req/hr. MCP-ready, flat JSON output.

- **URL**: https://apify.com/khadinakbar/github-deep-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Developer tools, MCP servers, Automation
- **Stats:** 30 total users, 14 monthly users, 98.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event + usage

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Deep Scraper — Repos, Issues, PRs, Code Search, Commits

GitHub Deep Scraper is an Apify Actor for public GitHub data. It accepts one GitHub surface per run, such as a repository, search query, user login, or trending filter, and returns one flat record per result. Each record includes `mode`, `type`, `url`, and `scrapedAt`, plus mode-specific GitHub fields that support repo analysis, issue review, PR inspection, code search, contributor lookup, release tracking, README retrieval, commit history review, user profiling, and trending exploration.

### Best fit and connected workflows

This Actor fits workflows that need one GitHub scraping tool with multiple routes:

- Repository research: use `repo` when a workflow starts from one public repository and needs a full metadata snapshot.
- Issue and PR review: use `issues` or `prs` when a workflow starts from a repo and needs lists, labels, comments, reviews, or review threads.
- Code discovery: use `code-search` when a workflow starts from a text query and needs code matches across GitHub.
- Contributor and release analysis: use `contributors` or `releases` when the workflow needs contributor profiles or release history from a repo.
- Documentation extraction: use `readme` when the workflow needs the repository README as markdown and rendered text.
- Commit inspection: use `commits` when the workflow needs commit history, and optionally file diffs.
- Profile review: use `user` when the workflow starts from a GitHub login and needs the profile plus repositories.
- Trend scanning: use `trending` when the workflow needs trending repositories by language and timeframe.

### Practical scenario

A developer advocate named Mina starts with `apify/actors-mcp-server` and wants to prepare a short update for her team. She runs the Actor in `prs` mode with `state: "closed"` and `includeReviews: true`. The returned dataset record includes the PR `url`, `type: "pr"`, and `scrapedAt`, plus PR-specific fields for review state and review comments. Mina uses the review state and PR URL to pick one merged change for a deeper read, then shares the PR link in her team note.

### Input fields

| Field | Type | Used in | Description |
|---|---|---|---|
| `mode` | string | all modes | Selects one GitHub surface to scrape. One mode per run. |
| `repo` | string | `repo`, `issues`, `prs`, `contributors`, `releases`, `readme`, `commits` | GitHub repository in `owner/name` format, or a full GitHub repo URL. |
| `query` | string | `repo-search`, `code-search` | GitHub search query with qualifiers such as `language:`, `stars:`, `org:`, `path:`, and `extension:`. |
| `user` | string | `user` | GitHub user or organization login. |
| `language` | string | `trending` | Language filter for trending mode. |
| `timeframe` | string | `trending` | Trending window: daily, weekly, or monthly. |
| `state` | string | `issues`, `prs` | Issue or PR state filter: open, closed, or all. |
| `since` | string | `issues`, `prs`, `commits` | ISO 8601 date for returning items updated or created at or after the given point. |
| `maxResults` | integer | all modes | Maximum number of records to return. |
| `includeComments` | boolean | `issues`, `prs` | Includes comments for each issue or PR. |
| `includeReviews` | boolean | `prs` | Includes reviews and review comments for each PR. |
| `includeFiles` | boolean | `commits` | Includes file diffs for each commit. |

#### Focused JSON input example

```json
{
  "mode": "prs",
  "repo": "vercel/next.js",
  "state": "closed",
  "includeReviews": true,
  "since": "2026-01-01",
  "maxResults": 25
}
```

### Output fields

The dataset returns one record per result.

| Field | Type | Description |
|---|---|---|
| `mode` | string | Which scraping mode produced the record. |
| `type` | string | Record type such as `repo`, `issue`, `pr`, `code-match`, `contributor`, `release`, `readme`, `commit`, `user`, or `trending-repo`. |
| `url` | string or null | Canonical GitHub URL for the entity. |
| `scrapedAt` | string | ISO 8601 UTC timestamp for when the record was fetched. |

#### Illustrative JSON record

```json
{
  "mode": "repo",
  "type": "repo",
  "url": "https://github.com/facebook/react",
  "scrapedAt": "2026-05-28T18:14:32Z"
}
```

### How it works

This Actor uses GitHub's public REST API and GraphQL API surfaces for the selected mode, plus the public GitHub trending page for trending mode. The input schema defines 11 modes: `repo`, `repo-search`, `issues`, `prs`, `code-search`, `contributors`, `releases`, `readme`, `commits`, `user`, and `trending`. Repository-based modes normalize `owner/name` input, and full repository URLs are accepted for the `repo` field. The output dataset stays flat so downstream tools and agents can read it easily. The output contract also includes a GitHub rate-limit record in key-value storage, plus summary records for the run outcome.

### Pricing

This Actor uses Apify Pay per event plus standard Apify platform usage. Open the live Pricing tab in Apify Console for the current event definitions and platform usage details before planning larger runs.

Charged events include:

- `apify-actor-start` for the run start
- `result` for simple returned records
- `deep-result` for heavier returned records

For example, a run that returns twenty simple results is billed for one actor start event plus twenty `result` events, alongside Apify platform usage for the run.

### Use with AI agents (MCP)

This Actor is Apify MCP-ready and usable through Apify MCP as `khadinakbar/github-deep-scraper`. It is a tool for retrieving structured GitHub data by mode, so an agent can request exactly the surface it needs and then read the dataset rows returned by the run.

Tool description: fetch public GitHub records for a chosen mode, then read the resulting dataset items and supporting run records such as rate-limit state.

> Fetch the closed pull requests for `vercel/next.js` since the start of the year, include reviews, and return the dataset items with their GitHub URLs and scrape timestamps.

When interpreting results, treat each dataset row as one GitHub entity or search result. The shared fields identify the source mode, record type, canonical URL, and fetch time. For broader runs, use `maxResults` to bound how many rows the agent receives. For heavier modes and options, such as code search, PR reviews, PR comments, and commit file diffs, the `deep-result` event rate applies. The rate-limit record in key-value storage can help agents confirm whether a GitHub token is being applied and how many requests remain.

### Apify API example

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({
  token: process.env.APIFY_TOKEN,
});

const run = await client.actor("khadinakbar/github-deep-scraper").call({
  mode: "repo",
  repo: "facebook/react",
  maxResults: 1,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Best results and outcome guidance

Use `repo` when the workflow starts from one repository and needs a broad snapshot. Use `repo-search` when the workflow starts from a topic, stack, or qualifier query. Use `issues` and `prs` when the workflow needs discussion context, labels, reviews, or thread comments. Use `commits` when the workflow needs change history, and enable file diffs when reasoning about touched files matters. Use `trending` when the workflow needs a current list of popular repositories by language and timeframe. Set `maxResults` to the smallest number that covers the task so the run stays focused.

### Continue the workflow

- Then use [Google Play Store All-in-One Scraper — Apps, Reviews, Charts](https://apify.com/khadinakbar/google-play-all-in-one-scraper) to extend GitHub Deep Scraper — Repos, Issues, PRs, Code Search, Commits with a neighboring software ecosystem research source when the brief calls for Google Play data.
- Then use [App Store Reviews Scraper - iOS & macOS Ratings](https://apify.com/khadinakbar/appstore-reviews-scraper) to extend GitHub Deep Scraper — Repos, Issues, PRs, Code Search, Commits with a neighboring software ecosystem research source when the brief calls for App Store data.

### Design note

I found that the dataset contract is intentionally flat: every record includes `mode`, `type`, `url`, and `scrapedAt`, while the rest of the fields vary by mode.

### FAQ

**Which GitHub surface should I use for a full repository snapshot?**\
Use `repo` for one repository's full metadata.

**Which mode is suited to finding repositories by topic or qualifier?**\
Use `repo-search` and pass a GitHub search query in the `query` field.

**Which mode should I use for issue threads or PR conversations?**\
Use `issues` or `prs`, and turn on `includeComments` when you want thread context.

**How do I inspect code across GitHub?**\
Use `code-search` with a search query. The live contract marks this mode as requiring the `GITHUB_TOKEN` environment variable.

**How do I get a repository README?**\
Use `readme` with the repository name in `owner/name` format.

**How do I get commit history with file diffs?**\
Use `commits` and set `includeFiles: true` when file-level reasoning matters.

**How do I get trending repositories for a language?**\
Use `trending` with `language` and `timeframe`.

### Responsible use

Use this Actor for public GitHub data and keep your usage aligned with GitHub's terms and applicable data-protection rules. Review the live Pricing tab before larger runs, especially when using result-heavy modes or options that add comments, reviews, or file diffs.

# Actor input Schema

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

Which GitHub surface to scrape. One actor, 11 modes. Pick exactly one. 'repo' = full metadata for one repo (50+ fields). 'repo-search' = keyword/qualifier search. 'issues'/'prs' = list issues/PRs for a repo with comments, labels, reviews. 'code-search' = search code across GitHub (REQUIRES GITHUB\_TOKEN env var). 'contributors' = repo contributors with profile data. 'releases' = release history with assets. 'readme' = full README markdown + rendered text. 'commits' = commit history with author, files, stats. 'user' = user/org profile + their repos. 'trending' = trending repos by language and timeframe. NOT for private repos or GitHub Enterprise.

## `repo` (type: `string`):

GitHub repository in 'owner/name' format (e.g., 'facebook/react'). Required for modes: repo, issues, prs, contributors, releases, readme, commits. Accepts full URL too — 'https://github.com/facebook/react' is normalised. NOT used for repo-search, code-search, user, trending modes.

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

Free-text query with GitHub search qualifiers (e.g., 'language:typescript stars:>1000 web framework'). Used by modes: repo-search, code-search. Supports all GitHub search operators (language:, stars:, forks:, user:, org:, path:, extension:, in:). NOT a repository identifier — for that use the 'repo' field.

## `user` (type: `string`):

GitHub user or organization login (e.g., 'torvalds' or 'apify'). Required for mode 'user'. Returns profile, repos, organizations, and (if available) social accounts. NOT a repo path — for that use 'repo' field.

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

Optional language filter for trending mode (e.g., 'python', 'rust', 'typescript'). Lowercase, hyphenated for multi-word. For repo-search use 'language:python' inside the query field instead. Empty = all languages.

## `timeframe` (type: `string`):

Time window for trending mode. 'daily' = today's trending repos, 'weekly' = this week, 'monthly' = this month. GitHub publishes these lists at github.com/trending. Only used by mode 'trending'. Default: daily.

## `state` (type: `string`):

Filter issues or PRs by state. 'open' = only open, 'closed' = only closed, 'all' = both. Only used by modes 'issues' and 'prs'. Default: open. GitHub's UI default is open, so leave as 'open' for most agent use.

## `since` (type: `string`):

Only return items updated/created at or after this ISO 8601 date (e.g., '2026-01-01' or '2026-01-01T00:00:00Z'). Used by modes 'issues', 'prs', 'commits'. Empty = no lower bound.

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

Maximum number of records to return. Each record = one PPE 'result' ($0.005) or 'deep-result' ($0.01) charge. Default 50. Hard cap 1000 to keep one run under $10 for x402 agents. Set lower to control cost; the actor will stop early when it reaches the cap.

## `includeComments` (type: `boolean`):

When true, fetches comments for each issue or PR (extra API call per item). Increases run cost but gives the full conversation thread. Only affects modes 'issues' and 'prs'. Default: false. Set true when an agent needs sentiment, decisions, or context from threads.

## `includeReviews` (type: `boolean`):

When true, fetches reviews and review comments for each PR (extra API call per PR). Returns reviewer login, state (APPROVED/REQUEST\_CHANGES/COMMENTED), submitted\_at, body. Only affects mode 'prs'. Default: false. Set true when an agent needs review-status or reviewer breakdown.

## `includeFiles` (type: `boolean`):

When true, includes the list of files changed per commit with additions/deletions/status. Charged as 'deep-result' ($0.01) instead of 'result'. Only affects mode 'commits'. Default: false. Set true when an agent needs to reason about diffs.

## Actor input object example

```json
{
  "mode": "repo",
  "repo": "facebook/react",
  "query": "language:typescript stars:>5000 mcp",
  "user": "torvalds",
  "language": "typescript",
  "timeframe": "daily",
  "state": "open",
  "since": "2026-01-01",
  "maxResults": 1,
  "includeComments": false,
  "includeReviews": false,
  "includeFiles": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset with one record per result. Shape depends on `mode` field (repo, repo-search, issues, prs, code-search, contributors, releases, readme, commits, user, trending). Soft errors (404/422/451/409) emit a single record with `type: "not-found"` or `type: "search-error"`, a numeric `_status`, and a `_note` describing the cause.

## `rateLimit` (type: `string`):

Latest X-RateLimit headers captured from GitHub. Inspect to debug 403/429 issues or to confirm a GITHUB\_TOKEN is being applied. Schema: { remaining, reset, limit, scrapedAt }.

## `summary` (type: `string`):

No description

## `runSummary` (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 = {
    "mode": "repo",
    "repo": "facebook/react",
    "query": "language:typescript stars:>5000 mcp",
    "maxResults": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/github-deep-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 = {
    "mode": "repo",
    "repo": "facebook/react",
    "query": "language:typescript stars:>5000 mcp",
    "maxResults": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/github-deep-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 '{
  "mode": "repo",
  "repo": "facebook/react",
  "query": "language:typescript stars:>5000 mcp",
  "maxResults": 1
}' |
apify call khadinakbar/github-deep-scraper --silent --output-dataset

```

## MCP server setup

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