# 100sands API reference > 100sands reads PDF and HTML files and returns their text in reading order, or just the fields you need as JSON, copied exactly from the file. - Website: https://100sands.com - App (sign-up, API keys, document types, uploads): https://platform.100sands.com - API base URL: https://api.100sands.com - Human-readable docs: https://100sands.com/docs - Last updated: 2026-12-04 ## Accuracy We say 100% only about what has been checked. Here is what that means for your data. - **Copied, never rewritten**: Every value is copied character for character from the file's own text. Nothing is retyped, summarized or corrected. - **Live only at 100%**: A document type goes live only after it returns every expected value on every sample you gave it. - **Empty, never guessed**: When a value isn't in a document, its field comes back empty. You never get a made-up answer. ## Quickstart 1. Create a free account: https://platform.100sands.com/signup 2. In the app, open API keys and create a key. Copy it: it is shown only once. 3. Send your first document: ```bash export SANDS_API_KEY=sand_live_... curl https://api.100sands.com/v1/text \ -H "Authorization: Bearer $SANDS_API_KEY" \ -F file=@document.pdf ``` ## Authentication Send your key as `Authorization: Bearer sand_live_…` or as `X-API-Key`. Keys start with `sand_live_`, so they are easy to spot if one leaks. Delete a key in the app at any time; it stops working immediately. ## Endpoints The base address is `https://api.100sands.com`. Send a file as a `file` field in `multipart/form-data`, or send JSON with a `fileUrl`. Responses are JSON. | Endpoint | Fields | Returns | |---|---|---| | `GET /v1/me` | none | The account the key belongs to: its email and plan. Use it to test a key. | | `GET /v1/document-types` | none | Your document types that have a live version, with their fields. | | `POST /v1/text` | file | fileUrl | The file's text: lines in reading order, cells separated by tabs, pages by a form feed. | | `POST /v1/document-types/{id}/extract` | file | fileUrl, fileName, version | The fields of one of your document types, as JSON. Uses the live version unless you pass version. | | `POST /v1/classify` | file | fileUrl, extract | Which of your document types the file is, with a score. With extract=true, its fields too. | | `GET /v1/extractions` | documentTypeId, limit | Your recent results, newest first, up to 100 at a time. | | `POST /v1/webhooks` | url, documentTypeId, source | Subscribes a URL to document.extracted events. Returns the webhook's id and signing secret. | | `DELETE /v1/webhooks/{id}` | none | Removes a webhook subscription. | | `GET /v1/webhooks/sample` | documentTypeId | One example result with a document type's fields, for setting up an integration. | ## Files and limits Every endpoint that reads a file takes the same files, and counts one document per file, whatever its page count. - **PDF**: PDF files that contain text. A PDF where only some pages have text is read with the other pages left blank. - **HTML**: HTML pages and files (.html, .htm). - **Size**: Up to 50 MB per file. Samples for a document type: up to 10 MB each, at most 5 per type. - **By link**: Instead of uploading, send JSON with fileUrl. The link must be https, at most 50 MB, and on a public address. It is fetched with a 20-second timeout. Scans, photos and images are not read. A PDF without a text layer, such as a scan, is refused with 422 NO_TEXT_IN_FILE, and a password-protected PDF with 422 ENCRYPTED_PDF. Other kinds of file, including Word, Excel, CSV and text files, are refused with 415 UNSUPPORTED_FILE. Refused files are not counted. ## Text: POST /v1/text `POST /v1/text` returns the number of pages and the whole text as one string. Each line comes back in reading order, including right-to-left lines. Table cells on the same line are separated by a tab (`\t`), and pages by a form feed (`\f`). ```bash curl https://api.100sands.com/v1/text \ -H "Authorization: Bearer $SANDS_API_KEY" \ -F file=@company-extract.pdf { "pages": 3, "text": "COMPANY EXTRACT\nCompany name\tHarbor Lane Logistics Ltd\nCompany number\t51-482913-6\nStatus\tActive\n..." } ``` The same call with a link instead of a file: ```bash curl https://api.100sands.com/v1/text \ -H "Authorization: Bearer $SANDS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "fileUrl": "https://example.com/files/company-extract.pdf" }' ``` ## Document types: POST /v1/document-types/{id}/extract A document type returns named fields instead of raw text. Set one up in the app: upload 1 to 5 samples, check the fields and each sample's values that AI suggests, and let AI build the extraction. The build is ready only when every field matches on every sample, and the first version that is ready goes live. ```bash curl https://api.100sands.com/v1/document-types/42/extract \ -H "Authorization: Bearer $SANDS_API_KEY" \ -F file=@company-extract.pdf { "id": "ext_8Kq2Vd", "documentType": { "id": 42, "name": "Company registry extract" }, "version": 2, "fileName": "company-extract.pdf", "pages": 3, "createdAt": "2026-12-04T09:12:44Z", "fields": { "companyName": "Harbor Lane Logistics Ltd", "companyNumber": "51-482913-6", "status": "Active", "registeredOn": "2019-03-14", "shareCapital": 1250.5, "directors": ["Dana Levi", "Omar Haddad"], "charges": [ { "chargeNumber": "1", "holder": "Harbor Credit Ltd", "status": "Active" }, { "chargeNumber": "2", "holder": "Quay Street Bank", "status": "Released" } ], "liquidator": null } } ``` ### Field values - **Text**: A string, or null when it isn't in the document. - **Number**: A JSON number, or null. - **Date**: A string, as YYYY-MM-DD when the date format is known, or null. - **Yes/no**: true or false, or null. - **List**: An array of strings, or [] when nothing is found. - **Table**: An array of rows, each an object with one value per column, or [] when nothing is found. Field values are never guessed. A value that isn't in the document comes back as null, or as [] for list and table fields. ### Versions Every change to a document type's fields is a new version, built and checked against all its samples. Calls use the live version, and you choose in the app when a new version becomes live. The response says which version answered. To stay on one version while you change the type, pass it: ```bash curl "https://api.100sands.com/v1/document-types/42/extract?version=1" \ -H "Authorization: Bearer $SANDS_API_KEY" \ -F file=@company-extract.pdf ``` `GET /v1/document-types` lists the document types that have a live version, with their ids and fields. ## Classification: POST /v1/classify When files arrive mixed, `POST /v1/classify` tells which of your document types a file is. It compares the file with every document type that has a live version. Add `extract=true` to get the matched type's fields in the same call. ```bash curl "https://api.100sands.com/v1/classify?extract=true" \ -H "Authorization: Bearer $SANDS_API_KEY" \ -F file=@incoming.pdf { "result": "matched", "documentType": { "id": 42, "name": "Company registry extract" }, "score": 0.94, "candidates": [ { "id": 42, "name": "Company registry extract", "score": 0.94 }, { "id": 57, "name": "Supplier invoice", "score": 0.18 } ], "pages": 3, "extraction": { "id": "ext_9Pw4Lc", "documentType": { "id": 42, "name": "Company registry extract" }, "version": 2, "fields": { "companyName": "Harbor Lane Logistics Ltd", "companyNumber": "51-482913-6" } } } ``` - **matched**: One type fits: documentType names it, with its score from 0 to 1. - **ambiguous**: Two or more types fit about as well as each other; they are at the top of candidates. Add a phrase in the app that only one type's documents contain, such as a supplier's name, to tell them apart. - **none**: No document type fits the file well enough. - **extract=true**: With a match, the result also has extraction, as /v1/document-types/{id}/extract returns it. If that part fails, the classification is still returned, with extraction.error and extraction.message. candidates lists up to 5 document types, best first, each with its score. ## Results: GET /v1/extractions `GET /v1/extractions` returns your recent results, newest first, up to 100 at a time. Filter by `documentTypeId` and set `limit`. Results are kept for 30 days, or 90 days on Pro. ## Webhooks A webhook sends each result to your server as soon as a document is extracted. Add one in the app, or subscribe from code with `POST /v1/webhooks`, optionally for one document type. The URL must be https and on a public address. The response holds the signing secret, shown only once. ```bash curl https://api.100sands.com/v1/webhooks \ -H "Authorization: Bearer $SANDS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/hooks/100sands", "documentTypeId": 42 }' { "id": 12, "secret": "whsec_..." } ``` - Each event is a POST with a JSON body and the header `X-100sands-Event: document.extracted`. - A 2xx response counts as delivered. Otherwise it is sent again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. - In the app you can send a test event to check your endpoint. ```http POST /hooks/100sands X-100sands-Event: document.extracted X-100sands-Signature: t=1764839564,v1=5f2c… { "id": "evt_3Hn7Qa", "type": "document.extracted", "createdAt": "2026-12-04T09:12:44Z", "data": { "extractionId": "ext_8Kq2Vd", "documentType": { "id": 42, "name": "Company registry extract" }, "version": 2, "fileName": "company-extract.pdf", "pages": 3, "fields": { "companyName": "Harbor Lane Logistics Ltd", "companyNumber": "51-482913-6" } } } ``` Every delivery carries `X-100sands-Signature: t=…,v1=…`. `v1` is the hex HMAC-SHA256 of the timestamp, a dot and the raw request body, keyed with your webhook's secret. Compute it yourself, compare, and reject old timestamps: ```javascript import crypto from "node:crypto"; // header: the X-100sands-Signature header; rawBody: the request body as received, before parsing. export function isFrom100sands(header, rawBody, secret) { const parts = Object.fromEntries(header.split(",").map((p) => p.split("="))); const age = Math.abs(Date.now() / 1000 - Number(parts.t)); if (!parts.t || !parts.v1 || age > 300) return false; // older than 5 minutes const expected = crypto.createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex"); const a = Buffer.from(expected); const b = Buffer.from(parts.v1); return a.length === b.length && crypto.timingSafeEqual(a, b); } ``` ## Integrations - **Zapier**: Connect 100sands to Zapier: start a Zap when a document is extracted, with every field ready to map into the next app. The Zapier app is being published; request early access and we'll set you up. - **Make (formerly Integromat)**: Connect 100sands to Make: start a scenario when a document is extracted, with each field ready to use in the next module. The Make app is being published; request early access and we'll set you up. - Request early access: https://100sands.com/contact?topic=integrations ## Without code: batch uploads in the app Anyone on your account can read documents with a document type and get a spreadsheet back, without an API key. 1. In the app, open Uploads and start a new upload for one of your document types. 2. Add the files, or drop a whole folder. Up to 500 files and 500 MB in one upload, each file up to 50 MB. 3. Start it. The files are read in the background, so you can close the page. 4. Download the results as Excel or CSV. - **Rows**: One row per file, with its name. - **Columns**: One column per field, named as in the document type. - **Lists**: One cell, with each value on its own line. - **Tables**: In Excel, a sheet of their own. In CSV, one cell holding the rows as JSON. Each file in an upload counts as one document. A file that can't be read is marked with the reason and isn't counted. Up to 2 uploads can be open or running at once. ## Errors Errors are JSON: `{ "error": "CODE", "message": "…" }`. The message is a plain sentence you can show as it is. Refused and failed calls are not counted. | Status | Code | Meaning | |---|---|---| | 400 | `VALIDATION_FAILED`, `BAD_REQUEST` | The request is invalid. With VALIDATION_FAILED, fields says what is wrong with each field. | | 401 | `INVALID_API_KEY` | The API key is missing, wrong or deleted. | | 403 | `UPGRADE_REQUIRED` | Your plan's limit is reached. reason says which: document_types, api_keys, ai_runs or documents. | | 404 | `NOT_FOUND` | The document type, version, result or webhook doesn't exist. | | 409 | `CONFLICT` | The request conflicts with the current state, for example a document type that isn't live yet. | | 413 | `FILE_TOO_LARGE` | The file is larger than allowed. limitBytes gives the limit. | | 415 | `UNSUPPORTED_FILE` | Only PDF and HTML files that contain text are read. | | 422 | `NO_TEXT_IN_FILE` | The PDF has no text layer, such as a scan. | | 422 | `ENCRYPTED_PDF` | The PDF is password-protected. | | 422 | `UNREADABLE_FILE` | The file is damaged or can't be read. | | 422 | `EXTRACTION_FAILED` | The document couldn't be read as that document type. | | 429 | `QUOTA_EXCEEDED` | This month's documents are used up. limit, used and resetsAt say how many and when they start again. | | 503 | `SERVICE_BUSY`, `AI_UNAVAILABLE` | The service is busy, or AI is briefly unavailable during setup. Try again in a moment. | ## Plans ### Free: free - 100 documents a month - 2 document types - 10 AI setup runs a month - 1 API key - 2 calls at the same time - Results kept 30 days ### Starter: $20 a month - 20,000 documents a month - 20 document types - 100 AI setup runs a month - 5 API keys - 5 calls at the same time - Results kept 30 days ### Pro: $79 a month - 100,000 documents a month - 100 document types - 500 AI setup runs a month - 20 API keys - 20 calls at the same time - Results kept 90 days - Priority processing and support - **Document**: One file you send through the API or upload in the app, however many pages it has. Refused or failed files are not counted. - **Document type**: One kind of document you set up, such as a supplier's invoice or a registry extract, with its own fields. - **AI setup run**: One press of Suggest fields or Build while you set up or change a document type. Extracting documents afterwards uses no AI runs. - **Month**: The calendar month in UTC. Every limit starts again on the first day of the month. Payment is by card through Paddle, billed monthly. Cancel anytime in the app; your plan stays until the end of the month you paid for. Details: https://100sands.com/pricing ## Questions ### What is 100sands? 100sands is an API and app that reads PDF and HTML files and returns their text in reading order, or your own named fields as JSON. AI helps you set up each kind of document once; after that, extraction runs without AI, so the same file always gives the same answer. ### Which files can it read? PDF and HTML files that contain text, up to 50 MB each. It doesn't read scans, photos or images: a scanned PDF is refused with a clear error and isn't counted. Word, Excel, CSV and text files aren't read either. ### What does 100% accuracy mean here? Three things that are checked. Every value is copied character for character from the file's own text. A document type goes live only when it returns every expected value on every sample you gave it. And when a value isn't in a document, its field comes back empty instead of guessed. ### How do I get specific fields out of a PDF as JSON? Create a document type in the app: upload 1 to 5 samples, check the fields and values AI suggests, and let AI set up the extraction. Once it returns every value on every sample, POST any document of that kind to /v1/document-types/{id}/extract and get the fields back as JSON. ### Is there a free plan? Yes. The Free plan includes 100 documents a month, 2 document types and 10 AI setup runs a month, with no credit card and no time limit. ### Does it read Hebrew, Arabic and other languages? Yes, every language. Right-to-left text such as Hebrew, Arabic, Persian and Urdu comes back in the order people read it, with no setting to turn on. Complex scripts such as Hindi, Bengali, Tamil, Thai, Chinese, Japanese and Korean are read as written. ### What counts as a document? One file read through the API or uploaded in the app, whatever its page count. A 40-page PDF is one document. Trying a document type on a file in the app counts too. Refused or failed files are not counted. ### What is an AI setup run? One press of Suggest fields or Build while you set up or change a document type, however many rounds AI takes inside it. Extracting documents afterwards uses no AI runs. ### When do my limits start again? On the first day of each calendar month, at midnight UTC, on every plan. ### What happens when I reach my documents for the month? Further calls are answered with status 429 and the date your documents start again. Nothing extra is charged. Upgrade at any time to continue straight away. ### What happens if I run out of AI setup runs? Document types that are already live keep working. Setting up new ones or changing existing ones waits until the next month, or until you upgrade. ### How do I pay, and can I cancel? By card through Paddle, billed monthly. You can change your card or cancel anytime from the app, and your plan stays until the end of the month you paid for. ### Can I switch between Starter and Pro? Yes, anytime from the app. The change is prorated, so you pay only the difference for the rest of the month. ### What does priority mean on Pro? When many calls arrive at once, calls from Pro accounts are processed first, and Pro support requests are answered first. ### Is AI used on my documents? Only while you set up or change a document type, on the samples you upload for it. Extracting documents afterwards runs without AI.