Quickstart
Installation
Parse a document from a URL
Send the document’s URL as JSON. For a PDF,maxPages caps how many pages are read, and billed.
Response
numPages is the number of pages read, and totalPages the length of the document. This paper has 15 pages; the request read 2 and cost 2 credits.
Upload a file
Send the file asmultipart/form-data, in a field named file. In Python, pass a path, bytes or an open file. In Node, pass the bytes and the file name.
Response
Response
Options with an upload
With an upload, send options as JSON in a form field namedoptions. They are the same page options as Scrape, like formats.
cURL
Response
Supported formats
Upload any of these the same way, like this Word file:cURL
data.markdown.
Uploading any other file type answers
415 with the code unsupported_file_type.
Considerations
- Size: uploads are limited to 4 MB. A bigger file answers
413with the codefile_too_large: parse it from a URL instead. - Cost: a PDF costs 1 credit per page read. Any other document costs 1 credit. Formats like
jsonadd their own cost, see Billing. - Uploads or URLs: send one or the other. A request with both is refused.