An OCR API with source coordinates and an explicit review contract
Trace extracted values to box and quad source coordinates, process data.review.flagged, and inspect cells[path] evidence without relying on a fixed confidence threshold.
Most OCR APIs can return text, geometry, or recognition scores. For an auditable workflow, the useful contract is more explicit: business values, source coordinates, supporting evidence, and the list of paths that need review should be addressable separately.
In space ocr, extracted data lives in data.values. A path such as total or items[0].amount addresses data.cells[path], which can include box, quad, verified, review, and evidence. The same path grammar is used by data.review.flagged, so a review UI can move directly from a flagged item to its source region. For coordinate-format comparisons, see an OCR API with bounding boxes.
Source coordinates and a review contract
Recognition confidence and text-to-page matching can be useful diagnostic signals, but neither should be presented as a universal acceptance rule. The current public review queue is data.review.flagged. Each item contains a path and reasons; use that path to inspect data.cells[path].
The cell's evidence.match_ratio, when present, describes character coverage from a supporting OCR comparison. It is evidence, not a fixed product-level confidence gate. A cell can also be flagged because a required field is missing, a pattern or range is violated, or a positional declaration is unresolved.
How coordinates stay checkable. The extracted value is cross-checked against OCR observations on the page, and geometry is returned separately from the business value. evidence.printed_text can be compared with data.values[path]; neither is automatically declared the sole truth. Coordinates and cross-checks surface mismatches, but two systems can still agree on the same misread, so business-rule validation remains important.
What comes back per path
data.values: business data in the requested schema.data.cells[path].box: axis-aligned coordinates on a 0–1000 normalized grid.data.cells[path].quad: four points that follow page rotation.data.cells[path].verifiedandreview: the verification verdict and review reasons.data.cells[path].evidence: supporting OCR comparison details.data.review.flagged: the human-review work list.data.normalized: deterministic parsed values for declared date, number, and integer fields.data.image: the width and height used to convert normalized coordinates to pixels.
curl -s https://api.space-ocr.com/ocr/fields \
-H "Authorization: Bearer $SPACE_OCR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "https://example.com/receipt.jpg",
"imageType": "url",
"fields": [
{ "name": "merchant", "type": "string", "required": true },
{ "name": "date", "type": "date", "required": true },
{ "name": "total", "type": "number", "required": true, "min": 0 }
]
}'Build the queue from review.flagged
Do not scan fields against a fixed match-ratio threshold. Iterate data.review.flagged; for each flag.path, fetch data.cells[flag.path] and show its review.reasons, box or quad, and relevant evidence. The reviewer sees the printed region while editing the corresponding value from data.values.
import json, os, urllib.request
body = json.dumps({
"image": "https://example.com/receipt.jpg",
"imageType": "url",
"fields": [
{"name": "merchant", "type": "string", "required": True},
{"name": "date", "type": "date", "required": True},
{"name": "total", "type": "number", "required": True, "min": 0},
],
}).encode()
req = urllib.request.Request(
"https://api.space-ocr.com/ocr/fields", data=body,
headers={"Authorization": f"Bearer {os.environ['SPACE_OCR_API_KEY']}",
"Content-Type": "application/json"},
)
data = json.load(urllib.request.urlopen(req))["data"]
values, cells = data.get("values", {}), data.get("cells", {})
for flag in data.get("review", {}).get("flagged", []):
path = flag["path"]
cell = cells.get(path, {})
print({"path": path, "value": values.get(path),
"reasons": flag.get("reasons", []),
"box": cell.get("box"), "quad": cell.get("quad"),
"evidence": cell.get("evidence")})A review tool can draw the cell coordinates without re-running OCR. Convert a horizontal coordinate with x / 1000 * data.image.width and a vertical coordinate with y / 1000 * data.image.height. Use the documented edit workflow if the corrected value must be stored, and retain an audit record appropriate to your application. See building an OCR audit trail and validating OCR with bounding boxes.
Query stored results without re-running OCR
After asynchronous uploads have been processed into a sheet, GET /view reads stored rows and supports the documented server-side where, sort, select, limit, and offset options. Use it for business-data queries; use the review information stored with each result rather than assuming match ratio is a queryable sheet column. Consult /docs for the current boxes option and exact response shape.
curl -s -G https://api.space-ocr.com/view \
-H "Authorization: Bearer $SPACE_OCR_API_KEY" \
--data-urlencode "path=/invoices/2026-08" \
--data-urlencode "where=total>=40000" \
--data-urlencode "sort=-invoice_date" \
--data-urlencode "select=vendor,total,invoice_date" \
--data-urlencode "boxes=1" \
--data-urlencode "limit=50"How to build a review-before-trust OCR pipeline
- Declare fields and validationUse fields with the documented required, type, pattern, range, enum, label, near, or not_near declarations that fit the document.
- Read values and the review queueKeep business data in data.values and iterate data.review.flagged for paths that need attention.
- Resolve source coordinatesFor every flagged path, open data.cells[path] and draw its box or quad using data.image dimensions.
- Review with evidenceShow review reasons and relevant evidence, including printed text where present, without treating one score as proof.
- Store and query resultsUse the documented edit and stored-sheet APIs, and retain downstream validation appropriate to the business process.