Extract
Extract batch
Up to 1,000 URLs as one job, with results you poll for or a webhook when it ends.
Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)
POST https://api.millionshort.com/v1/extract/batch
GET https://api.millionshort.com/v1/extract/batch/{id}
DELETE https://api.millionshort.com/v1/extract/batch/{id}The same extraction as POST /v1/extract, for up to 1,000 URLs, run as a job.
Submit
The body is the Extract request, with two differences: urls takes 1 to 1,000 entries, and there is one more field.
| Field | Type | Default | Notes |
|---|---|---|---|
urls | array of strings, 1 to 1,000, distinct | Required | |
mode | auto, cached, live, rendered, unblock, stealth | "auto" | As for Extract |
max_age_hours | integer, 0 to 8,760 | 168 | As for Extract |
formats | array of markdown, text, links, metadata | ["markdown","metadata"] | As for Extract |
max_chars | integer, 1 to 500,000 | 50000 | As for Extract |
webhook_id | string | An active webhook endpoint of your team. Optional | |
topics, page_types, source_hints | arrays of slugs | Keep only the pages with these labels. Optional |
curl https://api.millionshort.com/v1/extract/batch \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: nightly-2026-11-18" \
-d '{
"urls": ["https://example.com/a", "https://example.com/b"],
"mode": "live"
}'import os
import requests
r = requests.post(
"https://api.millionshort.com/v1/extract/batch",
headers={
"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"],
"Idempotency-Key": "nightly-2026-11-18",
},
json={
"urls": [
"https://example.com/a",
"https://example.com/b"
],
"mode": "live"
},
timeout=30,
)
r.raise_for_status()
print(r.json()["data"])const res = await fetch('https://api.millionshort.com/v1/extract/batch', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'nightly-2026-11-18',
},
body: JSON.stringify({
"urls": [
"https://example.com/a",
"https://example.com/b"
],
"mode": "live"
}),
});
if (!res.ok) throw new Error(`POST /v1/extract/batch failed: ${res.status}`);
const { data } = (await res.json()) as { data: unknown };
console.log(data);- An
Idempotency-Keyheader is honoured for 24 hours: sending the same submit twice starts one batch. - Submit holds the price of the whole batch at the mode asked for. A team that cannot cover it gets
429 INSUFFICIENT_CREDITSand nothing starts. - A team may have 5 batches open at once.
The answer is the job, with status: "queued".
Poll
curl https://api.millionshort.com/v1/extract/batch/$BATCH_ID \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY"import os
import requests
r = requests.get(
f"https://api.millionshort.com/v1/extract/batch/{os.environ['BATCH_ID']}",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
timeout=30,
)
r.raise_for_status()
print(r.json()["data"])const res = await fetch(`https://api.millionshort.com/v1/extract/batch/${process.env.BATCH_ID}`, {
headers: { Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}` },
});
if (!res.ok) throw new Error(`GET /v1/extract/batch/… failed: ${res.status}`);
const { data } = (await res.json()) as { data: unknown };
console.log(data);| Field | Type | Notes |
|---|---|---|
id | string | |
status | queued, running, completed, cancelled, failed | |
total | integer | URLs in the batch |
completed | integer | URLs done so far, succeeded or failed |
failed | integer | URLs that failed |
results | array | Extract results, up to 50 at a time |
next | string or null | Pass as ?cursor= to get the next page of results; null at the end |
Polling is free and does not count against the plan's requests a minute. It has its own limit of 120 a minute per team. Results are kept for 7 days.
Cancel
curl -X DELETE https://api.millionshort.com/v1/extract/batch/$BATCH_ID \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY"import os
import requests
r = requests.delete(
f"https://api.millionshort.com/v1/extract/batch/{os.environ['BATCH_ID']}",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
timeout=30,
)
r.raise_for_status()
print(r.json()["data"])const res = await fetch(`https://api.millionshort.com/v1/extract/batch/${process.env.BATCH_ID}`, {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}` },
});
if (!res.ok) throw new Error(`DELETE /v1/extract/batch/… failed: ${res.status}`);
const { data } = (await res.json()) as { data: unknown };
console.log(data);Work that has finished is charged; what is left of the hold is handed back.
How a batch runs
- Every result carries its
topic,page_type,source_hintandlabel_confidence, as for Extract. Withtopics,page_typesorsource_hints, a page that does not pass counts ascompleted, hasfiltered: trueand no content, and is charged for its fetch. A batch has nosummaryand no warnings: count the entries withfiltered: true. A page whose labels could not be made is kept, withnulllabels. For a large crawl list this is how to keep, say, only the articles about health and skip reading the rest.
- Finished pages are charged as they finish, at the price of the mode actually used. The rest of the hold is handed back when the batch ends.
- Batch work waits for a busy site; it does not fail with
HOST_BUSYat once. A page whose site is busy for us waits its turn, at no cost to it, for as long as the batch has been running for less than 60 minutes. After that, a page that meets the busy site five more times fails asHOST_BUSY, free. A batch on one site is slow on purpose: one page a second for all customers together, and at most half of that for one team, so 1,000 pages of one site take about 35 minutes. Several batches of the same site share that pace, so run them one after the other. Batch work also gives way to synchronous Extract calls. - A
cachedbatch never fails a page because of the pace of our own lookups: stored copies are looked up at about 60 a minute per team, and the batch waits for them. A batch of 500 takes about eight minutes. - A page that cannot be fetched yet for another reason (a
robots.txtthat could not be read, for example) is tried again later in the batch, five times in all. - The daily limit per site holds for batches as for single calls.
- A batch that has not ended 24 hours after submit becomes
failed, and what is left of its hold is handed back. - With
webhook_id, anextract_batch.completedevent is delivered when the batch ends, carryingid,status,total,completedandfailed.
Errors
400 INVALID_PARAM (also for a webhook_id that is not an active endpoint of the team), 400 UNSUPPORTED_OPTION, 401 for a missing or refused key, 404 JOB_NOT_FOUND for a batch that does not exist or is not yours, 429 INSUFFICIENT_CREDITS and 429 RATE_LIMITED. Per-URL errors are the ones on the Extract page.