Preview source evidence
Resolve a citation to its source and check whether the quoted passage can be found.
/api/v1/citations/source-previewhttps://api.webcite.coWhen to use it
For a web page, send url. For a file, send asset_id with a 1-based page, or a spreadsheet cell and optional full. For immutable evidence, send source_version_id, representation_id, and source_unit_id together. IDs must belong to the authenticated account.
A reflowed match uses a prepared OCR reading and remains subject to review. Preserve the original matched_text and the rescue provenance. See evidence and review.
Request
1 credit.
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/citations/source-preview' \
-H "x-api-key: $WEBCITE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://www.toureiffel.paris/en/the-monument/key-figures",
"quote": "330 meters"
}'Request body
asset_idstringUploaded asset ID to preview (from POST /upload). Provide this OR url. Also accepts an "asset://" citation url.
cellstringA1 cell anchor for a legacy spreadsheet preview.
fullbooleanReturn the capped full sheet instead of a cell window.
highlight_termsstring[]Terms to highlight in the preview.
pagenumber1-based page (PDF) or sheet index (spreadsheet) to preview.
Default: 1
quotestringThe cited quote. It is bound back against the resolved source text; the response reports whether it was found (grounded) and how it matched.
representation_idstringExact parser representation, never latest.
source_unit_idstringExact unit within the immutable representation.
source_version_idstringImmutable source version. Requires representation_id and source_unit_id.
titlestringOptional title for a web source.
urlstringWeb source URL to preview. Provide this OR asset_id. Returns a text-fragment deep link that scrolls to the quote.
Response
Returns a source preview and binding information. Check binding.grounded, binding.method, and the matched passage before presenting the quote as source-backed.
200 response
application/json
anchorstringasset_idstringAsset ID (kind=page|grid).
bindingobjectrequiredbindBack result , whether the quote is grounded in the source.
Show binding fields
groundedbooleanrequiredTrue when the quote was found in the resolved source.
matched_quotestringThe matched substring, when grounded verbatim.
matched_textstringThe best-matching passage found in the source , present even when unbound, so a reviewer sees the closest evidence.
methodstringrequiredHow the quote matched: exact/normalized substring, fuzzy passage match, reflowed OCR reading, or unbound.
Values: "exact""normalized""fuzzy""reflowed""unbound"
readingstringDerived body reading with page furniture removed; absent for stored text.
Values: "body"
rescueobjectOCR rescue outcome: attempted=false with code/reason, attempted=true and rescued=false (optionally ambiguous), or rescued=true with transformations, raw dropped lines and retained spans. Unknown or unattempted is never a failed rescue.
Show rescue fields
Variant 1
attemptedbooleanrequiredValues: false
codestringrequiredValues: "not_ocr""labels_not_available""judge_unavailable""not_prepared""disabled""resource_limit"
reasonstringrequiredVariant 2
ambiguousbooleanValues: true
attemptedbooleanrequiredValues: true
rescuedbooleanrequiredValues: false
Variant 3
attemptedbooleanrequiredValues: true
basisstringrequiredValues: "code""measured"
calibrationKeystringrequireddecidedAtstringrequireddroppedLinesstring[]requiredmodelstring | nullrequiredreadingstringrequiredDerived matching text; display the raw preview text instead.
rescuedbooleanrequiredValues: true
retainedSpansobject[]requiredShow retainedSpans fields
fromLineintegerrequiredpageintegerrequiredtoLineintegerrequiredtransformationsobject[]requiredShow transformations fields
afterLineintegeratLineintegerkindstringrequiredValues: "dehyphenate""join""drop"
linestringsourcestringValues: "element_label""repetition""page_number""margin_band"
scorenumberSimilarity of the best match, 0..1.
cellsstring[]Bounded rows of cells with A1 refs, values and anchor flags.
deep_linkstringrequiredDeep link to the source at the cited location: url#:~:text=quote for web, asset_url#page=N for documents.
highlight_termsstring[]Highlight terms.
image_base64stringjudgmentobjectkindstringrequiredPreview shape.
Values: "web""page""grid""unit""image"
locatorobjectmime_typestringValues: "application/pdf"
pagenumberPage/sheet number (kind=page|grid).
quotestringThe cited quote.
representation_idstringsheetstringSheet name (kind=grid).
source_unit_idstringsource_version_idstringstateobjecttextstringResolved source text (kind=page|grid).
titlestringWeb source title (kind=web).
urlstringWeb source URL (kind=web).
Errors
For 400, check the request fields and source identifiers. For 401, check your API key. For 429, wait for the retry interval. See the errors guide before retrying a billable request.
400- Provide a web url or an asset_id
401- Unauthorized - API key required
429- Rate limit exceeded