Skip to main content
POST
/
api
/
v1
/
extract
/
stream
Streaming Extraction
curl --request POST \
  --url https://extraction-api.nanonets.com/api/v1/extract/stream \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form output_format=markdown \
  --form file='@example-file'
"data: {\"type\": \"content\", \"data\": \"# Document Title\\n\"}\n\ndata: {\"type\": \"done\", \"record_id\": \"12345\", \"processing_time\": 2.5}\n\n"

Authorizations

Authorization
string
header
required

API key as Bearer token: Authorization: Bearer YOUR_API_KEY

Body

multipart/form-data
output_format
string
required

Output format(s): markdown, html, json, csv. Comma-separate for multiple.

Example:

"markdown"

file
file

File to upload (PDF, Word, Excel, PowerPoint, images)

file_url
string<uri>

URL to download file from

Example:

""

file_base64
string

Base64-encoded file content

Example:

""

enable_streaming
boolean
default:true

Enable real-time streaming. If false, returns complete content via SSE batch mode.

custom_instructions
string

Custom extraction instructions

Maximum string length: 8000
Example:

""

prompt_mode
enum<string>
default:append

append: add to base prompt, replace: use only custom instructions

Available options:
append,
replace
json_options
string

JSON extraction options

Example:

""

csv_options
string

CSV extraction options

Example:

""

include_metadata
string

Comma-separated metadata: bounding_boxes, confidence_score

Example:

""

Response

SSE stream of extraction events

Server-Sent Events stream with JSON payloads

Example:

"data: {\"type\": \"content\", \"data\": \"# Document Title\\n\"}\n\ndata: {\"type\": \"done\", \"record_id\": \"12345\", \"processing_time\": 2.5}\n\n"