Image extraction API for websites and documents
Create asynchronous extraction jobs for public URLs, PDF, DOCX, and PPTX files. Read image metadata and prepare downloads with the ImageExtract API.
An asynchronous workflow
Create a job, retain its ID, and inspect status until completion. Read the results and request an export when you need a packaged download. A created job is not yet a completed extraction.
One integration, several source types
Submit public webpage URLs or upload supported PDF, DOCX, and PPTX documents. Results can include dimensions, format, file size, and source information where available. Unsupported or private sources may fail.
Credits and API access
API access requires an eligible account plan and project key. Source types use different credit amounts, and concurrency and file limits depend on the plan. The pricing page and API contract describe the current rules.
Design for retries and expiry
Use the documented idempotency behavior, bound polling time, and handle failed sources explicitly. Downloads can expire. Keep keys server-side and verify signatures when using webhook integrations.
API examples
Use a project key with API access. Replace the sample source URL with a public page you are permitted to process. Keep the key in your server environment.
JavaScript: extraction through download
const baseUrl = 'https://imageextract.com'
const apiKey = process.env.IMAGEEXTRACT_API_KEY
async function request(path, options = {}) {
const response = await fetch(baseUrl + path, {
signal: AbortSignal.timeout(30000),
...options,
headers: {
Authorization: `Bearer ${apiKey}`,
...(options.headers ?? {}),
},
})
if (!response.ok) throw new Error(await response.text())
return response
}
async function sleep(ms) {
await new Promise((resolve) => setTimeout(resolve, ms))
}
const create = await request('/api/v1/jobs', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({ type: 'url', input: 'https://example.com' }),
}).then((response) => response.json())
const jobDeadline = Date.now() + 5 * 60 * 1000
let job
do {
if (Date.now() > jobDeadline) throw new Error("Wait timed out; check the existing job_id before creating another job")
await sleep(3000)
job = await request(`/api/v1/jobs/${create.job_id}`).then((response) => response.json())
} while (job.status === 'queued' || job.status === 'processing' || job.status === 'pending')
if (job.status !== 'done') throw new Error(job.error ?? 'Extraction failed')
const result = await request(`/api/v1/jobs/${create.job_id}/result`).then((response) => response.json())
const createdExport = await request(`/api/v1/jobs/${create.job_id}/exports`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ template: 'zip' }),
}).then((response) => response.json())
const exportDeadline = Date.now() + 5 * 60 * 1000
let exportStatus = createdExport
while (exportStatus.status === 'queued' || exportStatus.status === 'processing') {
if (Date.now() > exportDeadline) throw new Error("Export wait timed out; check the existing export ID")
await sleep(3000)
exportStatus = await request(`/api/v1/jobs/${create.job_id}/exports/${createdExport.id}`).then((response) => response.json())
}
if (exportStatus.status !== 'done') throw new Error(exportStatus.error ?? 'Export failed')
const zip = await request(`/api/v1/jobs/${create.job_id}/exports/${createdExport.id}/download`)
console.log({ images: result.image_count, expires_at: exportStatus.expires_at, bytes: Number(zip.headers.get('content-length') ?? 0) })Python: create a job
import json, os, urllib.request
request = urllib.request.Request(
"https://imageextract.com/api/v1/jobs",
data=json.dumps({"type": "url", "input": "https://example.com"}).encode(),
headers={
"Authorization": "Bearer " + os.environ["IMAGEEXTRACT_API_KEY"],
"Content-Type": "application/json",
},
method="POST",
)
with urllib.request.urlopen(request, timeout=30) as response:
job = json.load(response)
print(job["job_id"])The Python example creates a job only. Keep its ID and follow the reference to poll status, retrieve results, and prepare an export. Handle HTTP errors and a bounded waiting period in production.