Skip to content

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

  • columnsstringoptional
  • filestringoptional
  • instructionstringoptional

    Up to 1000000 characters.

  • schemastringoptional
  • strictnessstringoptional
    Allowed values
    strictbalancedflexible
  • textstringoptional

    Up to 1000000 characters.

Returns

200application/json

  • batch_idstringoptional
  • confidencenumberRequirednullable
  • creditsintegerRequired

    At least 0.

  • duration_msnumberRequirednullable
  • fail_countnumberRequired
  • file_typestringoptionalnullable
    Allowed values
    text_pdfscannedimagetextdocumentunknown
  • filesarray of objectsRequired
  • resultobjectoptional
  • statusstringRequired
  • success_countnumberRequired
  • table_idstringRequired
  • total_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

  • columnsstringoptional
  • filestringoptional
  • instructionstringoptional

    Up to 1000000 characters.

  • schemastringoptional
  • strictnessstringoptional
    Allowed values
    strictbalancedflexible
  • textstringoptional

    Up 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"  },})
string

Extract into table (JSON response)

POST/v1/projects/{project_id}/tables/{table_id}/extract

Path parameters

  • project_idstringRequired
  • table_idstringRequired

Request body

multipart/form-dataapplication/x-www-form-urlencoded

  • filestringoptional
  • textstringoptional

    Up to 1000000 characters.

Returns

200application/json

  • batch_idstringoptional
  • confidencenumberRequirednullable
  • creditsintegerRequired

    At least 0.

  • duration_msnumberRequirednullable
  • fail_countnumberRequired
  • file_typestringoptionalnullable
    Allowed values
    text_pdfscannedimagetextdocumentunknown
  • filesarray of objectsRequired
  • resultobjectoptional
  • statusstringRequired
  • success_countnumberRequired
  • table_idstringRequired
  • total_rowsnumberRequired

Errors

  • 404not_foundtable_not_found
Errors every endpoint can return
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_idstringRequired
  • table_idstringRequired

Request body

multipart/form-dataapplication/x-www-form-urlencoded

  • filestringoptional
  • textstringoptional

    Up to 1000000 characters.

Returns

200text/event-stream

Errors

  • 404not_foundtable_not_found
Errors every endpoint can return
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