> For the complete documentation index, see [llms.txt](https://docs.dataimpulse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dataimpulse.com/dataimpulse-documentation-zh-cn/dai-li/ding-wei/geohash-targeting.md).

# Geohash 定向

通过 geohash 在地图上定位特定区域。可在 仪表板 中设置，或在代理登录中使用 geohash 参数进行设置。

Geohash 定位让你可以获取地图上特定区域的 IP，例如某个城市的单个街区，而不是整个国家或城市。

{% embed url="<https://youtu.be/7Ak921ALcMI>" %}

{% hint style="warning" %}
通过 Geohash 定位路由的流量按标准费率的两倍计费。

高级住宅池：无额外费用。Geohash 定位已包含在基础价格中。
{% endhint %}

#### 什么是 geohash

geohash 是地图上一个方形区域的简短代码：代码越长，区域越小。DataImpulse 支持最多 5 个字符的 geohash。

| Geohash | 区域          |
| ------- | ----------- |
| `d`     | 北美和南美的大部分地区 |
| `dr`    | 美国东北部       |
| `dr5`   | 纽约及其周边地区    |
| `dr5ru` | 纽约曼哈顿中城     |

geohash 使用数字 `0`–`9` 和字母 `b`–`z`，除了 `i`, `l` 和 `o`。字母 `a` 不使用。

要查找你所在区域的代码，请使用任意 geohash 地图：放大到你需要的区域，并复制其方块的代码。

#### 如何在 Dashboard 中设置 Geohash 定位

1. 打开你的套餐并向下滚动到 **代理配置**.
2. 选择 **Geohash 定位**.
3. 在 **Geohash** 字段中输入代码，例如 `dr5ru`.
4. 可选地，设置 **国家**, **ASN** 和 **最小 Geo 池** （见下文）。
5. 点击 **保存配置**，然后 **确认并保存更改**.

geohash 会被添加到你在 **基础 URL 示例** 中的代理登录名以及 **代理列表**:

```
curl -x "http://login__geohash.dr5ru:password@gw.dataimpulse.com:823" https://api.ipify.org/
```

{% hint style="info" %}
只有在你点击 **保存配置** 并确认后，设置才会生效。
{% endhint %}

#### 字段

| 字段           | 必填 | 说明                                                                                                  |
| ------------ | -- | --------------------------------------------------------------------------------------------------- |
| **Geohash**  | 是  | 目标区域，最多 5 个字符。                                                                                      |
| **国家**       | 否  | 列表仅显示你的 geohash 内的国家及可用 IP 数量。当你的区域跨越边界时使用它：一个 geohash 方块可能覆盖多个国家，而这可以确保每个 IP 都位于你需要的国家。            |
| **ASN**      | 否  | 定位你所在区域内的特定提供商。一个 **国家** 必须选择它才能使用 ASN。                                                             |
| **最小 Geo 池** | 否  | 在输入 geohash 后解锁。默认情况下，你只会获得方块内的 IP。输入你需要的 IP 数量，我们会逐步扩大搜索范围到方块周围的区域，直到至少达到该数量——如有需要，最多扩展到整个国家。仅限整数。 |

**例如：** 该 `dr5ru` 方块大约有 1,500 个 IP。如果你的任务需要轮换至少 5,000 个不同的 IP，请将 **最小 Geo 池** 设置为 `5000`。然后部分 IP 将来自邻近区域，例如布鲁克林（`dr5qv`).

轮换间隔、匿名过滤器和排除 ASN 与 Geohash 定位的工作方式与其他定位选项相同。

#### 如何检查你的 IP 所在位置

添加 `Accept-X-Proxy-Headers` 代理头到你的请求中。代理响应将包含出口 IP、其国家、城市和 geohash：

```
curl -x "http://login__geohash.dr5ru:password@gw.dataimpulse.com:823" \\
  --proxy-header "Accept-X-Proxy-Headers: X-Proxy-IP, X-Proxy-Country, X-Proxy-City, X-Proxy-Geohash" \\
  -s -D - -o /dev/null https://api.ipify.org/
```

响应：

```
HTTP/1.1 200 OK
X-Proxy-IP: 48.45.161.37
X-Proxy-Country: US
X-Proxy-City: New York
X-Proxy-Geohash: dr5ru-US
```

你也可以使用任何 IP 地理定位服务检查 IP。

#### 错误

| 响应                      | 原因及处理方法                                                                          |
| ----------------------- | -------------------------------------------------------------------------------- |
| `407 COUNTRY_REQUERIED` | ASN 在未设置国家的情况下被设置。请选择一个 **国家** 或者将其添加到 geohash 中，例如 `geohash.dr5ru-us;asn.7922`. |
| `503 NO_RAY`            | 没有可用于这些设置的 IP。使用更短的 geohash，设置 **最小 Geo 池**，或移除其他过滤器。                            |

无效的 geohash 不会返回错误：它会被忽略，请求将不带 geohash 定位发送。

要在代码中手动设置 Geohash 定位，请参见 [Geohash](https://docs.dataimpulse.com/dataimpulse-documentation-zh-cn/dai-li/can-shu/geohash.md) 参数。


---

# 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://docs.dataimpulse.com/dataimpulse-documentation-zh-cn/dai-li/ding-wei/geohash-targeting.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.
