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

# IP Address Blocked or Connection Refused/Aborted

> Resolve IP address blocked and connection refused errors in ZenRows by adjusting rate limits, request patterns, and proxy configuration.

ZenRows has protective measures in place to safeguard the infrastructure from abusive behavior and malformed traffic. If too many faulty requests are made in a short period, our system will temporarily block your IP address to maintain service reliability and fairness for all users.

When a block is triggered, you may encounter one of the following errors:

* `BLK0001 IP Address Blocked`
* `Connection Refused/Aborted`
* `RemoteDisconnected('Remote end closed connection without response')`
* `ECONNRESET`

Understanding why your IP was blocked, and how to avoid it, is key to keeping your scraping processes stable and efficient.

**To resolve the issue, check the error code and error body from your previous request. These details will help you identify the cause of the block.**

## What Triggers an IP Block?

Faulty requests are the cause of an IP block. These include:

* Invalid or missing parameters
* Unauthorized or unverified access
* Requests to unsupported or blocked domains
* Too many concurrent requests beyond plan limits

Here are specific error types that can trigger a temporary IP block:

| **HTTP Code** | **Error Codes**                                      | **Description**                    |
| ------------- | ---------------------------------------------------- | ---------------------------------- |
| 400           | REQS001, REQS002, REQS004, RESP004, REQS006, RESP008 | Malformed or incomplete requests   |
| 401           | AUTH001, AUTH002, AUTH003                            | Missing or invalid API key         |
| 403           | AUTH009                                              | Unverified account access          |
| 405           | REQS005                                              | Unsupported HTTP method            |
| 419           | AUTH006, AUTH008                                     | Concurrency or rate limit exceeded |

## Common Errors and How to Resolve Them

Below are the most common reasons for blocks and their solutions:

### 400 Bad Request

#### REQS001 Requests to This Domain Are Forbidden

ZenRows proactively blocks scraping attempts to certain domains to comply with legal, ethical, or technical guidelines.

**Solution:** <br />Check the [Forbidden Domains Documentation Page](/forbidden-sites) for more details and avoid targeting these domains.

<Tip>If you believe a domain should be whitelisted, feel free to contact support at [success@zenrows.com](mailto:success@zenrows.com)</Tip>

#### REQS002 Request Requirements Unsatisfied

Some domains require the `js_render` and/or `premium_proxy` features to be active to bypass protections such as JavaScript-based content or regional blocks.

**Solution:** <br />Check the error body for details on which feature is needed and retry your request with them applied:

<CodeGroup>
  ```python Python theme={null}
  params = {
      'url': url,
      'apikey': apikey,
  	'js_render': 'true',
  	'premium_proxy': 'true',
  }
  ```

  ```javascript Node.js theme={null}
  params: {
      'url': url,
      'apikey': apikey,
      'js_render': 'true',
      'premium_proxy': 'true',
  },
  ```

  ```bash cURL theme={null}
  curl "<...>&js_render=true&premium_proxy=true"
  ```
</CodeGroup>

#### REQS004 Invalid Params Provided

One or more parameters in your request are unrecognized or incorrectly formatted.

**Solution:**

* Double-check all query parameters
* Ensure URLs are properly encoded
* Refer to the [API Reference](/universal-scraper-api/api-reference#parameter-overview) for supported parameters

#### RESP004 CSS Extractor Parameter is Not Valid

The `css_extractor` parameter is malformed.

**Solution:**

* Review your selector and consult the [CSS Selectors Documentation](/universal-scraper-api/features/css-extractor).

#### REQS006 Invalid CAPTCHA Solver Key

An incorrect or missing key for 2Captcha was configured on the [Integration Page](https://app.zenrows.com/account/integrations).

**Solution:** <br />Before using the `solve_captcha` JavaScript Instructions verify that the correct CAPTCHA solver key is entered in your account.

<Warning>Leaving the 2Captcha API key empty on the integration page and attempting to use the `solve_captcha` instruction will also result in errors and an IP block.</Warning>

#### RESP008 Non-Retryable Error not Related to ZenRows

This error indicates a domain-specific issue (e.g., configuration or certificate problems).

**Solution:**

* Review the full error message. These errors usually cannot be resolved by modifying the API request.

### 401 Unauthorized Errors

#### AUTH001 / AUTH002 / AUTH003 – API Key Issues

Common when:

* API key is missing
* API key is invalid or deleted

**Solution:** <br />Retrieve or regenerate your API key from the [Settings Page](https://app.zenrows.com/account/settings) and update your requests accordingly.

### 403 Forbidden

#### AUTH009 User is Not Verified

Your account email must be verified to access the API.

**Solution:** <br />Check your inbox for a verification link. Didn't receive it? Contact [success@zenrows.com](mailto:success@zenrows.com).

### 405 Method Not Allowed

#### REQS005 Method Not Allowed

ZenRows only supports `GET`, `POST`, and `PUT`.

**Solution:** <br />Avoid using unsupported methods like `DELETE` or `PATCH`.

<Tip>If you're unsure which method to use, default to `GET`.</Tip>

### 419 Too Many Requests

#### AUTH006 Concurrency Exceeded

You're making more simultaneous requests than your plan allows.

**Solution:**

* Implement a queue system in your code to limit concurrent requests.
* Monitor the `Concurrency-Remaining` response header to adjust your request rate dynamically.

<Warning>Cancelling requests (e.g., `CTX0001 Context Cancelled`) does not release concurrency immediately. ZenRows requests can take up to 3 minutes to complete, and cancelling them prematurely may still impact your concurrency limits, potentially resulting in blocks.</Warning>

For more details, see the [Concurrency Documentation](/universal-scraper-api/features/concurrency)

#### AUTH008 Rate Limit Exceeded

Similar to the concurrency error, this occurs when you exceed your rate limit. Monitor the `Concurrency-Remaining` response header and adjust your request rate to avoid blocks and apply the suggested solutions.

## Best Practices to Avoid IP Blocks

1. Validate your requests before sending them
2. Use error handling to detect and stop faulty retries
3. Limit concurrency based on your subscription tier
4. Monitor the `Concurrency-Remaining` response header
5. Use `js_render` and `premium_proxy` when necessary
6. Avoid retrying on 400 and 401 errors as they are not recoverable by retries
7. Remove any timeout from your script to avoid cancelling your request prematurely causing issues on your concurrency

## Frequently Asked Questions (FAQ)

<Accordion title="How long does the IP block last?">
  IP blocks expire after 5 minutes.
</Accordion>

<Accordion title="Can I get my IP unblocked faster?">
  No. Blocks are automatic and expire on their own. If your IP is blocked frequently, review your request patterns and error codes.
</Accordion>

<Accordion title="Will using premium_proxy prevent IP blocks?">
  `premium_proxy` helps with access to protected websites but won't prevent IP blocks due to malformed or unauthorized requests. Always validate your inputs.
</Accordion>

<Accordion title="What should I do if I keep getting Connection Refused?">
  This usually indicates your IP is currently blocked. Wait 5 minutes, then retry after fixing any errors in your previous request.
</Accordion>

<Accordion title="What happens if I keep sending requests when my IP is blocked?">
  Nothing. The requests will be ignored.
</Accordion>
