GitHub README API
The README of a repository, decoded to text.
GET /v1/github/repos/{owner}/{repo}/readme1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/github/repos/facebook/react/readme",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "readme": { "name": "README.md", "path": "README.md", "sha": "6dd74794143a0ebfb6c6f094d3f2632d87ad628a", "size": 5296, "html_url": "https://github.com/react/react/blob/main/README.md", "download_url": "https://raw.githubusercontent.com/react/react/main/README.md", "encoding": "base64", "content": "IyBbUmVhY3RdKGh0dHBzOi8vcmVhY3QuZGV2LykgJm1pZGRvdDsgWyFbR2l0\nSHViIGxpY2Vuc2VdKGh0dHBzOi8vaW1nLnNoaWVsZHMuaW8vYmFkZ2UvbGl…", "url": "https://api.github.com/repos/react/react/contents/README.md?ref=main", "git_url": "https://api.github.com/repos/react/react/git/blobs/6dd74794143a0ebfb6c6f094d3f2632d87ad628a", "type": "file", "_links": { "self": "https://api.github.com/repos/react/react/contents/README.md?ref=main", "git": "https://api.github.com/repos/react/react/git/blobs/6dd74794143a0ebfb6c6f094d3f2632d87ad628a", "html": "https://github.com/react/react/blob/main/README.md" } }, "text": "# [React](https://react.dev/) · [](https://gi…"}Parameters
| Name | Type | Description |
|---|---|---|
ownerpath · required | string | Repository owner (user or organisation). Example: vercel. |
repopath · required | string | Repository name. Example: next.js. |
Response fields
200 with a GitHubReadmeResponse, in GitHub’s own REST v3 objects.
| Field | Type | Description |
|---|---|---|
readme | object | |
text | string | The README decoded to UTF-8 text. |
Status codes
| Status | Meaning |
|---|---|
200 | The README. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No public GitHub user, repository or issue by that name. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | GitHub is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
GitHub is a trademark of GitHub, Inc. We are not affiliated with or endorsed by GitHub.