> 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/pt-br/proxies/residential-proxies/location-settings.md).

# Configurações de localização

Saiba mais sobre as configurações de localização para Residential Proxies. Aqui você encontra guias para segmentação por continentes, cidades específicas, coordenadas ou geohash.

Os Residential Proxies da Oxylabs abrangem mais de 195 localidades em todo o mundo, permitindo o roteamento granular de tráfego até **país**, **city**, **state**, **continente**, **CEP**, **geohash**, **ASN**, ou **coordenada** níveis. Os parâmetros de localização são adicionados diretamente à string de `nome de usuário` ou passados por cabeçalhos personalizados.

{% hint style="info" %}
**Mapeamento de localização:** Usamos o [**MaxMind GeoIP2**](https://www.maxmind.com/en/geoip2-databases) banco de dados para atribuir nossos nós de saída `cc`, `st`, e `city` valores. Este banco de dados é atualizado semanalmente.

Alguns outros bancos de dados públicos de IP podem mostrar locais diferentes. Em casos em que não possa haver qualquer divergência de localização, verifique novamente se a localização do proxy atribuído é a mesma no banco de dados de IP usado pelo site de destino.
{% endhint %}

<table><thead><tr><th width="105">Direcionamento</th><th width="194">Parâmetro</th><th>Descrição</th></tr></thead><tbody><tr><td><a href="#country"><strong>País</strong></a></td><td><code>cc</code></td><td>Código ISO 3166-1 alfa-2. Suporta portas de entrada específicas por país.<br>Ex.: <code>customer-USERNAME-cc-US</code></td></tr><tr><td><a href="#city"><strong>Cidade</strong></a></td><td><code>city</code></td><td>Nome da cidade em inglês. Requer o <code>cc</code> parâmetro para máxima precisão.<br>Ex.: <code>customer-USERNAME-cc-US-city-new_york</code></td></tr><tr><td><a href="#state"><strong>Estado</strong></a></td><td><code>st</code></td><td>Apenas estados dos EUA. Requer o <code>us_</code> prefixo.<br>Ex.: <code>customer-USERNAME-st-us_california</code></td></tr><tr><td><a href="#continent"><strong>Continente</strong></a></td><td><code>cn</code></td><td>Código de continente de duas letras (<code>AF</code>, <code>AN</code>, <code>AS</code>, <code>EU</code>, <code>NA</code>, <code>OC</code>, <code>SA</code>).<br>Ex.: <code>customer-USERNAME-cn-EU</code></td></tr><tr><td><a href="#zip-postal-code"><strong>CEP / Código postal</strong></a></td><td><code>código postal</code></td><td>Apenas CEPs dos EUA com 5 dígitos. Requer <code>cc-US</code>.<br>Ex.: <code>customer-USERNAME-cc-US-postalcode-90210</code></td></tr><tr><td><a href="#geo-hash"><strong>Hash geográfico</strong></a></td><td><code>geohash</code></td><td>Níveis de células de grade de 1 a 4 (<code>9</code> to <code>drq4</code>). Mutuamente exclusivo com outros parâmetros geográficos.<br>Ex.: <code>customer-USERNAME-geohash-u09</code></td></tr><tr><td><a href="#asn-targeting"><strong>Direcionamento por ASN</strong></a></td><td><code>ASN</code></td><td>Direcione para Números de Sistema Autônomo específicos. Substituído se <code>cc</code> estiver presente.<br>Ex.: <code>customer-USERNAME-ASN-21928</code></td></tr><tr><td><a href="#coordinates"><strong>Coordenadas</strong></a></td><td><code>X-Oxylabs-Geolocation</code></td><td>Passado como um cabeçalho de proxy HTTP. Raio mínimo de 10 milhas.<br>Ex.: <code>Latitude:Longitude;Raio</code></td></tr></tbody></table>

{% hint style="warning" %}
**Para solicitações da China continental**, consulte os [nós de entrada da China](#china-entry-nodes).
{% endhint %}

***

## País

Adicionar o `cc` parâmetro ao cabeçalho de autorização especifica o país de destino usando um código ISO de 2 letras no [**formato 3166-1 alfa-2**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) código de país (por exemplo, `DE` para a Alemanha, `GB` para o Reino Unido, `JP` para o Japão):

```
customer-USERNAME-cc-DE:PASSWORD
```

#### Exemplos de código

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

```shell
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cc-DE:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request

username = 'USERNAME'
password = 'PASSWORD'
country = 'DE'
entry = f'http://customer-{username}-cc-{country}:{password}@pr.oxylabs.io:7777'

query = urllib.request.ProxyHandler({'http': entry, 'https': entry})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read().decode('utf-8'))
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'DE';
$proxy = '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");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-cc-$country:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% 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("pr.oxylabs.io", 7777);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME-cc-DE", "PASS")
            .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("pr.oxylabs.io:7777");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME-cc-DE", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME-cc-DE', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

puts result.body
```

{% endtab %}
{% endtabs %}

### Nós de entrada específicos por país

Como alternativa, conecte-se diretamente a pontos de entrada de domínio específicos por país sem modificar os parâmetros do nome de usuário. A consulta de exemplo a seguir para `ip.oxylabs.io/location` é realizada a partir de um IP turco aleatório:

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

```shell
curl -x tr-pr.oxylabs.io:30000 -U "customer-USERNAME:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$proxy = 'tr-pr.oxylabs.io:30000';
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
entry = ('http://customer-%s:%s@tr-pr.oxylabs.io:30000' %
    (username, password))
query = urllib.request.ProxyHandler({
    'http': entry,
    'https': entry,
})
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("tr-pr.oxylabs.io", 30000);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME", "PASS")
            .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("tr-pr.oxylabs.io:30000");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
#!/usr/bin/ruby

require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('tr-pr.oxylabs.io', 30000, 'customer-USERNAME', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

puts result.body
```

{% endtab %}
{% endtabs %}

Consulte o painel para obter informações sobre pontos de entrada. Baixe uma lista completa de pontos de entrada aleatórios ou encontre-os na tabela abaixo.

{% file src="/files/b5e479d7de22716c49b68ab45adcaa115c4b63a2" %}

<details>

<summary><strong>Tabela de nós de entrada disponíveis</strong></summary>

| <p><strong>Aleatório</strong><br>pr.oxylabs.io:7777</p>           | <p><strong>EUA</strong><br>us-pr.oxylabs.io:10000</p>                       | <p><strong>Canadá</strong><br>ca-pr.oxylabs.io:30000</p>                         |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| <p><strong>Grã-Bretanha</strong><br>gb-pr.oxylabs.io:20000</p>    | <p><strong>Alemanha</strong><br>de-pr.oxylabs.io:30000</p>                  | <p><strong>França</strong><br>fr-pr.oxylabs.io:40000</p>                         |
| <p><strong>Espanha</strong><br>es-pr.oxylabs.io:10000</p>         | <p><strong>Itália</strong><br>it-pr.oxylabs.io:20000</p>                    | <p><strong>Suécia</strong><br>se-pr.oxylabs.io:30000</p>                         |
| <p><strong>Grécia</strong><br>gr-pr.oxylabs.io:40000</p>          | <p><strong>Portugal</strong><br>pt-pr.oxylabs.io:10000</p>                  | <p><strong>Países Baixos</strong><br>nl-pr.oxylabs.io:20000</p>                  |
| <p><strong>Bélgica</strong><br>be-pr.oxylabs.io:30000</p>         | <p><strong>Indonésia</strong><br>id-pr.oxylabs.io:10000</p>                 | <p><strong>Ucrânia (regiões não ocupadas)</strong><br>ua-pr.oxylabs.io:10000</p> |
| <p><strong>Polônia</strong><br>pl-pr.oxylabs.io:20000</p>         | <p><strong>Israel</strong><br>il-pr.oxylabs.io:20000</p>                    | <p><strong>Turquia</strong><br>tr-pr.oxylabs.io:30000</p>                        |
| <p><strong>Austrália</strong><br>au-pr.oxylabs.io:40000</p>       | <p><strong>Malásia</strong><br>my-pr.oxylabs.io:10000</p>                   | <p><strong>Tailândia</strong><br>th-pr.oxylabs.io:20000</p>                      |
| <p><strong>Coreia do Sul</strong><br>kr-pr.oxylabs.io:30000</p>   | <p><strong>Japão</strong><br>jp-pr.oxylabs.io:40000</p>                     | <p><strong>Filipinas</strong><br>ph-pr.oxylabs.io:10000</p>                      |
| <p><strong>Singapura</strong><br>sg-pr.oxylabs.io:20000</p>       | <p><strong>China</strong><br>cn-pr.oxylabs.io:30000</p>                     | <p><strong>Hong Kong</strong><br>hk-pr.oxylabs.io:40000</p>                      |
| <p><strong>Taiwan</strong><br>tw-pr.oxylabs.io:10000</p>          | <p><strong>Índia</strong><br>in-pr.oxylabs.io:20000</p>                     | <p><strong>Paquistão</strong><br>pk-pr.oxylabs.io:30000</p>                      |
| <p><strong>Cazaquistão</strong><br>kz-pr.oxylabs.io:30000</p>     | <p><strong>EAU</strong><br>ae-pr.oxylabs.io:40000</p>                       | <p><strong>México</strong><br>mx-pr.oxylabs.io:10000</p>                         |
| <p><strong>Brasil</strong><br>br-pr.oxylabs.io:20000</p>          | <p><strong>Argentina</strong><br>ar-pr.oxylabs.io:30000</p>                 | <p><strong>Chile</strong><br>cl-pr.oxylabs.io:40000</p>                          |
| <p><strong>Peru</strong><br>pe-pr.oxylabs.io:10000</p>            | <p><strong>Equador</strong><br>ec-pr.oxylabs.io:20000</p>                   | <p><strong>Colômbia</strong><br>co-pr.oxylabs.io:30000</p>                       |
| <p>​​<strong>África do Sul</strong><br>za-pr.oxylabs.io:40000</p> | <p><strong>Egito</strong><br>eg-pr.oxylabs.io:10000</p>                     | <p><strong>Angola</strong><br>ao-pr.oxylabs.io:40000</p>                         |
| <p><strong>Camarões</strong><br>cm-pr.oxylabs.io:41000</p>        | <p><strong>República Centro-Africana</strong><br>cf-pr.oxylabs.io:42000</p> | <p><strong>Chade</strong><br>td-pr.oxylabs.io:43000</p>                          |
| <p><strong>Benim</strong><br>bj-pr.oxylabs.io:44000</p>           | <p><strong>Etiópia</strong><br>et-pr.oxylabs.io:45000</p>                   | <p><strong>Djibuti</strong><br>dj-pr.oxylabs.io:46000</p>                        |
| <p><strong>Gâmbia</strong><br>gm-pr.oxylabs.io:47000</p>          | <p><strong>Gana</strong><br>gh-pr.oxylabs.io:48000</p>                      | <p><strong>Costa do Marfim</strong><br>ci-pr.oxylabs.io:49000</p>                |
| <p><strong>Quênia</strong><br>ke-pr.oxylabs.io:10000</p>          | <p><strong>Libéria</strong><br>lr-pr.oxylabs.io:11000</p>                   | <p><strong>Madagascar</strong><br>mg-pr.oxylabs.io:12000</p>                     |
| <p><strong>Mali</strong><br>ml-pr.oxylabs.io:13000</p>            | <p><strong>Mauritânia</strong><br>mr-pr.oxylabs.io:14000</p>                | <p><strong>Maurício</strong><br>mu-pr.oxylabs.io:15000</p>                       |
| <p><strong>Marrocos</strong><br>ma-pr.oxylabs.io:16000</p>        | <p><strong>Moçambique</strong><br>mz-pr.oxylabs.io:17000</p>                | <p><strong>Nigéria</strong><br>ng-pr.oxylabs.io:18000</p>                        |
| <p><strong>Senegal</strong><br>sn-pr.oxylabs.io:19000</p>         | <p><strong>Seicheles</strong><br>sc-pr.oxylabs.io:20000</p>                 | <p><strong>Zimbábue</strong><br>zw-pr.oxylabs.io:21000</p>                       |
| <p><strong>Sudão do Sul</strong><br>ss-pr.oxylabs.io:22000</p>    | <p><strong>Sudão</strong><br>sd-pr.oxylabs.io:23000</p>                     | <p><strong>Togo</strong><br>tg-pr.oxylabs.io:24000</p>                           |
| <p><strong>Tunísia</strong><br>tn-pr.oxylabs.io:25000</p>         | <p><strong>Uganda</strong><br>ug-pr.oxylabs.io:26000</p>                    | <p><strong>Zâmbia</strong><br>zm-pr.oxylabs.io:27000</p>                         |
| <p><strong>Afeganistão</strong><br>af-pr.oxylabs.io:28000</p>     | <p><strong>Bahrein</strong><br>bh-pr.oxylabs.io:29000</p>                   | <p><strong>Bangladesh</strong><br>bd-pr.oxylabs.io:30000</p>                     |
| <p><strong>Armênia</strong><br>am-pr.oxylabs.io:31000</p>         | <p><strong>Butão</strong><br>bt-pr.oxylabs.io:32000</p>                     | <p><strong>Mianmar</strong><br>mm\_pr.oxylabs.io:33000</p>                       |
| <p><strong>Camboja</strong><br>kh-pr.oxylabs.io:34000</p>         | <p><strong>Geórgia</strong><br>ge-pr.oxylabs.io:36000</p>                   | <p><strong>Iraque</strong><br>iq-pr.oxylabs.io:37000</p>                         |
| <p><strong>Jordânia</strong><br>jo-pr.oxylabs.io:38000</p>        | <p><strong>Líbano</strong><br>lb-pr.oxylabs.io:39000</p>                    | <p><strong>Maldivas</strong><br>mv-pr.oxylabs.io:40000</p>                       |
| <p><strong>Mongólia</strong><br>mn-pr.oxylabs.io:41000</p>        | <p><strong>Omã</strong><br>om-pr.oxylabs.io:42000</p>                       | <p><strong>Catar</strong></p><p>qa-pr.oxylabs.io:43000</p>                       |
| <p><strong>Arábia Saudita</strong><br>sa-pr.oxylabs.io:44000</p>  | <p><strong>Vietnã</strong><br>vn-pr.oxylabs.io:45000</p>                    | <p><strong>Turcomenistão</strong><br>tm-pr.oxylabs.io:46000</p>                  |
| <p><strong>Uzbequistão</strong><br>uz-pr.oxylabs.io:47000</p>     | <p><strong>Iêmen</strong><br>ye-pr.oxylabs.io:48000</p>                     | <p><strong>Albânia</strong></p><p>al-pr.oxylabs.io:49000</p>                     |
| <p><strong>Andorra</strong><br>ad-pr.oxylabs.io:10000</p>         | <p><strong>Áustria</strong><br>at-pr.oxylabs.io:11000</p>                   | <p><strong>Bósnia e Herzegovina</strong><br>ba-pr.oxylabs.io:13000</p>           |
| <p><strong>Bulgária</strong><br>bg-pr.oxylabs.io:14000</p>        | <p><strong>Azerbaijão</strong><br>az-pr.oxylabs.io:20000</p>                | <p><strong>Croácia</strong><br>hr-pr.oxylabs.io:16000</p>                        |
| <p><strong>Chipre</strong><br>cy-pr.oxylabs.io:35000</p>          | <p><strong>República Tcheca</strong></p><p>cz-pr.oxylabs.io:18000</p>       | <p><strong>Dinamarca</strong><br>dk-pr.oxylabs.io:19000</p>                      |
| <p><strong>Estônia</strong><br>ee-pr.oxylabs.io:20000</p>         | <p><strong>Finlândia</strong><br>fi-pr.oxylabs.io:21000</p>                 | <p><strong>Hungria</strong><br>hu-pr.oxylabs.io:23000</p>                        |
| <p><strong>Islândia</strong><br>is-pr.oxylabs.io:24000</p>        | <p><strong>Irlanda</strong><br>ie-pr.oxylabs.io:25000</p>                   | <p><strong>Letônia</strong><br>lv-pr.oxylabs.io:26000</p>                        |
| <p><strong>Liechtenstein</strong><br>li-pr.oxylabs.io:27000</p>   | <p><strong>Lituânia</strong><br>lt-pr.oxylabs.io:28000</p>                  | <p><strong>Luxemburgo</strong><br>lu-pr.oxylabs.io:29000</p>                     |
| <p><strong>Malta</strong><br>mt-pr.oxylabs.io:30000</p>           | <p><strong>Mônaco</strong><br>mc-pr.oxylabs.io:31000</p>                    | <p><strong>Moldávia</strong><br>md-pr.oxylabs.io:32000</p>                       |
| <p><strong>Montenegro</strong><br>me-pr.oxylabs.io:33000</p>      | <p><strong>Noruega</strong><br>no-pr.oxylabs.io:34000</p>                   | <p><strong>Romênia</strong><br>ro-pr.oxylabs.io:35000</p>                        |
| <p><strong>Sérvia</strong><br>rs-pr.oxylabs.io:36000</p>          | <p><strong>Eslováquia</strong><br>sk-pr.oxylabs.io:37000</p>                | <p><strong>Eslovênia</strong><br>si-pr.oxylabs.io:38000</p>                      |
| <p><strong>Suíça</strong><br>ch-pr.oxylabs.io:39000</p>           | <p><strong>Macedônia</strong></p><p>mk-pr.oxylabs.io:40000</p>              | <p><strong>Bahamas</strong><br>bs-pr.oxylabs.io:41000</p>                        |
| <p><strong>Belize</strong><br>bz-pr.oxylabs.io:42000</p>          | <p><strong>Ilhas Virgens Britânicas</strong><br>vg-pr.oxylabs.io:43000</p>  | <p><strong>Costa Rica</strong><br>cr-pr.oxylabs.io:44000</p>                     |
| <p><strong>Namíbia</strong><br>na-pr.oxylabs.io:28000</p>         | <p><strong>Dominica</strong><br>dm-pr.oxylabs.io:46000</p>                  | <p><strong>Haiti</strong><br>ht-pr.oxylabs.io:47000</p>                          |
| <p><strong>Honduras</strong><br>hn-pr.oxylabs.io:48000</p>        | <p><strong>Jamaica</strong><br>jm-pr.oxylabs.io:49000</p>                   | <p><strong>Aruba</strong><br>aw-pr.oxylabs.io:10000</p>                          |
| <p><strong>Panamá</strong><br>pa-pr.oxylabs.io:11000</p>          | <p><strong>Porto Rico</strong><br>pr-pr.oxylabs.io:12000</p>                | <p><strong>Trinidad e Tobago</strong><br>tt-pr.oxylabs.io:13000</p>              |
| <p><strong>Fiji</strong><br>fj-pr.oxylabs.io:14000</p>            | <p><strong>Nova Zelândia</strong><br>nz-pr.oxylabs.io:15000</p>             | <p><strong>Bolívia</strong><br>bo-pr.oxylabs.io:16000</p>                        |
| <p><strong>Paraguai</strong><br>py-pr.oxylabs.io:17000</p>        | <p><strong>Uruguai</strong><br>uy-pr.oxylabs.io:18000</p>                   | <p><strong>Venezuela</strong><br>ve-pr.oxylabs.io:19000</p>                      |
| <p><strong>União Europeia</strong><br>eu-pr.oxylabs.io:10000</p>  | <p><strong>República Dominicana</strong></p><p>do-pr.oxylabs.io:21000</p>   | <p><strong>Laos</strong></p><p>la-pr.oxylabs.io:22000</p>                        |
| <p><strong>Tanzânia</strong></p><p>tz-pr.oxylabs.io:23000</p>     | <p><strong>Sri Lanka</strong></p><p>lk-pr.oxylabs.io:24000</p>              | <p><strong>Brunei</strong></p><p>bn-pr.oxylabs.io:25000</p>                      |
| <p><strong>Nepal</strong></p><p>np-pr.oxylabs.io:26000</p>        | <p><strong>Kuwait</strong></p><p>kw-pr.oxylabs.io:20000</p>                 | <p><strong>Guatemala</strong></p><p>gt-pr.oxylabs.io:27000</p>                   |
| <p><strong>Argélia</strong><br>dz-pr.oxylabs.io:29000</p>         |                                                                             |                                                                                  |

</details>

***

## Cidade

Direcione Proxies para cidades específicas combinando o `city` parâmetro com um código de país correspondente (`cc`). Nomes de cidades com várias palavras usam sublinhados em vez de espaços (por exemplo, `new_york`, `rio_de_janeiro`).

```
customer-USERNAME-cc-US-city-los_angeles:PASSWORD
```

#### Exemplos de código

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

```shell
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cc-DE-city-munich:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'DE'
city = 'munich'
entry = ('http://customer-%s-cc-%s-city-%s:%s@pr.oxylabs.io:7777' %
    (username, country, city, password))
query = urllib.request.ProxyHandler({
    'http': entry,
    'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'DE';
$city = 'munich';
$proxy = '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");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-cc-$country-city-$city:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% 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("pr.oxylabs.io", 7777);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME-cc-DE-city-munich", "PASS")
            .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("pr.oxylabs.io:7777");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME-cc-DE-city-munich", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME-cc-DE-city-munich', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

puts result.body
```

{% endtab %}
{% endtabs %}

Baixe a lista de cidades suportadas clicando no arquivo abaixo:

{% file src="/files/eb5ab0eee5c2889858d66139322f7a2804e012ea" %}

{% hint style="info" %}
Oferecemos suporte a todas as cidades do mundo, mas, devido à natureza dinâmica dos Residential Proxies, não garantimos que teremos Proxies nelas em um momento específico. As cidades mais populares têm boa cobertura.
{% endhint %}

***

## Estado

Selecione Proxies de estados específicos dos EUA usando o `st` parâmetro. Os nomes dos estados devem incluir o `us_` prefixo (por exemplo, `us_california`, `us_illinois`).

```
customer-USERNAME-st-us_california:PASSWORD
```

#### Exemplos de código

Neste exemplo, uma consulta a `ip.oxylabs.io/location` é realizada a partir de um IP aleatório da Califórnia, EUA:

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

```shell
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-st-us_california:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$state = 'us_california';
$proxy = '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");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-st-$state:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
state = 'us_california'
entry = ('http://customer-%s-st-%s:%s@pr.oxylabs.io:7777' %
    (username, state, password))
query = urllib.request.ProxyHandler({
    'http': entry,
    'https': entry,
})
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("pr.oxylabs.io", 7777);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME-st-us_california", "PASS")
            .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("pr.oxylabs.io:7777");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME-st-us_california", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME-st-us_california', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

```

{% endtab %}
{% endtabs %}

Veja a lista completa de estados compatíveis abaixo:

{% file src="/files/a156924bf0b9ba2409a74d5d77e78796e4644313" %}

***

## Continente

Encaminhe solicitações por qualquer um dos sete continentes usando o `cn` parâmetro seguido por um código de continente de duas letras:

`cn-AF` – África\
`cn-AN` – Antártida\
`cn-AS` – Ásia\
`cn-EU` – Europa\
`cn-NA` – América do Norte\
`cn-OC` – Oceania\
`cn-SA` – América do Sul

```
customer-USERNAME-cn-EU:PASSWORD
```

#### Exemplo de código

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

```shell
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cn-AS:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$continent = 'AS';
$proxy = '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");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-cn-$continent:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
continent = 'AS'
entry = ('http://customer-%s-cn-%s:%s@pr.oxylabs.io:7777' %
    (username, continent, password))
query = urllib.request.ProxyHandler({
    'http': entry,
    'https': entry,
})
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("pr.oxylabs.io", 7777);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME-cn-AS", "PASS")
            .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("pr.oxylabs.io:7777");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME-cn-AS", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME-cn-AS', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

puts result.body
```

{% endtab %}
{% endtabs %}

***

## CEP / Código postal

Direcione para CEPs específicos dos EUA com 5 dígitos usando o `código postal` parâmetro. O parâmetro deve ser usado com o parâmetro de código de país `cc` e um código de país de 2 letras que não diferencia maiúsculas de minúsculas [**formato 3166-1 alfa-2**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).

{% hint style="info" %}
Atualmente, oferecemos suporte **apenas a códigos dos EUA** para direcionamento por CEP, o parâmetro **deve ser acompanhado por** `cc-US`.
{% endhint %}

```
customer-USERNAME-cc-US-postalcode-90210:PASSWORD
```

#### Exemplos de código

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

```shell
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cc-US-postalcode-90210:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'US';
$postalcode = '90210';
$proxy = '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");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-cc-$country-postalcode-$postalcode:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'US'
postalcode = '90210'
entry = ('http://customer-%s-cc-%s-postalcode-%s:%s@pr.oxylabs.io:7777' %
    (username, country, postalcode, password))
query = urllib.request.ProxyHandler({
    'http': entry,
    'https': entry,
})
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("pr.oxylabs.io", 7777);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME-cc-US-postalcode-90210", "PASS")
            .execute(Request.Get("https://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("pr.oxylabs.io:7777");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME-cc-US-postalcode-90210", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME-cc-US-postalcode-90210', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

puts result.body
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
A localização do Proxy usando CEP é correspondente usando o [**MaxMind IP Geolocation**](https://www.maxmind.com/en/geoip-demo) banco de dados. Pode haver uma discrepância entre CEPs ao verificar endereços IP em relação a outros bancos de dados de geolocalização de IP.
{% endhint %}

***

## Geohash

Direcione proxies para células de grade geográficas específicas usando códigos geohash que variam do Nível 1 (maior) ao Nível 4 (menor). O Geohash permite segmentação precisa baseada em grade, sem depender de limites administrativos tradicionais, como fronteiras de países ou cidades.

Por padrão, o geohash usa segmentação estrita: se não houver IP disponível na célula solicitada, a solicitação retorna um `502 Bad Gateway` erro.

```
customer-USERNAME-geohash-u09:PASSWORD
```

<table><thead><tr><th width="79">Comprimento</th><th width="205.69921875">Tamanho aprox. da célula</th><th>Exemplos</th></tr></thead><tbody><tr><td>1</td><td>≤ 5,000 km × 5,000 km</td><td><code>geohash-9</code> (Grande parte dos EUA e do México), <code>geohash-c</code> (Norte dos EUA e Canadá)</td></tr><tr><td>2</td><td>≤ 1,250 km × 625 km</td><td><code>geohash-gc</code> (Irlanda, Irlanda do Norte, Inglaterra e Escócia)</td></tr><tr><td>3</td><td>≤ 156 km × 156 km</td><td><code>geohash-u09</code> (Paris)</td></tr><tr><td>4</td><td>≤ 39.1 km × 19.5 km</td><td><code>geohash-drq4</code> (Maior parte da ilha de Nantucket)</td></tr></tbody></table>

#### Exemplos de código

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

```shell
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-geohash-u09:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$geohash = 'u09';
$proxy = '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");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-geohash-$geohash:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
geohash = 'u09'
entry = ('http://customer-%s-geohash-%s:%s@pr.oxylabs.io:7777' %
    (username, geohash, password))
query = urllib.request.ProxyHandler({
    'http': entry,
    'https': entry,
})
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("pr.oxylabs.io", 7777);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME-geohash-u09", "PASS")
            .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("pr.oxylabs.io:7777");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME-geohash-u09", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME-geohash-u09', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

puts result.body

```

{% endtab %}
{% endtabs %}

### Fallback de Geohash

{% hint style="warning" %}
`geohash` e `geohash_fallback` são mutuamente exclusivos entre si e com outros parâmetros de geolocalização, como `cc` (country), `city`, `st` (state), `cn` (continent), e `código postal`.
{% endhint %}

Se seu caso de uso não exigir uma correspondência exata de célula, `geohash_fallback` usa o rotator que remove automaticamente um caractere do geohash por vez para expandir a área até encontrar um proxy disponível.&#x20;

Se nenhum IP for encontrado no nível de um único caractere, um `502 Bad Gateway` erro é retornado.

```
customer-USERNAME-geohash_fallback-2svd:PASSWORD
```

* **Destino inicial:** `2svd` (≤ 39.1 km × 19.5 km)
* **Fallback 1 (1 caractere removido):** `2sv` (≤ 156 km × 156 km)
* **Fallback 2 (2 caracteres removidos):** `2s` (≤ 1,250 km × 625 km)
* **Fallback 3 (3 caracteres removidos):** `2` (≤ 5,000 km × 5,000 km)

{% hint style="info" %}
**Rastreando o fallback:** a célula geohash usada é retornada no `x-geo-hash-fallback` cabeçalho da resposta. Compare-o com o valor solicitado para ver se ocorreu um fallback e o quanto a área foi expandida.
{% endhint %}

#### Exemplo de código

```shellscript
curl -v -x pr.oxylabs.io:7777 -U "customer-USERNAME-geohash_fallback-2svd:PASSWORD" https://ip.oxylabs.io/location
```

***

## Segmentação por ASN

Roteie o tráfego por redes específicas de provedores de serviços de Internet (ISP) usando Números de Sistema Autônomo (`ASN`). Você pode encontrar números de ASN [**aqui**](https://asnlookup.com/)**.**

```
customer-USERNAME-ASN-21928-sessid-abcde12345:PASSWORD
```

Se não houver proxies ativos disponíveis para o ASN especificado, a solicitação retorna um `502 Bad Gateway` erro.

{% hint style="warning" %}
Acessar Residential Proxies a partir de certos ASNs pode retornar um `403 Access denied: restricted ASN` erro se a verificação KYC não for concluída para sua conta Oxylabs. [Entre em contato com o suporte](mailto:support@oxylabs.io) para concluir o processo de KYC.
{% endhint %}

{% hint style="info" %}
Você pode usar apenas o parâmetro Country ou ASN por solicitação. Se ambos os parâmetros de localização forem usados, apenas o parâmetro Country será aplicado.
{% endhint %}

***

## Coordenadas

Direcione proxies próximos a coordenadas geográficas específicas usando o `X-Oxylabs-Geolocation` cabeçalho HTTP do proxy. O formato do valor é `Latitude:Longitude;Raio` (raio em milhas, mínimo de 10 milhas).

```
X-Oxylabs-Geolocation: 49.9235:-97.0811;10
```

{% hint style="info" %}
Se nenhum IP for encontrado dentro das coordenadas e do raio fornecidos, você receberá `502` código de resposta. Veja a lista completa de códigos de resposta [**aqui**](https://developers.oxylabs.io/products/pt-br/proxies/residential-proxies/additional-information.md).
{% endhint %}

#### Exemplo de código

```bash
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME:PASSWORD" --proxy-header "X-Oxylabs-Geolocation: 49.9235:-97.0811;10" https://ip.oxylabs.io/location
```

## nós de entrada da China

Para solicitações iniciadas na China continental, nós de entrada regionais HTTPS dedicados oferecem conectividade otimizada.

* **Hong Kong:** `a81298871.com:8000`
* **Pequim:** `cnt9t1is.com:8000`

```bash
curl -x cnt9t1is.com:8000 -U "customer-USERNAME-cc-US:PASSWORD" https://ip.oxylabs.io/location
```

{% hint style="warning" %}
**Observação:** Algumas ferramentas de terceiros podem não funcionar com os nós de entrada de Hong Kong e Pequim. As ferramentas confirmadas como compatíveis incluem [Extensão Oxy Proxy para Chrome](https://developers.oxylabs.io/integrations/proxy-integrations/oxy-proxy-extension-for-chrome), [SwitchyOmega](https://developers.oxylabs.io/integrations/proxy-integrations/switchyomega), e [Shadowrocket](https://developers.oxylabs.io/integrations/proxy-integrations/shadowrocket). Atualmente, estamos trabalhando para oferecer suporte a mais integrações para o protocolo HTTPS.

Se você estiver se conectando à nossa rede Residential Proxies a partir da China e ainda tiver problemas com os nós de entrada fornecidos, entre em contato em [**support@oxylabs.io**](mailto:support@oxylabs.io) para obter ajuda adicional.
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/products/pt-br/proxies/residential-proxies/location-settings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
