Error Handling

Complete reference for all error types and how to handle them.

When an error occurs, the API returns a JSON response with success: false, a human-readable error message, and a machine-readable error_type. All failed requests are automatically refunded.

json
{
"success": false,
"error": "Could not extract content from this page",
"error_type": "EMPTY_CONTENT"
}

Authentication Errors

StatusTypeMessage
401AUTH_ERRORMissing, invalid, or deactivated API key
402CREDITS_EXHAUSTEDInsufficient credits or per-key limit reached
429RATE_LIMITEDRate limit exceeded (120 requests per minute)

Validation Errors

StatusTypeMessage
400VALIDATION_ERRORInvalid request parameters (missing url, invalid type, etc.)

Network Errors

StatusTypeMessage
502CONNECTION_ERRORFailed to connect to the target URL
504CONNECTION_TIMEOUTConnection to target URL timed out
504READ_TIMEOUTTarget server took too long to respond
502TOO_MANY_REDIRECTSToo many redirects on the target URL
502HTTP_ERRORTarget server returned an error

Content Errors

StatusTypeMessage
422EMPTY_CONTENTCould not extract content from this page
504PAGE_TIMEOUTPage took too long to load
502PAGE_LOAD_FAILEDFailed to load page content

YouTube Errors

These errors are specific to the Transcript API.

StatusTypeMessage
422TRANSCRIPT_UNAVAILABLETranscript is not available for this video
422VIDEO_UNAVAILABLEThis video is unavailable or private
429RATE_LIMITEDRate limited by the target service

Internal Errors

StatusTypeMessage
500INTERNAL_ERRORAn unexpected error occurred. Contact support if persistent.

Handling Errors

  • Always check the success field before processing results.
  • Use error_type for programmatic error handling, not the error message.
  • All failed requests are automatically refunded. No credits are charged.
  • For CONNECTION_ERROR and PAGE_TIMEOUT, consider retrying with a delay.
  • For RATE_LIMITED, wait before retrying.
  • For CREDITS_EXHAUSTED, purchase more credits at pay.bikal.co.