> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/proxies/residential-proxies/whitelisting-ips.md).

# Whitelisting IPs

IP whitelisting allows you to access our Residential Proxy pool by simply connecting via whitelisted IPs.&#x20;

{% hint style="info" %}
You can only add IPs that are in IPv4 format (xx.xx.xx.xx). Make sure that the IP you are adding is yours and you are **not using a Proxy or VPN service** at the time.
{% endhint %}

## Create an IP whitelist

To whitelist IP addresses log in to the [**dashboard**](https://dashboard.oxylabs.io/), on the left hand side select **Residential Proxies** → **Whitelist**, click on **Edit whitelist**. Enter **up to 10 IPs** in text format and click Submit.

{% hint style="info" %}
If it’s important to distinguish traffic statistics among proxy users, we recommend not using the whitelisted IPs functionality, especially when the same public IP might be shared among service users (teams, departments, etc.).&#x20;

**Note:** If using a browser or headless browser, it will attempt to use the proxy without regular auth and will only send auth if it receives a `407`.
{% endhint %}

If you want to remove or update the list, edit it as a text document and click **Submit**. If you need more IPs, please get in touch with our customer support team at [**support@oxylabs.io**](mailto:support@oxylabs.io) or via the 24/7 live chat on our [**website**](https://oxylabs.io/) or your Oxylabs dashboard. IP whitelisting allows you to access our Residential Proxy pool by simply connecting via whitelisted IPs.

## Requests with Whitelisted IPs

With Whitelisted IPs, you can access Oxylabs Residential Proxies **without needing to provide a `username` and `password`**. By whitelisting your IP address, you can specify all your proxy parameters **directly in the subdomain.**&#x20;

If you add an IP to the whitelist, you should connect using **either the whitelisted IP or credentials**, but not both, as doing so can lead to unexpected behavior.

### Code example&#x20;

Here's an example code targeting New York City with a given session ID:&#x20;

{% tabs %}
{% tab title="cURL" %}

```shell
curl -x https://cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io:7777 https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$session_id = 'test123';  // Your session ID
$city = 'new_york';  // The city you want to target
$proxy = "cc-us-city-$city-sessid-$session_id.bc.pr.oxylabs.io:7777";
$query = curl_init('https://ip.oxylabs.io/location');

curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
$output = curl_exec($query);
curl_close($query);

if ($output)
    echo $output;
?>

```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request

session_id = 'test123'  # Your session ID
city = 'new_york'  # The city you want to target
proxy = 'cc-us-city-%s-sessid-%s.bc.pr.oxylabs.io:7777' % (city, session_id)

query = urllib.request.ProxyHandler({
    'http': proxy,
    'https': proxy,
})

execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())

```

{% endtab %}

{% tab title="Java" %}

```java
package example;

import org.apache.http.HttpHost;
import org.apache.http.client.fluent.*;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpHost entry = new HttpHost("cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io", 7777);

        String query = Executor.newInstance()
            .execute(Request.Get("http://ip.oxylabs.io/location").viaProxy(entry))
            .returnContent().asString();
        
        System.out.println(query);
    }
}

```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net;

class Example
{
    static void Main()
    {
        var client = new WebClient();
        
        client.Proxy = new WebProxy("cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io:7777");

        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}

```

{% endtab %}

{% tab title="Go" %}

```ruby
package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("https://cc-us-city-new_york-sessid-test123.bc.pr.oxylabs.io:7777")
	client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)}}

	resp, err := client.Get("https://ip.oxylabs.io/location")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}

### **Query parameters**

| Parameter    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cc`         | Case insensitive country code in 2-letter [**3166-1 alpha-2 format**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). For example, `DE` for Germany, `GB` for the United Kingdom, `TH` for Thailand. You can find more details on how to use country-specific proxies [**here**](/products/proxies/residential-proxies/location-settings/select-country.md).                                                                                                                               |
| `city`       | Case insensitive city name in English. This parameter must be accompanied by `cc` for better accuracy, for example, `cc-GB-city-london` for London, United Kingdom; `cc-DE-city-berlin` for Berlin, Germany. For a city with more than two words, replace space with `_`, for example, `city-st_petersburg` or `city-rio_de_janeiro`. Click [**here**](https://developers.oxylabs.io/proxies/residential-proxies/location-settings/select-city) for more information on city-level targeting. |
| `st`         | Case insensitive US state name with us\_ in the beginning, for example, `us_california`, `us_illinois`. [**Click here** ](https://developers.oxylabs.io/proxies/residential-proxies/location-settings/select-state)for more information on state-level targeting.                                                                                                                                                                                                                             |
| `cn`         | To get a proxy from any of the seven continents, add the `cn-`  parameter and two-letter code to the authorization string. Click here for more information on continent-level targeting                                                                                                                                                                                                                                                                                                       |
| `postalcode` | <p>To connect to a proxy using a ZIP code, add and specify the <code>postalcode</code> parameter with a <strong>five-digit</strong> ZIP code. This parameter must be used combined with the country code parameter <code>cc</code> and a case-insensitive country code in 2-letter <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"><strong>3166-1 alpha-2 format</strong></a>. <br><a href="/pages/ReB4Ej6De1X1uPh5QrRB">Learn more here.</a></p>                                  |
| `ASN`        | You can choose proxies from specific carriers. You have to enter the required ASN number in your request. Learn more [**here**](/products/proxies/residential-proxies/location-settings/asn-targeting.md).                                                                                                                                                                                                                                                                                    |
| `sessid`     | Session ID to keep the same IP with upcoming queries. The session expires in 10 minutes. After that, a new IP address is assigned to that session ID. Random string, 0-9, and A-Z characters are supported.                                                                                                                                                                                                                                                                                   |
| `sesstime`   | The session time parameter keeps the same IP for a certain period. The maximum session time is 30 minutes.                                                                                                                                                                                                                                                                                                                                                                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers.oxylabs.io/products/proxies/residential-proxies/whitelisting-ips.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
