> 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/geo-hash.md).

# Geo Hash

Usa la segmentación por geo hash con Residential Proxies. Aprende a seleccionar celdas de cuadrícula del nivel 1 al nivel 4 y a comprobar el tamaño aproximado de las celdas.

Para obtener un proxy de una celda específica de la cuadrícula de geohash, agregue el `geohash` indicador a la cadena de autorización. Las celdas de la cuadrícula compatibles van del nivel 1 (más grande) al nivel 4 (más pequeño) actualmente disponible, por ejemplo `9`, `c`, `gc`, `u09`, `drq4`.

Aquí hay algunos ejemplos válidos de `geohash` valores:

* `geohash-9` – un nodo de salida aleatorio de una gran parte de EE. UU. y México
* `geohash-c` – el norte de EE. UU. y Canadá
* `geohash-gc` – Irlanda, Irlanda del Norte, Inglaterra y Escocia
* `geohash-u09` – París
* `geohash-drq4` – la mayor parte de la isla de Nantucket

Los tamaños aproximados de las celdas según la longitud del geohash son:

<table><thead><tr><th width="185.1640625">Longitud</th><th width="304.51171875">Tamaño aproximado de la celda</th></tr></thead><tbody><tr><td>1</td><td>≤ 5,000 km × 5,000 km</td></tr><tr><td>2</td><td>≤ 1,250 km × 625 km</td></tr><tr><td>3</td><td>≤ 156 km × 156 km</td></tr><tr><td>4</td><td>≤ 39.1 km × 19.5 km</td></tr></tbody></table>

{% hint style="info" %}
El `geohash` parámetro es mutuamente excluyente con otros parámetros de geolocalización, como continente, país, ciudad y código ZIP/postal.
{% endhint %}

#### Ejemplo de lista de credenciales

El ejemplo representa una lista de credenciales que apuntan a distintas celdas de la cuadrícula de geohash.

```shellscript
customer-USERNAME-geohash-9:PASSWORD
customer-USERNAME-geohash-gc:PASSWORD
customer-USERNAME-geohash-u09:PASSWORD
customer-USERNAME-geohash-drq4:PASSWORD
```

#### Ejemplos de código

En este ejemplo, se realiza una consulta a `ip.oxylabs.io/location` desde una dirección IP aleatoria dentro de la `u09` celda de la cuadrícula de geohash (París):

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


---

# 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/es/proxies/residential-proxies/location-settings/geo-hash.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.
