Skip to main content

Get a repository README

Gets the preferred README for a repository. READMEs support [custom media types](https://docs.github.com/[email protected]/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML.

GET/repos/{owner}/{repo}/readme
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
owner string
required
repo string
required
Query Parameters
ref string
optional

The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`)

Responses

application/json Content File object

Response

_links object
required
git string<uri>
requirednullable
html string<uri>
requirednullable
self string<uri>
required
content string
required
download_url string<uri>
requirednullable
encoding string
required
git_url string<uri>
requirednullable
html_url string<uri>
requirednullable
name string
required
path string
required
sha string
required
size integer
required
submodule_git_url string
optional

Example: "git://example.com/defunkt/dotjs.git"

target string
optional

Example: "actual/actual.md"

type string
required
url string<uri>
required
application/json Basic Error object

Resource not found

documentation_url string
optional
message string
optional
status string
optional
url string
optional
application/json Validation Error object

Validation failed

documentation_url string
required
errors array[object]
optional
items object
code string
required
field string
optional
index integer
optional
message string
optional
resource string
optional
value
optional
message string
required