๐Ÿ“‚

GitHub File Read API

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.

API Docs $0.001 / request

About this tool

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.

Quick Start

curl -X POST https://api.iteratools.com/github/file/read \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "owner": "vercel", "repo": "next.js", "path": "README.md", "ref": "canary" }'

Body Parameters

FieldTypeRequiredDescription
ownerstringYesRepository owner
repostringYesRepository name
pathstringYesFile path within the repository (e.g. src/index.js)
refstringNoBranch, tag, or commit SHA (default: default branch)
tokenstringNoGitHub PAT (for private repos or higher rate limits)

Response

{"path":"README.md","sha":"a1b2c3d4e5f67890...","size":4821,"content":"# Next.js\n\nThe React Framework for the Web...","encoding":"utf-8","url":"https://github.com/vercel/next.js/blob/canary/README.md"}

Pricing

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

Full Documentation Browse All Tools