GET
/repos/{owner}/{repo}/readme/{dir}Get a repository README for a directory
Gets the README from a repository directory.
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.
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.
dirstringrequired
The alternate path to look for a README file
refstringoptional
The name of the commit/branch/tag. Default: the repository’s default branch.
200Response
typestringrequired
encodingstringrequired
sizeintegerrequired
namestringrequired
pathstringrequired
contentstringrequired
shastringrequired
urlstringrequired
git_urlstringrequired
html_urlstringrequired
download_urlstringrequired
_linksobjectrequired
targetstringoptional
submodule_git_urlstringoptional
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.