dOCR
Guides

Batch extraction

Process many documents efficiently.

To extract many documents, call POST /api/v1/extract once per file — concurrently from your backend. Each call is independent and returns its own extraction.

JavaScript
async function extractAll(files: File[]) {
  return Promise.all(
    files.map((file) => {
      const form = new FormData();
      form.set("file", file, file.name);
      return fetch("https://app.docr.dev/api/v1/extract", {
        method: "POST",
        headers: { Authorization: `Bearer ${process.env.DOCR_API_KEY}` },
        body: form,
      }).then((r) => r.json());
    }),
  );
}

To keep results organized, store each returned extraction id against your own record. To be notified as each finishes instead of awaiting inline, use webhooks.

Respect your plan's rate limits when fanning out. If you hit a limit, back off and retry. See Billing & limits.