Errors#

Response Format#

Success Response#

On success, the API returns a JSON object with the image URL or base64 data:

{
  "id": "abc123",
  "url": "https://api.htmlpix.com/images/abc123.png",
  "imageKey": "abc123.png"
}

Or with responseFormat: "base64":

{
  "id": "abc123",
  "base64": "iVBORw0K...",
  "mimeType": "image/png"
}

Error Response#

On error, the API returns a JSON object:

{
  "code": "QUOTA_EXCEEDED",
  "message": "Monthly quota of 1000 renders exceeded"
}

Error Codes#

HTTP StatusCodeDescription
400INVALID_BODYRequest body is not valid JSON
400MISSING_INPUTEither html or url field is required
400CONFLICTING_INPUTCannot specify both html and url
400HTML_TOO_LARGEHTML exceeds maximum size (500KB)
400CSS_TOO_LARGECSS exceeds maximum size (200KB)
400URL_TOO_LONGURL exceeds maximum length (2048 chars)
400INVALID_URLURL is not valid
400INVALID_URL_PROTOCOLURL must use http or https
400SELECTOR_TOO_LONGCSS selector exceeds max length
401MISSING_KEYAuthorization header missing
401INVALID_KEYAPI key is invalid
401KEY_INACTIVEAPI key has been revoked
402SUBSCRIPTION_INACTIVESubscription has expired
429QUOTA_EXCEEDEDMonthly render quota exceeded
500RENDER_ERRORFailed to render the HTML
500SELECTOR_NOT_FOUNDThe specified CSS selector was not found
500RENDER_TIMEOUTRender timed out
503NOT_READYService is starting up