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
locationIdstringrequiredBase64-encoded location ID (Relay id, e.g. TG9jYXRpb246MTgwMDI4OQ==). The raw numeric id is not accepted here.

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.
{
  "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

Path id must be the Base64 Relay id

Like the other analytics endpoints, facebook-analytics keys off the Base64-encoded location id, not the raw numeric id. Encode 1800289 as TG9jYXRpb246MTgwMDI4OQ== (Location:1800289). A bare integer returns {"data":{"facebookInsights":null},"errors":[...]} with a 200 status.

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.

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