ProductPricingTerms and ConditionsPrivacy PolicyAPI DocsJoin Now

API Documentation

SocialStatsAPI provides endpoints to track and analyze social media posts. Below are detailed instructions on using the API.

1. Authentication

All API requests must include the HTTP header K with a valid secret key. You can find your secret key on your personal account page.

2. Add URLs to Tracking

Endpoint:

POST https://socialstatsapi.com/api/track

Request Parameters (Form Data):

Response:

{ "ok": true } or { "error": "Failure reason" }

Examples:

Bash (cURL)

curl -H "K: your-secret-key" -X POST https://socialstatsapi.com/api/track \
    -d "urls[0][url]=https://twitter.com/post123&urls[0][tags][]=news&urls[0][uid]=post-001"

PHP


    $data = [
        'urls[0][url]' => 'https://twitter.com/post123',
        'urls[0][tags][]' => 'news',
        'urls[0][uid]' => 'post-001'
    ];
    
    $options = [
        'http' => [
            'header' => "K: your-secret-key\r\nContent-Type: application/x-www-form-urlencoded",
            'method' => 'POST',
            'content' => http_build_query($data)
        ]
    ];
    
    $context = stream_context_create($options);
    $result = file_get_contents('https://socialstatsapi.com/api/track', false, $context);
    

Python


    import requests
    
    headers = {"K": "your-secret-key"}
    data = {
        "urls[0][url]": "https://twitter.com/post123",
        "urls[0][tags][]": "news",
        "urls[0][uid]": "post-001"
    }
    response = requests.post("https://socialstatsapi.com/api/track", headers=headers, data=data)
    print(response.json())
    

Node.js


    const axios = require('axios');
    
    axios.post('https://socialstatsapi.com/api/track', new URLSearchParams({
        'urls[0][url]': 'https://twitter.com/post123',
        'urls[0][tags][]': 'news',
        'urls[0][uid]': 'post-001'
    }), {
        headers: { 'K': 'your-secret-key' }
    }).then(response => console.log(response.data));
    

3. Retrieve URL Statistics

Endpoint:

POST https://socialstatsapi.com/api/stats

Request Parameters (Form Data):

Response Format (CSV by Default):

uid, url, views, likes, comments, last_ts

Examples:

Bash (cURL)

curl -H "K: your-secret-key" -X POST https://socialstatsapi.com/api/stats \
    -d "urls[0][uid]=post-001"

PHP


    $data = ['urls[0][uid]' => 'post-001'];
    $options = [
        'http' => [
            'header' => "K: your-secret-key\r\nContent-Type: application/x-www-form-urlencoded",
            'method' => 'POST',
            'content' => http_build_query($data)
        ]
    ];
    
    $context = stream_context_create($options);
    $result = file_get_contents('https://socialstatsapi.com/api/stats', false, $context);
    echo $result;
    

Python


    response = requests.post("https://socialstatsapi.com/api/stats", headers=headers, data={"urls[0][uid]": "post-001"})
    print(response.text)
    

Node.js


    axios.post('https://socialstatsapi.com/api/stats', new URLSearchParams({
        'urls[0][uid]': 'post-001'
    }), {
        headers: { 'K': 'your-secret-key' }
    }).then(response => console.log(response.data));
    

Access console or go to top.

About SocialStatsAPI

SocialStatsAPI provides powerful social media analytics to help businesses and creators track performance, analyze trends, and optimize engagement. Track Youtube, Facebook, Instagram and many more...

Quick Links

Contact Us

Email us at [email protected] should you have any questions or need assistance

© 2025 SocialStatsAPI. All rights reserved.