Parsing

Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes into LLM-usable Markdown.

post/parse

Request

  • Base URL
    https://api.context.dev/v1
  • URL
    https://api.context.dev/v1/parse
  • Auth
    HTTP bearer

Query parameters

extension'txt' | 'text' | 'md' | 'markdown' | 'html' | 'htm' | 'xhtml' | 'xml' | 'rss' | 'atom' | 'csv' | 'tsv' | 'yaml' | 'yml' | 'py' | 'java' | 'js' | 'jsx' | 'mjs' | 'cjs' | 'json' | 'jsonl' | 'ndjson' | 'php' | 'sh' | 'bash' | 'zsh' | 'fish' | 'rb' | 'ts' | 'tsx' | 'rtf' | 'srt' | 'css' | 'scss' | 'less' | 'styl' | 'sass' | 'svg' | 'pdf' | 'docx' | 'doc' | 'xlsx' | 'xlsm' | 'xlsb' | 'xltx' | 'xltm' | 'xls' | 'pptx' | 'pptm' | 'ppsx' | 'ppsm' | 'potx' | 'potm' | 'ppt' | 'pps' | 'pot' | 'jpg' | 'jpeg' | 'jpe' | 'png' | 'gif' | 'bmp' | 'tiff' | 'tif' | 'webp' | 'ppm' | 'pbm' | 'pgm' | 'pnm'

Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.

includeLinksboolean

Preserve hyperlinks in Markdown output

includeImagesboolean

Include image references in Markdown output

shortenBase64Imagesboolean

Shorten base64-encoded image data in the Markdown output

useMainContentOnlyboolean

Extract only the main content from HTML-like inputs

ocrboolean

When true for PDF inputs, OCR the selected pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. pdf.start/pdf.end limit the inclusive page range. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.

startinteger

First 1-based PDF page to parse. When omitted, parsing starts at the first page.

endinteger

Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.

clientstring

Optional client identifier used for usage attribution.

zdr'enabled' | 'disabled'

Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

tagsstring[]

Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.

[
  "production",
  "team-alpha"
]

Request body application/octet-stream

string binary required

Response

Successful response

successtrue required

Indicates success

markdownstring required

Input bytes converted to GitHub Flavored Markdown

type'html' | 'xml' | 'json' | 'jsonl' | 'text' | 'csv' | 'tsv' | 'markdown' | 'yaml' | 'python' | 'java' | 'javascript' | 'php' | 'shell' | 'ruby' | 'typescript' | 'rtf' | 'srt' | 'css' | 'scss' | 'less' | 'stylus' | 'sass' | 'svg' | 'pdf' | 'docx' | 'doc' | 'xlsx' | 'xls' | 'pptx' | 'ppt' | 'jpg' | 'png' | 'gif' | 'bmp' | 'tiff' | 'webp' | 'ppm' | 'pbm' | 'pgm' | 'pnm' required

Detected content type used for parsing

Changes

    • breaking

      query request parameter includeImages list-of-types was narrowed by removing types string

    • breaking

      query request parameter includeLinks list-of-types was narrowed by removing types string

    • breaking

      query request parameter ocr list-of-types was narrowed by removing types string

    • breaking

      query request parameter shortenBase64Images list-of-types was narrowed by removing types string

    • breaking

      query request parameter useMainContentOnly list-of-types was narrowed by removing types string

    • breaking

      for the query request parameter includeImages, the type changed from no type to boolean

    • breaking

      for the query request parameter includeLinks, the type changed from no type to boolean

    • breaking

      for the query request parameter ocr, the type changed from no type to boolean

    • breaking

      for the query request parameter shortenBase64Images, the type changed from no type to boolean

    • breaking

      for the query request parameter useMainContentOnly, the type changed from no type to boolean

    • info

      endpoint added