repositories

Get raw file content

Returns raw file content from a Git repository at a given blob reference (commit SHA, tag, or branch). Use mode=raster&page=N to get a rasterized JPEG of a document page. Use mode=text&page=N to get extracted text from a document page. Use mode=text without page to get the page count.

get/repositories/{id}/blob/{blob_name}/{path}

Path parameters

idinteger required

Repository ID

blob_namestring required

Commit SHA, tag name, or branch name

pathstring required

File path within the repository

Query parameters

linesstring

Line ranges to extract (e.g. L17-L26,L45,L55-L90)

line_numbersboolean

Prefix each line with its 1-based line number

modestring

Output mode: 'raster' returns a JPEG image of the page, 'text' returns extracted text

pageinteger

1-based page number (required when mode=raster, optional for mode=text)

Response

OK

Changes

Changed in 5 of the 14 revisions of this API.412

    • added the media type application/json for the response with the status 400

      response-media-type-added

    • added the media type application/json for the response with the status 404

      response-media-type-added

    • added the media type application/json for the response with the status 500

      response-media-type-added

    • removed the media type image/png for the response with the status 400

      response-media-type-removed

    • removed the media type image/png for the response with the status 404

      response-media-type-removed

    • removed the media type image/png for the response with the status 500

      response-media-type-removed

    • added the media type image/jpeg for the response with the status 400

      response-media-type-added

    • added the media type image/jpeg for the response with the status 404

      response-media-type-added

    • added the media type image/jpeg for the response with the status 500

      response-media-type-added

    • added the new optional query request parameter mode

      new-optional-request-parameter

    • added the new optional query request parameter page

      new-optional-request-parameter

    • added the media type image/png for the response with the status 400

      response-media-type-added

    • added the media type image/png for the response with the status 404

      response-media-type-added

    • added the media type image/png for the response with the status 500

      response-media-type-added

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 39 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog