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

Get Facebook analytics for a location

Returns daily Facebook Page interaction metrics for a location over a date range.

Requires an API key. See Authentication for header format and key rotation.

Parameters

Path

NameTypeRequiredDescription
locationIdstringrequiredLocation 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.

Query

NameTypeRequiredDescriptionDefault
fromDatestringoptionalStart of the range (YYYY-MM-DD). Defaults to a recent window when omitted.—
toDatestringoptionalEnd of the range (YYYY-MM-DD).—

Responses

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.

Returns daily Facebook Page interaction data for a location. Each metric is an array of time-series points with a startTime (the bucketed day) and a value. Requires the location's Facebook Page to be connected.

Available metrics:

  • views: total Page views
  • ctaAction: clicks on the Page's call-to-action button
  • directionsAction: direction requests via the Page
  • phoneAction: calls initiated from the Page
  • websiteAction: clicks through to the website from the Page

Either id form works in the path

Like the other analytics endpoints, facebook-analytics takes the Base64 Relay id (TG9jYXRpb246MTgwMDI4OQ==) or the raw numeric id (1800289), and both resolve to the same location. Prefer the Relay id, which is what the read endpoints return. A value that is neither returns {"data":{"facebookInsights":null},"errors":[...]} with a 200 status.

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"

Attributing engagement to the CTA button

When a location runs a "Book now" or "Call now" call-to-action on its Page, ctaAction and phoneAction let you quantify how many of those clicks the button drove over a campaign window. Note that every metric comes back null (not an empty array) when the Page has no data for the range or is not connected, check for null before iterating. Combine with Google and Bing analytics to build a single multi-publisher performance view.

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