# 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. ScraperAPI will retry failed requests for up to 7**0 seconds** to try and get a successful response from the target URL before responding with a `500` error indicating a failed request.

{% hint style="danger" %}
***Note:** To avoid timing out your request before the API has had a chance to complete all retries, remember to set your timeout to 7**0 seconds**.*
{% endhint %}

If a request fails after **70 seconds** of retrying, you will not be charged for it (you are only charged for successful requests, `200` and `404` status codes).

Errors can occasionally occur, so it's important to ensure your code handles them appropriately. Configuring your system to retry failed requests often leads to success. If you find that a request is persistently failing, double-check your request configuration to ensure it’s correct. If you’re repeatedly encountering anti-bot bans, please [contact our support team](https://dashboard.scraperapi.com/contact-support) and they will try to find a solution to bypass the restrictions.

If you receive a successful `200` status code response from the API but the response contains a CAPTCHA, please [contact our support team](https://dashboard.scraperapi.com/contact-support) and they will add it to our CAPTCHA detection database. Once included in our CAPTCHA database, the API will treat it as a ban in the future and will automatically retry the request.

Below are some of the possible status codes you are likely to encounter:

{% tabs %}
{% tab title="200" %}
{% hint style="success" %}
Successful Response
{% endhint %}
{% endtab %}

{% tab title="500" %}
{% hint style="danger" %}
*Request failed. You will not be charged for this request. Please make sure your URL is correct and try again. Protected domains may require adding premium=true OR ultra\_premium=true parameter to your request.*
{% endhint %}
{% endtab %}

{% tab title="404" %}
{% hint style="danger" %}
Requested page does not exist.
{% endhint %}
{% endtab %}

{% tab title="429" %}
{% hint style="warning" %}
*You are sending too many simultaneous requests. Ensure your concurrency rate is according to the limit of your scraping plan and try again.*
{% endhint %}
{% endtab %}

{% tab title="400" %}
{% hint style="warning" %}
*Error, malformed request. Make sure your URL is typed correctly. If you believe you are receiving this message in error, please try the request again or contact <support@scraperapi.com>.*
{% endhint %}
{% endtab %}

{% tab title="403" %}
{% hint style="warning" %}
*You have exhausted the API Credits available in this monthly cycle. You can upgrade your subscription or enable overages from your dashboard (<https://dashboard.scraperapi.com/billing>). For custom plan upgrades, please contact support (<https://www.scraperapi.com/support/>).*
{% endhint %}
{% endtab %}

{% tab title="401" %}
{% hint style="warning" %}
*Unauthorized request, please make sure your API key is valid.*
{% endhint %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scraperapi.com/responses-and-formats/api-status-codes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
