Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Facebook Marketplace Location Search

API 文档
https://api.sandbase.ai/v1/api/facebook/marketplace-location-search

Resolve a place name to Facebook Marketplace locations with coordinates and metadata as normalized JSON.

价格
起价 $0.0012美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 0 个可选

Playground

输入
Location search query (e.g. a city name).
输出就绪

您的输出将显示在这里

完成输入,然后点击运行。

API README

Facebook Marketplace Location Search API

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.

Use cases

  • Convert a city name typed by a user into coordinates for a map or a radius search.
  • Find the pageId of a location so you can use it in other Facebook Marketplace lookups.
  • Tell apart places that share a name, such as Austin in Illinois, Georgia, and Texas, by reading subtitle and city.
  • Check whether Facebook knows a place name before you build a Marketplace search around it.

Request

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.

Parameters

NameTypeRequiredDescription
querystringYesLocation search query (e.g. a city name).

Example response

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
}

Response fields

FieldMeaning
foundtrue 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[].nameDisplay name of the location, such as Austin or Austin, Texas.
data.locations[].cityCity tied to the location. It can differ from name, as in the Austin entry in Chicago.
data.locations[].latitude / data.locations[].longitudeCoordinates of the location in decimal degrees.
data.locations[].pageIdFacebook page ID of the location, returned as a string.
data.locations[].postalCodePostal code of the location. Some values include the extra four digits, such as 60644-1112.
data.locations[].subtitleShort description of the location. It shows a state and check-in count for some places, or a type such as City.

Notes

  • Send a city name or other place name as query. Add a state or region to the text if the first results are the wrong place.
  • Treat pageId as a string. The values are long numeric IDs.
  • To browse listings after you pick a location, call Facebook Marketplace.
  • To read a single listing, use Facebook Marketplace Item.

Pricing

Billed at the actual cost of each call, about $0.0012 for the request above. Failed calls are not charged.

探索更多

相关 APIs

全部 APIs
API价格响应
Facebook每次调用从 $0.0012 起JSON
Facebook每次调用从 $0.0012 起JSON
Facebook每次调用从 $0.00462 起JSON
Facebook每次调用从 $0.0012 起JSON
Facebook每次调用从 $0.0011 起JSON
Facebook每次调用从 $0.0011 起JSON

指南:Best Facebook API in 2026: Pricing Compared

问题

常见问题

如何使用 Facebook Marketplace Location Search API?

向 https://api.sandbase.ai/v1/api/facebook/marketplace-location-search 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Facebook Marketplace Location Search API 的价格是多少?

起价每次调用 $0.0012,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Facebook Marketplace Location Search API 接受哪些参数?

必填:query (string)。 Parameters 表和本页的 Playground 列出了每个字段。

Facebook Marketplace Location Search API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Facebook 开发者账户或 API key 吗?

不需要。Facebook Marketplace Location Search 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Facebook API 访问权限。