GET/api/v4/locations/{locationId}/facebook-analytics

获取地点的 Facebook 分析数据

返回指定日期范围内某个地点的 Facebook 公共主页每日互动指标。

需要 API 密钥。请求头格式和密钥轮换请参阅身份验证。

参数

路径

名称类型必填描述
locationIdstring必填Location ID, either the Base64 Relay id (e.g. TG9jYXRpb246MTgwMDI4OQ==) or the raw numeric database id (e.g. 1800289). Both forms resolve to the same location.

查询

名称类型必填描述默认值
fromDatestring可选Start of the range (YYYY-MM-DD). Defaults to a recent window when omitted.—
toDatestring可选End of the range (YYYY-MM-DD).—

响应

200Daily Facebook Page interaction metrics. Each metric is a time-series array; a metric is `null` when no data exists for the range or the Page is not connected.
Response
{  "data": {    "facebookInsights": {      "views": [        { "startTime": "2025-06-01T00:00:00+00:00", "value": 120 }      ],      "ctaAction": [        { "startTime": "2025-06-01T00:00:00+00:00", "value": 5 }      ],      "directionsAction": [        { "startTime": "2025-06-01T00:00:00+00:00", "value": 3 }      ],      "phoneAction": [        { "startTime": "2025-06-01T00:00:00+00:00", "value": 2 }      ],      "websiteAction": [        { "startTime": "2025-06-01T00:00:00+00:00", "value": 9 }      ]    }  }}
401Unauthenticated, missing or invalid API key.

返回某个地点的 Facebook 公共主页每日互动数据。每项指标都是一个时间序列数据点数组,每个数据点包含一个 startTime(按天分组的日期)和一个 value。要求该地点的 Facebook 公共主页已连接。

可用指标:

  • views:公共主页总浏览量
  • ctaAction:公共主页行动号召按钮的点击次数
  • directionsAction:通过公共主页发起的路线查询次数
  • phoneAction:从公共主页发起的通话次数
  • websiteAction:从公共主页点击进入网站的次数

路径中可使用任一种 id 形式

与其他分析端点一样,facebook-analytics 接受 Base64 Relay id(TG9jYXRpb246MTgwMDI4OQ==)或原始数字 id(1800289),两者均解析为同一地点。建议优先使用 Relay id,因为读取端点返回的就是这种 id。如果提供的值不属于这两种形式,端点将返回 {"data":{"facebookInsights":null},"errors":[...]},状态码为 200。

Shell
curl -s 'https://listingsapi.com/api/v4/locations/TG9jYXRpb246MTgwMDI4OQ==/facebook-analytics?fromDate=2025-06-01&toDate=2025-06-30' \  -H "Authorization: API $LISTINGSAPI_KEY"

将互动归因于 CTA 按钮

当某个地点在其公共主页上使用“立即预订”或“立即致电”行动号召按钮时,ctaAction 和 phoneAction 可让您量化该按钮在营销活动期间带来的此类点击次数。请注意,当公共主页在该日期范围内没有数据或尚未连接时,每项指标都会返回 null(而非空数组),请在遍历前检查是否为 null。结合 Google 和 Bing 分析数据,可构建统一的多发布平台成效视图。

Request
curl -X GET 'https://listingsapi.com/api/v4/locations/<locationId>/facebook-analytics' \  -H "Authorization: API $LISTINGSAPI_KEY"