The platform
Parse
Turn a document into text, Markdown, HTML or JSON.
A parse job reads a document and returns its content in the format you choose. It is also the first step of an extraction: an extract job always works on a completed parse job.
Create a parse job
Section titled “Create a parse job”curl -X POST "https://byteit.ai/v1/jobs/parse-jobs/" \ -H "X-API-Key: $BYTEIT_API_KEY" \ -F "file=@invoice.pdf" \ -F "nickname=invoice-march" \ -F "output_format=md"import os
from byteit import ByteIt
client = ByteIt(api_key=os.environ["BYTEIT_API_KEY"])
with open("invoice.pdf", "rb") as file: client.parse_jobs.create(file=file, nickname="invoice-march", output_format="md")import * as fs from "fs";import { ByteItClient } from "@byteit/sdk";
const client = new ByteItClient({ apiKey: process.env.BYTEIT_API_KEY! });
await client.parseJobs.create({ file: fs.createReadStream("invoice.pdf"), nickname: "invoice-march", output_format: "md",});using ByteIt;
var client = new ByteItClient(Environment.GetEnvironmentVariable("BYTEIT_API_KEY")!);
await client.ParseJobs.CreateAsync( new CreateParseJobRequest { File = new FileParameter { Stream = File.OpenRead("invoice.pdf"), FileName = "invoice.pdf" }, Nickname = "invoice-march", OutputFormat = OutputFormatEnum.Md, });Output formats
Section titled “Output formats”output_format |
You get |
|---|---|
txt |
Plain text. The default. |
md |
Markdown. |
html |
HTML. |
json |
Structured JSON. |
zip |
A ZIP archive. |
You can also ask for another format when you download: the result endpoint takes an output_format
override.
Processing options
Section titled “Processing options”Send these in processing_options.
| Option | Default |
|---|---|
parse_type |
auto. Also complex and handwritten. |
languages |
Not set |
page_range |
Not set |
table_enrichment |
false |
image_annotations |
false |
force_image_annotations |
false |
Get the result
Section titled “Get the result”Poll the job’s status until it is completed, then download the result. See the
Quickstart for the full loop.
curl https://byteit.ai/v1/jobs/$JOB_ID/result/ \ -H "X-API-Key: $BYTEIT_API_KEY" \ -o invoice.md