Fetch and decode the text content of any file in a GitHub repository. Supports any branch, tag, or commit SHA. Works on public repos without a token.
Read any text file from a GitHub repository. The API automatically decodes the base64 content returned by the GitHub Contents API and returns it as plain UTF-8 text. Specify an optional ref (branch name, tag, or commit SHA) to read from a specific point in history. Maximum file size: 1MB.
| Field | Type | Required | Description |
|---|---|---|---|
owner | string | Yes | Repository owner |
repo | string | Yes | Repository name |
path | string | Yes | File path within the repository (e.g. src/index.js) |
ref | string | No | Branch, tag, or commit SHA (default: default branch) |
token | string | No | GitHub PAT (for private repos or higher rate limits) |
$0.001 per request via x402 micropayment on Base (USDC). System token used automatically for public repos โ no token required from users for read-only access.