local-pois
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLocal POIs (Search API)
本地POI(搜索API)
Requires API Key: Get one at https://api.search.brave.comPlan: Included in the Search plan. See https://api-dashboard.search.brave.com/app/subscriptions/subscribeTwo-step flow: This endpoint requires POI IDs from a prior web search.
- Call
withweb-searchto get POI IDs fromresult_filter=locationslocations.results[].id- Pass those IDs to this endpoint to get full business details
需要API Key:可前往https://api.search.brave.com获取适用套餐:包含在搜索套餐中。详情请见https://api-dashboard.search.brave.com/app/subscriptions/subscribe两步流程:此接口需要先通过网页搜索获取POI ID。
- 调用
接口并设置web-search,从result_filter=locations中获取POI IDlocations.results[].id- 将这些ID传入此接口,获取完整的商家详情
Quick Start (cURL)
快速开始(cURL)
Get POI Details
获取POI详情
bash
curl -s "https://api.search.brave.com/res/v1/local/pois" \
-H "Accept: application/json" \
-H "Accept-Encoding: gzip" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "ids=loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA="bash
curl -s "https://api.search.brave.com/res/v1/local/pois" \
-H "Accept: application/json" \
-H "Accept-Encoding: gzip" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-G \
--data-urlencode "ids=loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA="Multiple POIs with Location Headers
多POI查询(带位置请求头)
bash
curl -s "https://api.search.brave.com/res/v1/local/pois" \
-H "Accept: application/json" \
-H "Accept-Encoding: gzip" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-H "X-Loc-Lat: 37.7749" \
-H "X-Loc-Long: -122.4194" \
-G \
--data-urlencode "ids=loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA=" \
--data-urlencode "ids=loc4HTAVTJKP4RBEBZCEMBI3NG26YD4II4PATIHPDYI=" \
--data-urlencode "units=imperial"Note: POI IDs are opaque strings returned in web search . IDs are ephemeral and expire after ~8 hours. The example IDs above are for illustration — fetch fresh IDs via with . Use since IDs may contain .
locations.results[].idweb-searchresult_filter=locations--data-urlencode=bash
curl -s "https://api.search.brave.com/res/v1/local/pois" \
-H "Accept: application/json" \
-H "Accept-Encoding: gzip" \
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}" \
-H "X-Loc-Lat: 37.7749" \
-H "X-Loc-Long: -122.4194" \
-G \
--data-urlencode "ids=loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA=" \
--data-urlencode "ids=loc4HTAVTJKP4RBEBZCEMBI3NG26YD4II4PATIHPDYI=" \
--data-urlencode "units=imperial"注意:POI ID是网页搜索返回的不透明字符串,有效期约8小时后过期。以上示例ID仅作演示,请通过设置的接口获取最新ID。由于ID可能包含符号,请使用进行编码。
locations.results[].idresult_filter=locationsweb-search=--data-urlencodeEndpoint
接口地址
http
GET https://api.search.brave.com/res/v1/local/poisAuthentication: header
X-Subscription-Token: <API_KEY>http
GET https://api.search.brave.com/res/v1/local/pois身份验证:需携带请求头
X-Subscription-Token: <API_KEY>Parameters
请求参数
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string[] | Yes | — | POI IDs from web search results (1-20) |
| string | No | | Language preference (2+ char language code) |
| string | No | | UI language (locale code, e.g., "en-US") |
| string | No | null | |
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| string[] | 是 | — | 来自网页搜索结果的POI ID(1-20个) |
| string | 否 | | 搜索语言偏好(2位及以上字符的语言代码) |
| string | 否 | | UI语言(区域代码,例如"en-US") |
| string | 否 | null | 单位体系: |
Location Headers (Optional)
可选位置请求头
For distance calculation from user location:
| Header | Type | Range | Description |
|---|---|---|---|
| float | -90.0 to 90.0 | User latitude |
| float | -180.0 to 180.0 | User longitude |
用于计算与用户位置的距离:
| 请求头 | 类型 | 范围 | 说明 |
|---|---|---|---|
| float | -90.0 至 90.0 | 用户纬度 |
| float | -180.0 至 180.0 | 用户经度 |
Response Fields
响应字段
The response has and a array of objects:
type: "local_pois"resultsLocationResult| Field | Type | Description |
|---|---|---|
| string | Business/POI name |
| string | Canonical URL for the location |
| string | Provider page URL |
| string | Always |
| string | POI identifier (opaque string, valid ~8 hours) |
| string? | Short description |
| string | Always |
| string | Formatted display address |
| string? | Street address |
| string? | City |
| string? | State/region |
| string? | Postal/ZIP code |
| string? | Country code |
| string? | Phone number |
| string? | Email address |
| float? | Average rating (≥0) |
| float? | Max possible rating |
| int? | Number of reviews |
| string? | Rating provider name |
| string? | Rating provider URL |
| object[]? | Today's hours ( |
| object[][]? | Hours for each day of the week (same structure) |
| [float, float]? | |
| float? | Distance from user location |
| string? | Distance unit ( |
| string[] | Business categories (default |
| string? | Price indicator ( |
| string[]? | Cuisine types (restaurants) |
| string? | Thumbnail image URL |
| string? | Original image URL |
| object[]? | External profiles ( |
| bool | Whether reviews in a foreign language are available |
| object[]? | Photo thumbnails |
| object? | Action to take — has |
| object[]? | Related web results ( |
| string? | IANA timezone (e.g., |
| int? | UTC timezone offset |
响应的为,包含一个由对象组成的数组:
type"local_pois"LocationResultresults| 字段 | 类型 | 说明 |
|---|---|---|
| string | 商家/POI名称 |
| string | 位置的标准URL |
| string | 提供方页面URL |
| string | 固定为 |
| string | POI标识符(不透明字符串,有效期约8小时) |
| string? | 简短描述 |
| string | 固定为 |
| string | 格式化的显示地址 |
| string? | 街道地址 |
| string? | 城市 |
| string? | 州/地区 |
| string? | 邮政编码 |
| string? | 国家代码 |
| string? | 电话号码 |
| string? | 电子邮箱地址 |
| float? | 平均评分(≥0) |
| float? | 最高可能评分 |
| int? | 评论数量 |
| string? | 评分提供方名称 |
| string? | 评分提供方URL |
| object[]? | 今日营业时间(包含 |
| object[][]? | 一周内每天的营业时间(结构同上) |
| [float, float]? | |
| float? | 与用户位置的距离 |
| string? | 距离单位( |
| string[] | 商家分类(默认 |
| string? | 价格标识( |
| string[]? | 菜系类型(仅餐厅) |
| string? | 缩略图URL |
| string? | 原图URL |
| object[]? | 外部平台资料(包含 |
| bool | 是否存在外语评论 |
| object[]? | 照片缩略图 |
| object? | 可执行操作 — 包含 |
| object[]? | 相关网页结果( |
| string? | IANA时区(例如 |
| int? | UTC时区偏移量 |
Example Response
响应示例
json
{
"type": "local_pois",
"results": [
{
"type": "location_result",
"title": "Park Mediterranean Grill",
"url": "https://yelp.com/biz/park-mediterranean-grill-sf",
"provider_url": "https://yelp.com/biz/park-mediterranean-grill-sf",
"id": "loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA=",
"postal_address": {
"type": "PostalAddress",
"displayAddress": "123 Main St, San Francisco, CA 94102",
"streetAddress": "123 Main St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"country": "US"
},
"contact": { "telephone": "+1 415-555-0123" },
"thumbnail": {
"src": "https://example.com/thumb.jpg",
"original": "https://example.com/original.jpg"
},
"rating": {
"ratingValue": 4.5,
"bestRating": 5.0,
"reviewCount": 234,
},
"opening_hours": {
"current_day": [
{ "abbr_name": "Mon", "full_name": "Monday", "opens": "07:00", "closes": "21:00" }
]
},
"coordinates": [37.7749, -122.4194],
"distance": { "value": 0.3, "units": "miles" },
"categories": ["Mediterranean", "Greek"],
"price_range": "$$",
"serves_cuisine": ["Mediterranean", "Greek"],
"timezone": "America/Los_Angeles"
}
]
}json
{
"type": "local_pois",
"results": [
{
"type": "location_result",
"title": "Park Mediterranean Grill",
"url": "https://yelp.com/biz/park-mediterranean-grill-sf",
"provider_url": "https://yelp.com/biz/park-mediterranean-grill-sf",
"id": "loc4CQWMJWLD4VBEBZ62XQLJTGK6YCJEEJDNAAAAAAA=",
"postal_address": {
"type": "PostalAddress",
"displayAddress": "123 Main St, San Francisco, CA 94102",
"streetAddress": "123 Main St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"country": "US"
},
"contact": { "telephone": "+1 415-555-0123" },
"thumbnail": {
"src": "https://example.com/thumb.jpg",
"original": "https://example.com/original.jpg"
},
"rating": {
"ratingValue": 4.5,
"bestRating": 5.0,
"reviewCount": 234,
},
"opening_hours": {
"current_day": [
{ "abbr_name": "Mon", "full_name": "Monday", "opens": "07:00", "closes": "21:00" }
]
},
"coordinates": [37.7749, -122.4194],
"distance": { "value": 0.3, "units": "miles" },
"categories": ["Mediterranean", "Greek"],
"price_range": "$$",
"serves_cuisine": ["Mediterranean", "Greek"],
"timezone": "America/Los_Angeles"
}
]
}Getting POI IDs
获取POI ID
POI IDs come from the Web Search API () with :
web-searchresult_filter=locationsbash
undefinedPOI ID来自设置了的网页搜索API():
result_filter=locationsweb-searchbash
undefined1. Search for local businesses
1. 搜索本地商家
curl -s "https://api.search.brave.com/res/v1/web/search?q=coffee+shops+near+me&result_filter=locations"
-H "Accept: application/json"
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
-H "X-Loc-Lat: 37.7749"
-H "X-Loc-Long: -122.4194"
-H "Accept: application/json"
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
-H "X-Loc-Lat: 37.7749"
-H "X-Loc-Long: -122.4194"
curl -s "https://api.search.brave.com/res/v1/web/search?q=coffee+shops+near+me&result_filter=locations"
-H "Accept: application/json"
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
-H "X-Loc-Lat: 37.7749"
-H "X-Loc-Long: -122.4194"
-H "Accept: application/json"
-H "X-Subscription-Token: ${BRAVE_SEARCH_API_KEY}"
-H "X-Loc-Lat: 37.7749"
-H "X-Loc-Long: -122.4194"
2. Extract POI IDs from locations.results[].id
2. 从locations.results[].id中提取POI ID
3. Use those IDs with this endpoint
3. 将这些ID传入本接口使用
undefinedundefinedUse Cases
适用场景
- Local business lookup: Retrieve full details (hours, contact, address) for POIs surfaced in web search
- Restaurant discovery pipeline: Search for restaurants, fetch POI details, filter by cuisine/rating/price_range
- Business hours checker: Get opening_hours for a business to determine if currently open
- Location-aware application: Combine with location headers to get distance calculations for nearby POIs
- 本地商家查询:获取网页搜索中出现的POI的完整详情(营业时间、联系方式、地址等)
- 餐厅发现流程:搜索餐厅、获取POI详情、按菜系/评分/价格区间筛选
- 商家营业时间查询:获取商家的营业时间,判断当前是否营业
- 位置感知应用:结合位置请求头,计算附近POI与用户的距离
Notes
注意事项
- ID format: Opaque strings (use for cURL)
--data-urlencode - Units: or
metricfor distance measurement preferenceimperial - Max IDs: Up to 20 IDs per request
- ID格式:不透明字符串(在cURL中请使用)
--data-urlencode - 单位:距离测量偏好可选择或
metricimperial - 最大ID数量:每次请求最多支持20个ID