> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vizlook.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Codes

> Reference for common error codes used by the Vizlook API.

While interacting with the Vizlook API, you might encounter various HTTP status codes. These errors pinpoint issues with your request, enabling quick problem diagnosis. Below, you'll find a resource detailing common HTTP errors and their resolutions.

<Info>
  Feel free to contact us at <a href="mailto:support@vizlook.com" target="_blank">[support@vizlook.com](mailto:support@vizlook.com)</a> if you have any problems.
</Info>

## API Errors

| HTTP Status Code                       | Overview                                                                                                                                                                                                                                                                          |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **400** - Bad Request                  | **Cause:** This error occurs when the request parameters are incorrect or invalid.<br />**Solution:**<br /><ul class="no-margin"><li>Check that all required parameters are included in the request.</li><li>Verify that the values provided match the expected format.</li></ul> |
| **401** - Unauthorized                 | **Cause:** This error occurs when the API key is missing or incorrect.<br />**Solution:**<br /><ul class="no-margin"><li>Ensure that you have included a valid API key in your request.</li><li>Ensure proper authentication headers.</li></ul>                                   |
| **429** - Too Many Requests            | **Cause:** Rate limit exceeded.<br />**Solution:**<br /><ul><li>Check the <a href="/documentation/rate-limits">Rate Limits</a> page for current limits.</li><li>Implement rate limiting or exponential backoff in your application.</li></ul>                                     |
| **432** - Pay-As-You-Go Limit Exceeded | **Cause:** Your request exceeds your current pay-as-you-go usage limit.<br />**Solution:** Increase your limit via the <a href="https://www.vizlook.com/dashboard/billing" target="_blank">Vizlook dashboard</a>.                                                                 |
| **500** - Internal Server Error        | **Cause:** This error indicates an issue on Vizlook’s servers.<br />**Solution:** Retry the request after a few minutes and contact <a href="mailto:support@vizlook.com" target="_blank">[support@vizlook.com](mailto:support@vizlook.com)</a> if the issue persists.             |

## Error Response Structure

All error responses include a `error` message:

```json theme={null}
{
  "error": "Unauthorized: API key is missing."
}
```

## Crawl Error Type for `/videos`

For the `/videos` endpoint, in addition to using HTTP status codes to indicate errors, we also use a `status` field to display specific error information for each video. This design facilitates more precise error management when retrieving multiple URLs.

```json theme={null}
{
  "results": [
    {
      "data": {...},
      "status": {
        "url": "https://www.youtube.com/watch?v=xxx",
        "status": "Success"
      }
    },
    {
      "status": {
        "url": "https://www.youtube.com/watch?v=xxx",
        "status": "Fail",
        "error": {
          "type": "CRAWL_NOT_FOUND"
        }
      }
    }
  ]
}
```

| Error Type                           | Overview                                                                                                                                                                               |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `FAILED_TO_PARSE_URL`                | The URL is not supported, or the URL is incorrect. Check if the URL is supported by Vizlook and if the URL format is correct.                                                          |
| `CACHE_NOT_FOUND`                    | This video does not exist in our database. If you need real-time crawling, please set the `crawlMode` parameter to `Fallback` or `Always`.                                             |
| `CRAWL_SOURCE_FAIL`                  | Failed to retrieve video content from the URL. Check if the video content is existern, or retry the request after a few minutes.                                                       |
| `CRAWL_NOT_FOUND`                    | The video content at the given URL does not exist. Check if the video content exists.                                                                                                  |
| `CRAWL_VIDEO_DURATION_EXCEEDS_LIMIT` | The video length exceeded the maximum length that the platform can crawl.                                                                                                              |
| `CRAWL_TIMEOUT`                      | Request timed out while fetching content. Retry the request. The current timeout is 3 minutes.                                                                                         |
| `CRAWL_SERVER_ERROR`                 | Other crawling errors. Retry the request and contact <a href="mailto:support@vizlook.com" target="_blank">[support@vizlook.com](mailto:support@vizlook.com)</a> if the issue persists. |

## Best Practices to Avoid Errors

* Always validate request parameters before sending.
* Monitor your API usage to avoid exceeding limits.
* Implement error handling and retries in your application.
