Skip to main content
POST
/
api
/
v0
/
extract
Extract Agent
curl --request POST \
  --url https://agents.graphy.dev/api/v0/extract \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sourceText": "In Q3, the Direct channel brought in $1.9M, Partner $0.4M, and Marketplace $1.1M.",
  "metadata": {
    "callId": "req-extract-1",
    "locale": "EN_US"
  }
}
'
{
  "message": "<string>"
}
Build a chart-ready dataset from unstructured text, images, PDFs, or Excel spreadsheets. Returns a GraphConfig with the extracted data via Server-Sent Events.

Request body

Provide sourceText, attachments, or both — at least one is required. Each attachment is { kind: "image" | "document" | "spreadsheet", mimeType, dataBase64 }, where dataBase64 is RFC 4648 standard base64 (not a data: URL). Limits: 8 images (2 MB each), 2 PDFs (6 MB each), 2 spreadsheets (6 MB each); 12 attachments and 12 MB combined. The legacy images array is deprecated — use attachments with kind: "image". images and attachments cannot be combined.

Response

The response is a Server-Sent Events stream. See SSE Format for parsing details.
event: progress
data: {"message":"Extracting dataset from source content..."}

event: complete
data: {"config":{...},"response":{"message":"Extraction complete"},"extractMeta":{"confidence":"high","needsUserInput":false,"warnings":[]}}
Final response data:
interface ExtractResponse {
  config: GraphConfig;
  response: {
    message: string;
  };
  extractMeta: ExtractMeta | null;
  lastAccuracyEvaluation?: ExtractAccuracyEvaluation;
}

HTTP Status Codes

StatusDescription
200Success (stream begins)
400Invalid request body / no source
401Invalid or missing API key
429Rate limit exceeded
500Internal server error
Errors may also arrive as SSE events within a 200 response. See Error Codes.

Authorizations

Authorization
string
header
required

Your Graphy API key

Body

application/json

Provide sourceText, attachments, or both — at least one is required. images and attachments are mutually exclusive.

sourceText
string

Raw text to extract data from

Maximum string length: 500000
attachments
object[]

Images (max 8), PDFs (max 2), and spreadsheets (max 2). Preferred over images[].

Maximum array length: 12
images
object[]

Deprecated — use attachments with kind "image".

Maximum array length: 8
metadata
object

Optional tracking information for requests

Response

SSE stream with progress and completion events

SSE event name is "progress"

message
string