Skip to main content
Retrieve analytics data for multiple social media accounts. Provides metrics for the last 7 days with comparison to the previous 7 days. Supports filtering by platforms and specific connected accounts.
POST https://services.leadconnectorhq.com/social-media-posting/statistics

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Query parameters

locationId
string
default:"w37swmmLbA02zgqKPpxITe2"
required
Account ID

Body

profileIds
string[]
required
Array of connected social media account IDs to fetch analytics for. This can be found as ‘profileId’ in /accounts api.
platforms
string[]
Array of social media platforms to filter analytics by. If not provided, all platforms will be included. NOTE: Linkedin (PAGE only) and Tiktok (BUSINESS only) are supported.

Respuestas

results
object
Analytics data grouped by metrics and platforms
message
string
default:"Analytics Built Successfully"
traceId
string
default:"42fc8dd8-d55b-475f-944f-9efb90d77564"
{
  "results": {
    "dayRange": [
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri",
      "Sat",
      "Sun"
    ],
    "totals": {
      "posts": 0,
      "likes": 0,
      "followers": 0,
      "impressions": 0,
      "comments": 0
    },
    "postPerformance": {
      "posts": {
        "google": [
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ]
      },
      "impressions": [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
  // truncado: 136 lineas mas
}
{}
{}
{}

Ejemplo

curl -X POST 'https://services.leadconnectorhq.com/social-media-posting/statistics' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "profileIds": [
    "67a5a9aa776c837de4aa5b12"
  ],
  "platforms": [
    "facebook",
    "instagram"
  ]
}'
const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/statistics', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"profileIds": ["67a5a9aa776c837de4aa5b12"], "platforms": ["facebook", "instagram"]}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'POST',
    'https://services.leadconnectorhq.com/social-media-posting/statistics',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"profileIds": ["67a5a9aa776c837de4aa5b12"], "platforms": ["facebook", "instagram"]},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/social-media-posting/statistics');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'profileIds': ['67a5a9aa776c837de4aa5b12'], 'platforms': ['facebook', 'instagram']}),
]);
$data = json_decode(curl_exec($ch), true);