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

# Configuración de ubicación

Obtén más información sobre la configuración de ubicación para Residential Proxies. Aquí encontrarás guías para la segmentación por ubicación, desde continentes hasta ciudades y coordenadas específicas.

Oxylabs Residential Proxies cubren más de 195 ubicaciones en todo el mundo, permitiendo un enrutamiento granular del tráfico hasta **país**, **ciudad**, **estado**, **continente**, **código ZIP**, **ASN**, o **coordenada** niveles. Los parámetros de ubicación se añaden directamente a su cadena de nombre de usuario de proxy `nombre de usuario` o se pasan mediante encabezados personalizados.

{% hint style="info" %}
**Asignación de ubicaciones:** Usamos la [**MaxMind GeoIP2**](https://www.maxmind.com/en/geoip2-databases) base de datos para asignar nuestros nodos de salida `cc`, `st`, y `ciudad` valores. Esta base de datos se actualiza semanalmente.

Algunas otras bases de datos públicas de IP pueden mostrar ubicaciones diferentes. En los casos en que no pueda haber discrepancias de ubicación, verifique que la ubicación del proxy asignado sea la misma en la base de datos de IP utilizada por el sitio web de destino.
{% endhint %}

<table><thead><tr><th width="105">Segmentación</th><th width="194">Parámetro</th><th>Descripción</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. Compatible con puertos de entrada específicos por país.<br>P. ej. <code>customer-USERNAME-cc-US</code></td></tr><tr><td><a href="#city"><strong>Ciudad</strong></a></td><td><code>ciudad</code></td><td>Nombre de ciudad en inglés. Requiere <code>cc</code> parámetro para máxima precisión.<br>P. ej. <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>Solo estados de EE. UU. Requiere <code>us_</code> prefijo.<br>P. ej. <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 dos letras (<code>AF</code>, <code>AN</code>, <code>AS</code>, <code>EU</code>, <code>NA</code>, <code>OC</code>, <code>SA</code>).<br>P. ej. <code>customer-USERNAME-cn-EU</code></td></tr><tr><td><a href="#zip-postal-code"><strong>Código ZIP / postal</strong></a></td><td><code>postalcode</code></td><td>Solo códigos ZIP de EE. UU. de 5 dígitos. Requiere <code>cc-US</code>.<br>P. ej. <code>customer-USERNAME-cc-US-postalcode-90210</code></td></tr><tr><td><a href="#geo-hash"><strong>Geo hash</strong></a></td><td><code>geohash</code></td><td>Niveles de celdas de cuadrícula del 1 al 4 (<code>9</code> a <code>drq4</code>). Mutuamente excluyente con otros parámetros geográficos.<br>P. ej. <code>customer-USERNAME-geohash-u09</code></td></tr><tr><td><a href="#asn-targeting"><strong>Segmentación ASN</strong></a></td><td><code>ASN</code></td><td>Diríjase a números de sistema autónomo específicos. Se anula si <code>cc</code> está presente.<br>P. ej. <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>Se pasa como un encabezado de proxy HTTP. Radio mínimo de 10 millas.<br>P. ej. <code>Latitud:Longitud;Radio</code></td></tr></tbody></table>

{% hint style="warning" %}
**Para solicitudes desde China continental**, consulte los nodos de entrada regionales HTTPS dedicados de [China](#china-entry-nodes).
{% endhint %}

***

## País

Añadir el `cc` parámetro al encabezado de autorización especifica el país objetivo usando un código ISO de 2 letras [**3166-1 alfa-2**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) de país (p. ej., `DE` para Alemania, `GB` para el Reino Unido, `JP` para Japón):

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

#### Ejemplos 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 %}

### Nodos de entrada específicos por país

Alternativamente, conéctese directamente a puntos de entrada de dominios específicos por país sin modificar sus parámetros de nombre de usuario. La siguiente consulta de ejemplo a `ip.oxylabs.io/location` se realiza desde una IP turca aleatoria:

{% 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 el panel para obtener información sobre los puntos de entrada. Descargue una lista completa de puntos de entrada aleatorios o encuéntrelos en la tabla a continuación.

{% file src="/files/37a12c746cb8636909c17e15e8d8f2d65c1850c9" %}

<details>

<summary><strong>Tabla de nodos de entrada disponibles</strong></summary>

| <p><strong>Aleatorio</strong><br>pr.oxylabs.io:7777</p>          | <p><strong>EE. UU.</strong><br>us-pr.oxylabs.io:10000</p>                   | <p><strong>Canadá</strong><br>ca-pr.oxylabs.io:30000</p>                         |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| <p><strong>Gran Bretaña</strong><br>gb-pr.oxylabs.io:20000</p>   | <p><strong>Alemania</strong><br>de-pr.oxylabs.io:30000</p>                  | <p><strong>Francia</strong><br>fr-pr.oxylabs.io:40000</p>                        |
| <p><strong>España</strong><br>es-pr.oxylabs.io:10000</p>         | <p><strong>Italia</strong><br>it-pr.oxylabs.io:20000</p>                    | <p><strong>Suecia</strong><br>se-pr.oxylabs.io:30000</p>                         |
| <p><strong>Grecia</strong><br>gr-pr.oxylabs.io:40000</p>         | <p><strong>Portugal</strong><br>pt-pr.oxylabs.io:10000</p>                  | <p><strong>Países Bajos</strong><br>nl-pr.oxylabs.io:20000</p>                   |
| <p><strong>Bélgica</strong><br>be-pr.oxylabs.io:30000</p>        | <p><strong>Indonesia</strong><br>id-pr.oxylabs.io:10000</p>                 | <p><strong>Ucrania (regiones no ocupadas)</strong><br>ua-pr.oxylabs.io:10000</p> |
| <p><strong>Polonia</strong><br>pl-pr.oxylabs.io:20000</p>        | <p><strong>Israel</strong><br>il-pr.oxylabs.io:20000</p>                    | <p><strong>Turquía</strong><br>tr-pr.oxylabs.io:30000</p>                        |
| <p><strong>Australia</strong><br>au-pr.oxylabs.io:40000</p>      | <p><strong>Malasia</strong><br>my-pr.oxylabs.io:10000</p>                   | <p><strong>Tailandia</strong><br>th-pr.oxylabs.io:20000</p>                      |
| <p><strong>Corea del Sur</strong><br>kr-pr.oxylabs.io:30000</p>  | <p><strong>Japón</strong><br>jp-pr.oxylabs.io:40000</p>                     | <p><strong>Filipinas</strong><br>ph-pr.oxylabs.io:10000</p>                      |
| <p><strong>Singapur</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>Taiwán</strong><br>tw-pr.oxylabs.io:10000</p>         | <p><strong>India</strong><br>in-pr.oxylabs.io:20000</p>                     | <p><strong>Pakistán</strong><br>pk-pr.oxylabs.io:30000</p>                       |
| <p><strong>Kazajistán</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>Perú</strong><br>pe-pr.oxylabs.io:10000</p>           | <p><strong>Ecuador</strong><br>ec-pr.oxylabs.io:20000</p>                   | <p><strong>Colombia</strong><br>co-pr.oxylabs.io:30000</p>                       |
| <p>​​<strong>Sudáfrica</strong><br>za-pr.oxylabs.io:40000</p>    | <p><strong>Egipto</strong><br>eg-pr.oxylabs.io:10000</p>                    | <p><strong>Angola</strong><br>ao-pr.oxylabs.io:40000</p>                         |
| <p><strong>Camerún</strong><br>cm-pr.oxylabs.io:41000</p>        | <p><strong>República Centroafricana</strong><br>cf-pr.oxylabs.io:42000</p>  | <p><strong>Chad</strong><br>td-pr.oxylabs.io:43000</p>                           |
| <p><strong>Benín</strong><br>bj-pr.oxylabs.io:44000</p>          | <p><strong>Etiopía</strong><br>et-pr.oxylabs.io:45000</p>                   | <p><strong>Yibuti</strong><br>dj-pr.oxylabs.io:46000</p>                         |
| <p><strong>Gambia</strong><br>gm-pr.oxylabs.io:47000</p>         | <p><strong>Ghana</strong><br>gh-pr.oxylabs.io:48000</p>                     | <p><strong>Costa de Marfil</strong><br>ci-pr.oxylabs.io:49000</p>                |
| <p><strong>Kenia</strong><br>ke-pr.oxylabs.io:10000</p>          | <p><strong>Liberia</strong><br>lr-pr.oxylabs.io:11000</p>                   | <p><strong>Madagascar</strong><br>mg-pr.oxylabs.io:12000</p>                     |
| <p><strong>Malí</strong><br>ml-pr.oxylabs.io:13000</p>           | <p><strong>Mauritania</strong><br>mr-pr.oxylabs.io:14000</p>                | <p><strong>Mauricio</strong><br>mu-pr.oxylabs.io:15000</p>                       |
| <p><strong>Marruecos</strong><br>ma-pr.oxylabs.io:16000</p>      | <p><strong>Mozambique</strong><br>mz-pr.oxylabs.io:17000</p>                | <p><strong>Nigeria</strong><br>ng-pr.oxylabs.io:18000</p>                        |
| <p><strong>Senegal</strong><br>sn-pr.oxylabs.io:19000</p>        | <p><strong>Seychelles</strong><br>sc-pr.oxylabs.io:20000</p>                | <p><strong>Zimbabue</strong><br>zw-pr.oxylabs.io:21000</p>                       |
| <p><strong>Sudán del Sur</strong><br>ss-pr.oxylabs.io:22000</p>  | <p><strong>Sudán</strong><br>sd-pr.oxylabs.io:23000</p>                     | <p><strong>Togo</strong><br>tg-pr.oxylabs.io:24000</p>                           |
| <p><strong>Túnez</strong><br>tn-pr.oxylabs.io:25000</p>          | <p><strong>Uganda</strong><br>ug-pr.oxylabs.io:26000</p>                    | <p><strong>Zambia</strong><br>zm-pr.oxylabs.io:27000</p>                         |
| <p><strong>Afganistán</strong><br>af-pr.oxylabs.io:28000</p>     | <p><strong>Baréin</strong><br>bh-pr.oxylabs.io:29000</p>                    | <p><strong>Bangladesh</strong><br>bd-pr.oxylabs.io:30000</p>                     |
| <p><strong>Armenia</strong><br>am-pr.oxylabs.io:31000</p>        | <p><strong>Bután</strong><br>bt-pr.oxylabs.io:32000</p>                     | <p><strong>Myanmar</strong><br>mm\_pr.oxylabs.io:33000</p>                       |
| <p><strong>Camboya</strong><br>kh-pr.oxylabs.io:34000</p>        | <p><strong>Georgia</strong><br>ge-pr.oxylabs.io:36000</p>                   | <p><strong>Irak</strong><br>iq-pr.oxylabs.io:37000</p>                           |
| <p><strong>Jordania</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>Mongolia</strong><br>mn-pr.oxylabs.io:41000</p>       | <p><strong>Omán</strong><br>om-pr.oxylabs.io:42000</p>                      | <p><strong>Catar</strong></p><p>qa-pr.oxylabs.io:43000</p>                       |
| <p><strong>Arabia Saudita</strong><br>sa-pr.oxylabs.io:44000</p> | <p><strong>Vietnam</strong><br>vn-pr.oxylabs.io:45000</p>                   | <p><strong>Turkmenistán</strong><br>tm-pr.oxylabs.io:46000</p>                   |
| <p><strong>Uzbekistán</strong><br>uz-pr.oxylabs.io:47000</p>     | <p><strong>Yemen</strong><br>ye-pr.oxylabs.io:48000</p>                     | <p><strong>Albania</strong></p><p>al-pr.oxylabs.io:49000</p>                     |
| <p><strong>Andorra</strong><br>ad-pr.oxylabs.io:10000</p>        | <p><strong>Austria</strong><br>at-pr.oxylabs.io:11000</p>                   | <p><strong>Bosnia y Herzegovina</strong><br>ba-pr.oxylabs.io:13000</p>           |
| <p><strong>Bulgaria</strong><br>bg-pr.oxylabs.io:14000</p>       | <p><strong>Azerbaiyán</strong><br>az-pr.oxylabs.io:20000</p>                | <p><strong>Croacia</strong><br>hr-pr.oxylabs.io:16000</p>                        |
| <p><strong>Chipre</strong><br>cy-pr.oxylabs.io:35000</p>         | <p><strong>República Checa</strong></p><p>cz-pr.oxylabs.io:18000</p>        | <p><strong>Dinamarca</strong><br>dk-pr.oxylabs.io:19000</p>                      |
| <p><strong>Estonia</strong><br>ee-pr.oxylabs.io:20000</p>        | <p><strong>Finlandia</strong><br>fi-pr.oxylabs.io:21000</p>                 | <p><strong>Hungría</strong><br>hu-pr.oxylabs.io:23000</p>                        |
| <p><strong>Islandia</strong><br>is-pr.oxylabs.io:24000</p>       | <p><strong>Irlanda</strong><br>ie-pr.oxylabs.io:25000</p>                   | <p><strong>Letonia</strong><br>lv-pr.oxylabs.io:26000</p>                        |
| <p><strong>Liechtenstein</strong><br>li-pr.oxylabs.io:27000</p>  | <p><strong>Lituania</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>Moldavia</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>Rumanía</strong><br>ro-pr.oxylabs.io:35000</p>                        |
| <p><strong>Serbia</strong><br>rs-pr.oxylabs.io:36000</p>         | <p><strong>Eslovaquia</strong><br>sk-pr.oxylabs.io:37000</p>                | <p><strong>Eslovenia</strong><br>si-pr.oxylabs.io:38000</p>                      |
| <p><strong>Suiza</strong><br>ch-pr.oxylabs.io:39000</p>          | <p><strong>Macedonia</strong></p><p>mk-pr.oxylabs.io:40000</p>              | <p><strong>Bahamas</strong><br>bs-pr.oxylabs.io:41000</p>                        |
| <p><strong>Belice</strong><br>bz-pr.oxylabs.io:42000</p>         | <p><strong>Islas Vírgenes Británicas</strong><br>vg-pr.oxylabs.io:43000</p> | <p><strong>Costa Rica</strong><br>cr-pr.oxylabs.io:44000</p>                     |
| <p><strong>Namibia</strong><br>na-pr.oxylabs.io:28000</p>        | <p><strong>Dominica</strong><br>dm-pr.oxylabs.io:46000</p>                  | <p><strong>Haití</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>Puerto Rico</strong><br>pr-pr.oxylabs.io:12000</p>               | <p><strong>Trinidad y Tobago</strong><br>tt-pr.oxylabs.io:13000</p>              |
| <p><strong>Fiyi</strong><br>fj-pr.oxylabs.io:14000</p>           | <p><strong>Nueva Zelanda</strong><br>nz-pr.oxylabs.io:15000</p>             | <p><strong>Bolivia</strong><br>bo-pr.oxylabs.io:16000</p>                        |
| <p><strong>Paraguay</strong><br>py-pr.oxylabs.io:17000</p>       | <p><strong>Uruguay</strong><br>uy-pr.oxylabs.io:18000</p>                   | <p><strong>Venezuela</strong><br>ve-pr.oxylabs.io:19000</p>                      |
| <p><strong>Unión Europea</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>Tanzania</strong></p><p>tz-pr.oxylabs.io:23000</p>    | <p><strong>Sri Lanka</strong></p><p>lk-pr.oxylabs.io:24000</p>              | <p><strong>Brunéi</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>Argelia</strong><br>dz-pr.oxylabs.io:29000</p>        |                                                                             |                                                                                  |

</details>

***

## Ciudad

Dirija Proxies en ciudades específicas combinando el `ciudad` parámetro con un código de país correspondiente (`cc`). Los nombres de ciudades de varias palabras usan guiones bajos en lugar de espacios (por ejemplo, `new_york`, `rio_de_janeiro`).

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

#### Ejemplos 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 %}

Descargue la lista de ciudades admitidas haciendo clic en el archivo de abajo:

{% file src="/files/57a685aa6f2e3671a4cd82b6cf5a554409a9c06c" %}

{% hint style="info" %}
Admitimos todas las ciudades del mundo, pero debido a la naturaleza dinámica de Residential Proxies no garantizamos que tengamos Proxies allí en un momento específico. Las ciudades más populares están bien cubiertas.
{% endhint %}

***

## Estado

Seleccione Proxies de estados específicos de EE. UU. usando el `st` parámetro. Los nombres de los estados deben incluir el `us_` prefijo (por ejemplo, `us_california`, `us_illinois`).

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

#### Ejemplos de código

En este ejemplo, una consulta a `ip.oxylabs.io/location` se realiza desde una dirección IP aleatoria de California, EE. UU.:

{% 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 %}

Vea la lista completa de estados admitidos a continuación:

{% file src="/files/81a844d85617bbddc3aea3e1816f118a69bc4535" %}

***

## Continente

Enrute las solicitudes a través de cualquiera de los siete continentes usando el `cn` parámetro seguido de un código de continente de dos letras:

`cn-AF` – África\
`cn-AN` – Antártida\
`cn-AS` – Asia\
`cn-EU` – Europa\
`cn-NA` – América del Norte\
`cn-OC` – Oceanía\
`cn-SA` – América del Sur

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

#### Ejemplo 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 %}

***

## Código ZIP / postal

Dirija códigos ZIP específicos de 5 dígitos de EE. UU. usando el `postalcode` parámetro. El parámetro debe usarse con el parámetro de código de país `cc` y un código de país de 2 letras que no distinga mayúsculas y minúsculas [**3166-1 alfa-2**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).

{% hint style="info" %}
Actualmente admitimos **solo códigos basados en EE. UU.** para la segmentación por código ZIP, el parámetro **debe ir acompañado de** `cc-US`.
{% endhint %}

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

#### Ejemplos 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" %}
La ubicación del proxy mediante código ZIP se compara usando [**MaxMind IP Geolocation**](https://www.maxmind.com/en/geoip-demo) base de datos. Puede haber discrepancias entre los códigos ZIP al comprobar direcciones IP frente a otras bases de datos de geolocalización IP.
{% endhint %}

***

## Geohash

Dirija Proxies dentro de celdas geográficas específicas usando códigos geohash que van del Nivel 1 (más grande) al Nivel 4 (más pequeño). Geohash permite una segmentación precisa basada en cuadrícula sin depender de límites administrativos tradicionales como fronteras de país o ciudad.

Por defecto, geohash usa una segmentación estricta: si no hay ninguna IP disponible en la celda solicitada, la solicitud devuelve un `502 Bad Gateway` error.

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

<table><thead><tr><th width="79">Longitud</th><th width="205.69921875">Tamaño aprox. de la celda</th><th>Ejemplos</th></tr></thead><tbody><tr><td>1</td><td>≤ 5,000 km × 5,000 km</td><td><code>geohash-9</code> (Gran parte de EE. UU. y México), <code>geohash-c</code> (Norte de EE. UU. y Canadá)</td></tr><tr><td>2</td><td>≤ 1,250 km × 625 km</td><td><code>geohash-gc</code> (Irlanda, Irlanda del Norte, Inglaterra y Escocia)</td></tr><tr><td>3</td><td>≤ 156 km × 156 km</td><td><code>geohash-u09</code> (París)</td></tr><tr><td>4</td><td>≤ 39.1 km × 19.5 km</td><td><code>geohash-drq4</code> (La mayor parte de la isla de Nantucket)</td></tr></tbody></table>

#### Ejemplos 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` y `geohash_fallback` se excluyen mutuamente entre sí y con otros parámetros de geolocalización, como `cc` (país), `ciudad`, `st` (estado), `cn` (continente), y `postalcode`.
{% endhint %}

Si su caso de uso no requiere una coincidencia estricta de celda, `geohash_fallback` usa el rotador que elimina automáticamente un carácter de geohash a la vez para ampliar el área hasta que se encuentre un proxy disponible.&#x20;

Si no se encuentra ninguna IP en el nivel de un solo carácter, un `502 Bad Gateway` error es devuelto.

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

* **Objetivo inicial:** `2svd` (≤ 39.1 km × 19.5 km)
* **Fallback 1 (1 carácter eliminado):** `2sv` (≤ 156 km × 156 km)
* **Fallback 2 (2 caracteres eliminados):** `2s` (≤ 1,250 km × 625 km)
* **Fallback 3 (3 caracteres eliminados):** `2` (≤ 5,000 km × 5,000 km)

{% hint style="info" %}
**Seguimiento del fallback:** La celda geohash que se usó se devuelve en el `x-geo-hash-fallback` encabezado de respuesta. Compáralo con el valor solicitado para ver si ocurrió un fallback y cuánto se amplió el área.
{% endhint %}

#### Ejemplo de código

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

***

## Objetivo por ASN

Enruta el tráfico a través de redes específicas de proveedores de servicios de Internet (ISP) usando Números de Sistema Autónomo (`ASN`). Puedes encontrar números ASN [**aquí**](https://asnlookup.com/)**.**

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

Si no hay Proxies activos disponibles para el ASN especificado, la solicitud devuelve un `502 Bad Gateway` error.

{% hint style="warning" %}
Acceder a Residential Proxies desde ciertos ASN puede devolver un `403 Access denied: restricted ASN` error si la verificación KYC no se ha completado para tu cuenta de Oxylabs. [Contacta con soporte](mailto:support@oxylabs.io) para completar el proceso KYC.
{% endhint %}

{% hint style="info" %}
Puedes usar el parámetro Country o ASN en cada solicitud. Si se usan ambos parámetros de ubicación, solo se aplicará el parámetro Country.
{% endhint %}

***

## Coordenadas

Dirige los Proxies cerca de coordenadas geográficas específicas usando el `X-Oxylabs-Geolocation` encabezado HTTP del proxy. El formato del valor es `Latitud:Longitud;Radio` (radio en millas, mínimo 10 millas).

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

{% hint style="info" %}
Si no se encuentra ninguna IP dentro de las coordenadas y el radio proporcionados, recibirás `502` código de respuesta. Consulta la lista completa de códigos de respuesta [**aquí**](/products/es/proxies/residential-proxies/additional-information.md).
{% endhint %}

#### Ejemplo 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
```

## China

Para solicitudes iniciadas desde China continental, los nodos de entrada regionales HTTPS dedicados ofrecen conectividad optimizada.

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

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

{% hint style="warning" %}
**Nota:** Es posible que algunas herramientas de terceros no funcionen con los nodos de entrada de Hong Kong y Beijing. Las herramientas confirmadas que funcionan incluyen [Oxy Proxy Extension for Chrome](https://developers.oxylabs.io/integrations/proxy-integrations/oxy-proxy-extension-for-chrome), [SwitchyOmega](https://developers.oxylabs.io/integrations/proxy-integrations/switchyomega), y [Shadowrocket](https://developers.oxylabs.io/integrations/proxy-integrations/shadowrocket). Actualmente estamos trabajando en compatibilidad con más integraciones para el protocolo HTTPS.

Si te conectas a nuestra red residencial desde China y sigues teniendo problemas con los nodos de entrada proporcionados, ponte en contacto en [**support@oxylabs.io**](mailto:support@oxylabs.io) para obtener ayuda 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/es/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.
