GET
/repos/{owner}/{repo}/git/blobs/{file_sha}Get a Git blob
Retrieves a Git blob from a specified repository by its file SHA. The default JSON representation contains Base64-encoded content, while the raw media type returns the blob data directly; blobs can be up to 100 megabytes.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
file_shastringrequired
The SHA identifier of the blob to retrieve.
200Returns the blob object with its Base64-encoded `content`, encoding, URL, SHA, size, node ID, and optional highlighted content. The raw media type returns the blob data instead.
contentstringrequired
encodingstringrequired
urlstringrequired
shastringrequired
sizeintegerrequired
node_idstringrequired
highlighted_contentstringoptional
403Returned when the authenticated user is not permitted to access the blob.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the specified repository or blob cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
409Returned when retrieving the blob conflicts with the repository state.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when `file_sha` fails validation or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
Error handling
A 403 indicates that the request is not permitted, a 404 indicates that the repository or blob cannot be found, and a 409 indicates a conflict. A 422 is returned when file_sha fails validation or the endpoint has been spammed. Request the raw media type when you need unencoded blob data; otherwise, content is Base64 encoded.