Contents
On this page

Get Share Analytics - Plugixa Easy Social Share Buttons

GET /plugixa-social-share/v1/analytics

The site’s recorded share clicks for a window of days: the total, the trend, and the busiest networks and posts. This is what the Share analytics screen draws.

An account with the plugixa_social_share_view capability. Administrators hold it; no other role does until you grant it.

Days are UTC dates. A window of days covers today and the days days before it, so series has days + 1 entries, one per date, with 0 for a date without clicks.

Request

GET https://your-site.example/wp-json/plugixa-social-share/v1/analytics?days=30

Query parameters

Name Type Default Description
days integer 30 7 or 30; Pro adds 90 and 365 PRO. Any other value is treated as 30.

Responses

200 OK.

For days=7. With Pro, data.placements is added PRO.

{
  "success": true,
  "data": {
    "days": 7,
    "total": 41,
    "previous": 33,
    "series": [
      {
        "day": "2026-11-05",
        "clicks": 4
      },
      {
        "day": "2026-11-06",
        "clicks": 0
      },
      {
        "day": "2026-11-07",
        "clicks": 6
      },
      {
        "day": "2026-11-08",
        "clicks": 5
      },
      {
        "day": "2026-11-09",
        "clicks": 9
      },
      {
        "day": "2026-11-10",
        "clicks": 7
      },
      {
        "day": "2026-11-11",
        "clicks": 8
      },
      {
        "day": "2026-11-12",
        "clicks": 2
      }
    ],
    "networks": [
      {
        "network": "whatsapp",
        "label": "WhatsApp",
        "color": "#25d366",
        "clicks": 22
      },
      {
        "network": "x",
        "label": "X",
        "color": "#000000",
        "clicks": 19
      }
    ],
    "posts": [
      {
        "post_id": 123,
        "title": "A Beginner’s Guide",
        "url": "https://your-site.example/wp-admin/post.php?post=123&action=edit",
        "clicks": 30
      },
      {
        "post_id": 57,
        "title": "Tips & Tricks",
        "url": "https://your-site.example/wp-admin/post.php?post=57&action=edit",
        "clicks": 11
      }
    ]
  }
}
Field Type Meaning
data.days integer The window actually used
data.total integer Clicks in the window
data.previous integer Clicks in the same length of time just before it, for the rise or fall
data.series array One { day, clicks } per date, oldest first; day is YYYY-MM-DD
data.networks array Clicks per network, most first. A network no longer known keeps its slug as label
data.posts array The 10 posts with the most clicks. url is the post’s edit screen, empty for a deleted post, whose title is “(deleted)”
data.placements array Pro only PRO: clicks per placement, each with placement, label and clicks

Errors

Status Code When
404 rest_no_route Share analytics, or the share counts it depends on, is switched off.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-social-share/v1/analytics?days=30" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$query = http_build_query([
    'days' => 30,
]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-social-share/v1/analytics?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const query = new URLSearchParams({ days: '30' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-social-share/v1/analytics?${query}`, {
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share