Errors

Standard error codes and responses from the Price Hero API.

All Price Hero API errors return a consistent JSON response with an error code and a human-readable message.

Error response format

{
  "error": "error_code",
  "message": "A description of what went wrong."
}

HTTP status codes

StatusError codeMeaning
400bad_requestMissing or invalid request body / parameters
401unauthorizedMissing, invalid, or revoked API key
402insufficient_creditsNot enough credits to complete the request
404not_foundRequested resource (e.g. catalog item) does not exist
413payload_too_largeImage or request body exceeds size limit
422unprocessableRequest was understood but couldn't be processed (e.g. unreadable image)
429rate_limitedToo many requests — back off and retry
500internal_errorSomething went wrong on our end

Retrying requests

We recommend exponential backoff for 429 and 5xx errors:

async function requestWithRetry(url: string, options: RequestInit, retries = 3) {
  for (let i = 0; i < retries; i++) {
    const res = await fetch(url, options);
    if (res.status !== 429 && res.status < 500) return res;
    await new Promise((r) => setTimeout(r, Math.pow(2, i) * 200));
  }
  throw new Error("Max retries exceeded");
}

Common issues

401 unauthorized — Double-check that your key is correct and hasn't been revoked. Make sure you're sending the Authorization: Bearer <key> header.

402 insufficient_credits — Top up your balance in the Developer Dashboard.

422 unprocessable on vision — The image couldn't be analyzed. Ensure the image is clear, well-lit, and shows the item distinctly. Supported formats: JPEG, PNG, WebP.

Errors — Price Hero Docs