Chart Extraction Endpoint Reference
Reference for 2 Chart Extraction endpoints of the Talonic API: parameters, request body, curl and Node.js examples, response and errors.
Chart Extraction reads the data points of the charts on one PDF page into a table of values. A deterministic engine turns stored, source-bound inputs (the request, delivery metadata, printed ticks, companion scales and curve expectations) into one result per requested chart, with the chart contract and a coverage report; no model is called. Inputs are bound to a file by the SHA-256 of its bytes, runs and PDF reads are queued and processed by a worker, and every stored result carries an integrity seal that is verified on read. These endpoints belong to the Chart Extraction app (catalog slug chart-to-data); they return 404 in a workspace that has not added the app — GET /v1/apps lists a workspace's apps by slug.
Every request needs an API key in the Authorization: Bearer header. Examples read the key from the TALONIC_API_KEY environment variable.
/v1/chart-to-data/read-charts/previewQuery parameters
curl
curl -X GET 'https://api.talonic.com/v1/chart-to-data/read-charts/preview?document_ids=3fa85f64-5717-4562-b3fc-2c963f66afa6' \
-H "Authorization: Bearer $TALONIC_API_KEY"Node.js (18+)
const res = await fetch("https://api.talonic.com/v1/chart-to-data/read-charts/preview?document_ids=3fa85f64-5717-4562-b3fc-2c963f66afa6", {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
},
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();Response 200 — At most what the selection would read and cost.
{
"documents": 1,
"charts": 1,
"calls_max": 1,
"cost_max_usd": 1.5,
"currency": "USD"
}- 400 — The request is invalid.
- 403 — The API key does not have the required scope.
/v1/chart-to-data/pdfs/{documentId}/pages/{page}/diagramRequired scope: read
Path parameters
Query parameters
x0,y0,x1,y1 in PDF points (top-left origin): the part of the page a pipe diagram is read from.curl
curl -X GET 'https://api.talonic.com/v1/chart-to-data/pdfs/3fa85f64-5717-4562-b3fc-2c963f66afa6/pages/1/diagram' \
-H "Authorization: Bearer $TALONIC_API_KEY"Node.js (18+)
const res = await fetch("https://api.talonic.com/v1/chart-to-data/pdfs/3fa85f64-5717-4562-b3fc-2c963f66afa6/pages/1/diagram", {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
},
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const data = await res.json();Response 200 — The read's state and, once done, the diagram.
{
"status": "queued",
"error_code": "string",
"error_message": "string",
"view": {
"reader": "pipe",
"page": {
"width": 1.5,
"height": 1.5
},
"nodes": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"label": "string",
"kind": "string",
"lane": "string",
"bbox": [],
"symbol": [],
"at": [],
"items": [],
"evidence": "string"
}
],
"edges": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"from": "string",
"to": "string",
"kind": "string",
"directed": true,
"evidence": "string",
"path": []
}
],
"lanes": [
{
"name": "string",
"nodes": []
}
]
}
}- 400 — The request is invalid.
- 401 — Missing or invalid API key.
- 403 — The API key does not have the required scope.
- 404 — The requested resource was not found.
- 413 — The uploaded file exceeds the size limit.
- 422 — The page number is not a page of the PDF.
- 429 — Daily rate limit exceeded.