Skip to main content
This page provides a comprehensive reference for understanding and handling errors across the Captain Data API.

Quick Reference Table


Error Response Structure

The API uses a consistent error response format across all endpoints. When an error occurs, you’ll receive a response with the following structure:
Each error response includes:
  • error_label: A machine-readable identifier for the error type
  • error_scope: Indicates which part of the request caused the error (e.g., “input”, “auth”, “server”)
  • error_ref: A unique reference code for tracking and debugging
  • message: A human-readable description of the error
  • status_code: The HTTP status code
  • params: Additional error parameters (if any)

Understanding Error Scopes

Every error response includes an error_scope field that indicates what caused the error:

Handling Rate Limit Errors (429)

When you exceed rate limits, you’ll receive a 429 Too Many Requests response. Use the Retry-After header to know when to retry. Example Implementation:
For detailed rate limit information by plan tier, see our Rate Limits documentation.

Error Categories

Input & Validation Errors (400)

These errors occur when your request contains invalid data. Do not retry — fix the input first.
Description: The input data is invalid or incorrectly formatted.Common Causes:
  • Invalid URL format
  • Missing required identifiers
  • Malformed query parameters
Resolution: Check the message field for details, then verify your input against the endpoint’s documentation.
Description: One or more parameters in the request are invalid.Common Causes:
  • Parameter value out of allowed range
  • Incompatible parameter combinations
  • Wrong data type for a parameter
Resolution: Review parameter constraints in the endpoint documentation.

Authentication & Access Errors (401, 403)

These errors indicate permission or authentication issues.
Description: Your API key is invalid or missing.Common Causes:
  • Missing X-API-Key header
  • Invalid or expired API key
  • Typo in the API key
Resolution: Verify your API key in Developer Settings.
Description: You don’t have access to this resource.Common Causes:
  • Insufficient plan permissions
  • Resource restricted to specific accounts
Resolution: Check your subscription plan includes access to this endpoint.

Not Found Errors (404)

These errors indicate the requested resource doesn’t exist.
Description: The resource you requested doesn’t exist or is no longer available.Common Causes:
  • Profile has been deleted or deactivated
  • Company page no longer exists
  • Invalid identifier (typo in URL or ID)
Resolution: Verify the resource URL/ID is correct. If valid, the resource may have been removed — no retry needed.
Description: The query returned no results.Common Causes:
  • Search criteria too narrow
  • No matching data found
Resolution: Treat as an empty result set. Consider broadening your search criteria.

Server Errors (500, 503)

These errors indicate something went wrong on our end.
Description: An unexpected server error occurred.Resolution: Retry with exponential backoff. If persistent, contact support@captaindata.com with the error_ref value.
Description: The service is temporarily unavailable.Resolution: Wait a few minutes and retry. This is typically a transient issue.

Best Practices

  1. Always check error_label: Use this field to programmatically handle different error types.
  2. Log the error_ref: This unique reference helps our support team investigate issues quickly.
  3. Implement exponential backoff: For retryable errors (429, 500, 503), wait progressively longer between retries.
  4. Don’t retry input errors: 400-level errors (except 429) require fixing your request, not retrying.
If you encounter persistent errors or need help debugging, contact support@captaindata.com with the error_ref from your error response.