API reference
Extract
Extract rows from a file or text, as one JSON response or a stream of server-sent events.
Extract data from text or file (JSON response)
POST/v1/projects/{project_id}/extract
Path parameters
project_idstringRequired
Request body
multipart/form-dataapplication/x-www-form-urlencoded
columnsstringoptionalfilestringoptionalinstructionstringoptionalUp to 1000000 characters.
schemastringoptionalstrictnessstringoptional- Allowed values
strictbalancedflexible
textstringoptionalUp to 1000000 characters.
Returns
200application/json
batch_idstringoptionalconfidencenumberRequirednullablecreditsintegerRequiredAt least 0.
duration_msnumberRequirednullablefail_countnumberRequiredfile_typestringoptionalnullable- Allowed values
text_pdfscannedimagetextdocumentunknown
filesarray of objectsRequiredconfidencenumberoptionalnullableerroranyoptionalnullablefile_nameanyoptionalnullablerowsnumberoptionalnullablestatusstringoptional
resultobjectoptionalstatusstringRequiredsuccess_countnumberRequiredtable_idstringRequiredtotal_rowsnumberRequired
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.extract.once({ params: { project_id: "{project_id}" }, form: { columns: "string", file: "<file>", instruction: "string", schema: "string", strictness: "strict", text: "string" },}){ "batch_id": "string", "confidence": 0, "credits": 0, "duration_ms": 0, "fail_count": 0, "file_type": "text_pdf", "files": [ { "confidence": 0, "error": null, "file_name": null, "rows": 0, "status": "string" } ], "result": {}, "status": "string", "success_count": 0, "table_id": "string", "total_rows": 0}Extract data from text or file (SSE stream)
POST/v1/projects/{project_id}/extract-stream
Path parameters
project_idstringRequired
Request body
multipart/form-dataapplication/x-www-form-urlencoded
columnsstringoptionalfilestringoptionalinstructionstringoptionalUp to 1000000 characters.
schemastringoptionalstrictnessstringoptional- Allowed values
strictbalancedflexible
textstringoptionalUp to 1000000 characters.
Returns
200text/event-stream
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.extract.stream({ params: { project_id: "{project_id}" }, form: { columns: "string", file: "<file>", instruction: "string", schema: "string", strictness: "strict", text: "string" },})stringExtract into table (JSON response)
POST/v1/projects/{project_id}/tables/{table_id}/extract
Path parameters
project_idstringRequiredtable_idstringRequired
Request body
multipart/form-dataapplication/x-www-form-urlencoded
filestringoptionaltextstringoptionalUp to 1000000 characters.
Returns
200application/json
batch_idstringoptionalconfidencenumberRequirednullablecreditsintegerRequiredAt least 0.
duration_msnumberRequirednullablefail_countnumberRequiredfile_typestringoptionalnullable- Allowed values
text_pdfscannedimagetextdocumentunknown
filesarray of objectsRequiredconfidencenumberoptionalnullableerroranyoptionalnullablefile_nameanyoptionalnullablerowsnumberoptionalnullablestatusstringoptional
resultobjectoptionalstatusstringRequiredsuccess_countnumberRequiredtable_idstringRequiredtotal_rowsnumberRequired
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.extract.table.once({ params: { project_id: "{project_id}", table_id: "{table_id}" }, form: { file: "<file>", text: "string" },}){ "batch_id": "string", "confidence": 0, "credits": 0, "duration_ms": 0, "fail_count": 0, "file_type": "text_pdf", "files": [ { "confidence": 0, "error": null, "file_name": null, "rows": 0, "status": "string" } ], "result": {}, "status": "string", "success_count": 0, "table_id": "string", "total_rows": 0}Extract into table (SSE stream)
POST/v1/projects/{project_id}/tables/{table_id}/extract-stream
Path parameters
project_idstringRequiredtable_idstringRequired
Request body
multipart/form-dataapplication/x-www-form-urlencoded
filestringoptionaltextstringoptionalUp to 1000000 characters.
Returns
200text/event-stream
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({ baseURL: "https://api.anyrow.ai", headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.extract.table.stream({ params: { project_id: "{project_id}", table_id: "{table_id}" }, form: { file: "<file>", text: "string" },})string