# GitHub Context Extractor (LLM-Ready Markdown) (`w3crawler/github-context-extractor`) Actor

Extract public repository metadata, full bounded README Markdown, contributors, and releases for LLM and RAG pipelines.

- **URL**: https://apify.com/w3crawler/github-context-extractor.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 repository contexts

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## GitHub Context Extractor

Build bounded, LLM-ready context records from public GitHub repositories. For each requested `owner/repository`, the Actor reads public repository metadata, the README as Markdown, contributors, and recent releases. It uses documented public GitHub REST endpoints, keeps source URLs in the row, and writes run-level request and failure counts to `OUTPUT_SUMMARY`.

### Public data and limits

Only public repository responses are requested. An optional caller-supplied GitHub token may be used to raise the public API rate limit, but the Actor does not request private scopes, access private repositories, perform writes, log the token, bypass CAPTCHA, or use undocumented endpoints. Repository, README, contributors, and releases are all bounded by input limits. README Markdown is capped at 500,000 characters; contributor and release arrays are independently bounded. Request delay, timeout, and response-size controls prevent an accidental unbounded run.

The public GitHub repository page also exposes the same kind of business information used here: public visibility, repository description, folders and files, README, stars, watchers, forks, topics, and links to issues, releases, and contributors. The Actor's API response is normalized into stable fields rather than copying internal UI markup.

### Input

```json
{
  "repositories": ["apify/apify-js", "https://github.com/octocat/Hello-World"],
  "maxRepositories": 2,
  "includeReadme": true,
  "includeContributors": true,
  "maxContributors": 5,
  "includeReleases": true,
  "maxReleases": 5,
  "requestDelayMs": 250
}
```

`repositories` accepts public GitHub URLs or `owner/repository` values. Invalid entries are ignored during normalization and a run with no usable repositories emits a minimal diagnostic. `maxRepositories` is 1–20. Set any `include...` flag to `false` when only repository metadata is needed. `maxContributors` and `maxReleases` are each 1–20. `requestDelayMs` is 0–5000 ms, `timeoutMs` is 5–120 seconds, and `maxResponseBytes` is 100,000–50,000,000. Unknown input keys are rejected.

### Dataset output

Successful rows contain a `repository` object with public identity, description, links, default branch, language, topics, license, counts, archive/fork flags, and timestamps. `readmeMarkdown` contains bounded Markdown and `readme` contains filename, path, public HTML/download links, size, character and word counts, and truncation state. `contributors` contains public login/profile/avatar links and contribution counts. `releases` contains public tag/name, notes, prerelease/draft status, timestamps, and release links. `sourceUrls` records the public endpoint URLs used and `retrievedAt` records collection time.

Operational fields such as retry/request counters, rate-limit evidence, warnings, and internal record labels are deliberately kept out of normal rows. They are summarized in `OUTPUT_SUMMARY` together with requested/succeeded repository counts, successful/failed requests, status, and completion time. If a repository cannot be read, an optional diagnostic row contains only `url`, `error`, `errorCode`, and `scrapedAt`.

#### Dataset example

```json
{
  "repository": {
    "fullName": "octocat/Hello-World",
    "htmlUrl": "https://github.com/octocat/Hello-World",
    "defaultBranch": "master",
    "stars": 2100,
    "topics": ["example"]
  },
  "readmeMarkdown": "# Hello World\n",
  "contributors": [{ "login": "octocat", "profileUrl": "https://github.com/octocat" }],
  "releases": [],
  "sourceUrls": { "repository": "https://api.github.com/repos/octocat/Hello-World" },
  "retrievedAt": "2026-08-24T00:00:00.000Z"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Local run

```bash
npm ci
npm run check
npm test
apify validate-schema
apify run --purge --input-file input.json
npm run validate
```

The Actor reports GitHub rate limits and unavailable optional enrichments in the run summary. It does not fabricate missing README, contributor, or release data.

# Actor input Schema

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

One or more public GitHub repository URLs or owner/repository values.

## `maxRepositories` (type: `integer`):

Hard cap on repositories processed in one run.

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

Fetch and emit the public README as bounded Markdown when available.

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

Fetch a bounded list of public contributor login names and contribution counts.

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

Maximum public contributors attached to each repository.

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

Fetch a bounded list of public releases.

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

Maximum public releases attached to each repository.

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

Optional caller-supplied token for public GitHub API requests. No private scopes are required or requested.

## `requestDelayMs` (type: `integer`):

Minimum delay between public GitHub API requests.

## `timeoutMs` (type: `integer`):

Timeout for each GitHub API request.

## `maxResponseBytes` (type: `integer`):

Safety cap for one public GitHub API response.

## Actor input object example

```json
{
  "repositories": [],
  "maxRepositories": 5,
  "includeReadme": true,
  "includeContributors": true,
  "maxContributors": 5,
  "includeReleases": true,
  "maxReleases": 5,
  "requestDelayMs": 250,
  "timeoutMs": 30000,
  "maxResponseBytes": 5000000
}
```

# Actor output Schema

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

No description

## `runSummary` (type: `string`):

No description

## `sourceMetadata` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/github-context-extractor").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("w3crawler/github-context-extractor").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 w3crawler/github-context-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/github-context-extractor"
        }
    }
}
```

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/cEAcrDZrJXZ6kpNst/builds/F304s6OyRPYffs7V4/openapi.json
