Parse

Parse a document to Markdown

Changed on

Convert a document into readable, structured Markdown content.

Accepts either a file upload (multipart/form-data) or a document URL (JSON body).

Sync mode (default)

Blocks until parsing completes and returns 200 with the full markdown result.

curl -X POST https://api.lighton.ai/api/v3/parse \
  -H 'Authorization: Bearer $TOKEN' \
  -F file=@invoice.pdf

Async mode (options.async = true)

Returns 202 immediately with a parse_<token> job id. Poll GET /api/v3/parse/{id} with that same id until status is completed or failed.

curl -X POST https://api.lighton.ai/api/v3/parse \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"document": "https://example.com/report.pdf", "options": {"async": true}}'

For multipart uploads, pass options as a JSON-encoded form field: -F 'options={"async":true}'.

Supported file types: .pdf, .png, .jpg, .jpeg, .pptx, .ppt, .odp, .docx, .odt, .doc, .html

Sync limits: 20 MB file size, 15 pages.

Async limits: 100 MB file size, 1000 pages.

post/api/v3/parse

Request

  • Base URL
    https://api.lighton.ai
  • URL
    https://api.lighton.ai/api/v3/parse
  • Auth
    HTTP bearer

Request body

documentstring uri required

Publicly accessible URL of the document to parse.

Response

Sync parse — document parsed successfully.

idstring required
statusstring required
created_atstring date-time required
completed_atstring date-time required
processing_time_msinteger required

Changes

    • breaking

      added required request body

    • info

      api operation id api_v3_parse_create was added

    • info

      the endpoint scheme security bearerAuth was added to the API

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status

    • info

      added the success response with the status