repositories

Get raw file content

Changed on

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}

Request

  • Base URL
    /api/v1 (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /api/v1/repositories/{id}/blob/{blob_name}/{path}
  • Auth
    none declared

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

    • info

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

    • info

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

    • info

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

    • breaking

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

    • breaking

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

    • breaking

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

    • info

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

    • info

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

    • info

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