Sample - GitHub REST API
GET/repos/{owner}/{repo}/readme

Get a repository README

Gets the preferred README for a repository.

This endpoint supports the following custom media types. For more information, see "Media types."

  • application/vnd.github.raw+json: Returns the raw file contents. This is the default if you do not specify a media type.
  • application/vnd.github.html+json: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source Markup library.
  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
refstringoptional
The name of the commit/branch/tag. Default: the repository’s default branch.

4 status codes
200Response
typestringrequired
Allowed:file
encodingstringrequired
sizeintegerrequired
namestringrequired
pathstringrequired
contentstringrequired
shastringrequired
urlstringrequired
git_urlstringrequired
html_urlstringrequired
download_urlstringrequired
_linksobjectrequired
targetstringoptional
submodule_git_urlstringoptional
304Not modified
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 404 is returned: Resource not found. A 422 is returned: Validation failed, or the endpoint has been spammed.