Extract a visual rendition
Read the visual layout of an owned JPEG or PNG image source as a model-generated rendition.
Last updated
/api/v1/extract/visual-renditionhttps://api.webcite.coWhen to use it
Send visual_rendition: true with an owned asset_id, the exact immutable source_version_id of that JPEG or PNG source, and an Idempotency-Key header. Retrying with the same key and payload replays the stored outcome. The rendition is model-generated: keep visual_provenance with it and treat it as a partial reading of the image. Use Extract document text for ordinary extraction.
Request
1 credit for a billable outcome, a fixed price rather than the metered price of [text extraction](/api-docs/extract).
Examples run on your server. Set WEBCITE_API_KEY first. Python examples use the requests package.
curl --fail-with-body -X POST 'https://api.webcite.co/api/v1/extract/visual-rendition' \
-H "x-api-key: $WEBCITE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"asset_id": "YOUR_ASSET_ID",
"source_version_id": "YOUR_SOURCE_VERSION_ID",
"visual_rendition": true
}'Request body
asset_idstringAn uploaded asset id (from POST /upload). One of asset_id / asset_url is required.
asset_urlstringA direct URL to the file. One of asset_id / asset_url is required.
modestringHow PDF pages and images are read on /extract and /extract/pages. lite is the faster, lower-cost read, about 0.12 credits a page. standard is the higher-accuracy read for each page type, about 0.75 credits a page, with a second read for form pages and for a read that fails; it does better on complex tables, handwriting and scans. Every other step is the same in both modes: the reading is checked against the page's text layer and drawing, long tables are read again in row bands, chart values are measured from the drawing, and form and table rules apply. A lite read and a standard read of the same file are kept apart; neither is served for the other. Spreadsheets and text documents are read the same way in both modes. With no mode, an account created on or after 20 November 2026 (04:00 UTC) reads in lite; an account created before then keeps standard, as before, and can send lite to opt in. A visual rendition is read in standard mode.
Values: "standard""lite"
refreshbooleanRead the file again even when the same content was read before in this account, and keep the new complete read in place of the earlier one. The new read is charged. Default false.
Default: false
source_version_idstringExact immutable owned source version for visual_rendition.
visual_renditionbooleanExplicit JPEG/PNG visual layout rendition. Requires owned asset_id, exact source_version_id and Idempotency-Key. Source remains partial; does not select the rendition.
Response
Returns markdown with extraction_method ocr, state partial and complete: false, plus source_version_id, representation_id, source_units and visual_provenance (origin model_generated). The source remains partial; this call does not select the rendition as the source's reading. The public OpenAPI does not yet define a response schema for this operation.
201 response
See the response guidance above. A complete JSON schema is not published for this response.
Errors
400 when visual_rendition: true, a valid Idempotency-Key, or an owned asset_id matching the exact JPEG/PNG source_version_id is missing; asset_url is not accepted. For 401, check your API key. For 429, wait for the retry interval; this operation uses the stricter plan rate limit. See the errors guide before retrying a billable request.