API Documentation
This manual describes how to use automated requests to extract social statistics of any URL.
API Information
There is a courtesy rate limit of 1,000 queries per day for each user. If you reach that limit, you will have to wait until next day.
Values are cached for 5 hours at a time. So, values may be up to 5 hours old for repeated queries.
API URL and Parameters
You can receive the data by requesting the URL: https://socialanalytics.php8developer.com/api.php
Query parameters:- url: The URL of the page, including http, and www., if applicable. At this time, we do not provide canonicalization services. URL Encode to minimize errors.
- format: The format of response that you would like to receive. Supported formats are
json,xml, andarray(PHP serialized string). The default return format is JSON.
API Example
JSON response
<?php
$url = "https://www.google.com";
$response = file_get_contents("https://socialanalytics.php8developer.com/api.php?url=".rawurlencode($url));
$json = json_decode($response, true);
echo $url. " has " .$json["facebook"]["share_count"]." shares and ".$json["pinterest"]. " pins";
?>
<?php
$url = "https://www.google.com";
$response = file_get_contents("https://socialanalytics.php8developer.com/api.php?url=".rawurlencode($url)."&format=xml");
$xml = simplexml_load_string($response);
echo $url. " has ".$xml->facebook->share_count." shares, and ".$xml->pinterest." pins";
?>