querystringbắt buộc
Location search query (e.g. a city name).
https://api.sandbase.ai/v1/api/facebook/marketplace-location-searchResolve a place name to Facebook Marketplace locations with coordinates and metadata as normalized JSON.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Returns a list of Facebook Marketplace locations that match a place name. Each result has a name, city, coordinates, postal code, and a page ID. The only input is the query string, such as a city name.
pageId of a location so you can use it in other Facebook Marketplace lookups.subtitle and city.curl -X POST "https://api.sandbase.ai/v1/api/facebook/marketplace-location-search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "Austin"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Location search query (e.g. a city name). |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"locations": [
{
"city": "Chicago",
"latitude": 41.894086,
"longitude": -87.763202,
"name": "Austin",
"pageId": "108120015875983",
"postalCode": "60644-1112",
"subtitle": "Austin, IL · 25,642 people checked in here"
}
]
},
"found": true
}
| Field | Meaning |
|---|---|
found | true when at least one location matched the query. A search with no match returns false. |
data.locations[] | List of matching locations. The top result is not always the one you want, so check each entry. |
data.locations[].name | Display name of the location, such as Austin or Austin, Texas. |
data.locations[].city | City tied to the location. It can differ from name, as in the Austin entry in Chicago. |
data.locations[].latitude / data.locations[].longitude | Coordinates of the location in decimal degrees. |
data.locations[].pageId | Facebook page ID of the location, returned as a string. |
data.locations[].postalCode | Postal code of the location. Some values include the extra four digits, such as 60644-1112. |
data.locations[].subtitle | Short description of the location. It shows a state and check-in count for some places, or a type such as City. |
query. Add a state or region to the text if the first results are the wrong place.pageId as a string. The values are long numeric IDs.Billed at the actual cost of each call, about $0.0012 for the request above. Failed calls are not charged.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
curl -X POST "https://api.sandbase.ai/v1/api/facebook/marketplace-location-search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "Austin"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
querystringbắt buộcLocation search query (e.g. a city name).
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Facebook | Từ $0.0012 mỗi lần gọi | JSON |
Facebook | Từ $0.0012 mỗi lần gọi | JSON |
Facebook | Từ $0.00462 mỗi lần gọi | JSON |
Facebook | Từ $0.0012 mỗi lần gọi | JSON |
Facebook | Từ $0.0011 mỗi lần gọi | JSON |
Facebook | Từ $0.0011 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/facebook/marketplace-location-search với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
Từ $0.0012 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: query (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.
Không. Facebook Marketplace Location Search chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Facebook.