GET/repos/{owner}/{repo}/git/blobs/{file_sha}

Get a Git blob

Retrieves a Git blob from a repository using its file SHA. The JSON response encodes content as Base64; request application/vnd.github.raw+json for raw blob data instead. Blobs can be up to 100 megabytes.

3 parameters
ownerstringrequired
The account owner of the repository.
repostringrequired
The repository name without the `.git` extension.
file_shastringrequired
The SHA identifying the blob to retrieve.

5 status codes
200Returns the blob object, including its Base64-encoded content, encoding, URL, SHA, size, and node ID. Request `application/vnd.github.raw+json` to receive raw blob data.
contentstringrequired
encodingstringrequired
urlstringrequired
shastringrequired
sizeintegerrequired
node_idstringrequired
highlighted_contentstringoptional
403Returned when you do not have permission to access the repository.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the repository or blob cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
409Returned when the request conflicts with the repository's current state.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 403 is returned when you do not have permission to access the repository. A 404 is returned when the repository or blob identified by the owner path parameter, repo path parameter, and file_sha path parameter cannot be found. A 409 indicates a conflict, and a 422 is returned when validation fails or the endpoint has been spammed.