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

# API Status Codes

The API will return a specific status code after every request depending on whether the request was successful, failed or some other error occurred.

<Warning>To avoid timing out your request remember to set your timeout to 300 seconds.</Warning>

In cases where a request fails after 300 seconds, you will not be charged for the unsuccessful request. You are only charged for successful requests. We are considering successful requests that have 200 status code & `status: "ok"` in the response JSON.

A successful request means we reached the target site and got a definitive answer from it. An empty answer is still an answer: a search that matches nothing comes back as a 200 with an empty result set. When the target reports that the requested item does not exist, such as an account, a listing or a page nobody has, the response is also a 200 with `status: "ok"`. Its body then carries `requestMetadata` and an `error` message describing the reason, and no data object. Treat an `error` together with a missing data object as "this item does not exist" and do not retry. Both kinds of request are charged, because the scrape itself succeeded.

## Status Codes

| Code | Details |
| - | - |
| 200 | Successful response. The body carries the data, an empty result set when nothing matched, or an `error` message when the target reports that the requested item does not exist. |
| 400 | The request failed: we could not get a usable response from the target after our retries. Not charged. Retry it, and contact support if it keeps failing. |
| 401 | Invalid API key. |
| 403 | You have used up all your API credits. |
| 404 | The API endpoint you called does not exist. Check the request path. This code is only about our API, never about the page you asked us to scrape. |
| 422 | Request validation failed. The body lists the parameters that were rejected and why. |
| 429 | You are sending requests too fast, and exceeding your concurrency limit. |
| 500 | HasData server error. If you received 500 status code retry request, if the problem is not solved contact our support. |

## Handling Occasional Errors

In rare cases (1–2% of requests), especially on harder-to-scrape websites, a request might fail due to temporary issues on the target site.

* **Automatic Retry**: Set up your code to retry failed requests. Most of the time, a retry will succeed.
* **Consistent Failures**: If a request keeps failing, double-check your parameters and request structure.
* **Persistent Failures**: If requests to a particular target keep failing, open a support ticket and we'll investigate.

These situations are uncommon, but it’s a good idea to handle errors gracefully to ensure smooth data collection.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.