Errors and how to handle them
Every error code the API returns, what it means, and whether to retry.
Written By Carmine Cella
Last updated About 3 hours ago
Errors come back as JSON with a stable code and a human-readable message:
{ "code": "INSUFFICIENT_CREDITS", "message": "Not enough credits to run this task" }Codes
Failures that are not HTTP errors
A task can answer 200 and still have status: failed. The fetch ran, the target did not cooperate. Read blocked, status_code and error in the result:
blocked: truemeans the target refused the request. The task is refunded. Retry withjs_rendering: trueor a Premium proxy.blocked: falsewithstatus: failedis usually a timeout or a proxy error. Retry once with a newIdempotency-Key. If it fails again, switch engine or proxy plan.
Read the result envelope covers every field.
Timeouts on your side
POST /task and POST /map hold the connection until the result is ready. Set your client timeout to 120 seconds or more; browser and AI workloads can take longer. If the connection drops, resend with the same Idempotency-Key to pick up the running task instead of starting a new one.
Repeated 5xx or timeouts from the API itself
If the API, not a target site, keeps answering 5xx or timing out, check status.datafuel.ai before retrying in a loop. GET /api/v1/healthz?deep=1 answers 503 while a dependency is down. Neither needs a key. See Service status and health.