Quickstart
Make your first API request
Retrieve social engagement data for a public URL in a few minutes. You only need an API key and the URL you want to analyze.
- 1Get an API key
- 2Send a request
- 3Read the response
Authentication
Get your API key
Every API request includes your key in the apikey query parameter.
Create an account for 500 free requests per day. No credit card is required.
Request
Send a request
Use GET /v1.1/ with an API key and a URL. The playground makes a real request, so successful calls count against your daily quota.
https://api.sharedcount.com/v1.1/?apikey=YOUR_API_KEY&url=URL_TO_ANALYZEcurl --get 'https://api.sharedcount.com/v1.1/' \
--data-urlencode 'apikey=YOUR_API_KEY' \
--data-urlencode 'url=https://www.nytimes.com/'
const params = new URLSearchParams({
apikey: 'YOUR_API_KEY',
url: 'https://www.nytimes.com/'
});
const response = await fetch(
`https://api.sharedcount.com/v1.1/?${params}`
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
import requests
response = requests.get(
'https://api.sharedcount.com/v1.1/',
params={
'apikey': 'YOUR_API_KEY',
'url': 'https://www.nytimes.com/'
}
)
response.raise_for_status()
print(response.json())
<?php
$params = http_build_query([
'apikey' => 'YOUR_API_KEY',
'url' => 'https://www.nytimes.com/'
]);
$response = file_get_contents(
'https://api.sharedcount.com/v1.1/?' . $params
);
print_r(json_decode($response, true));Try this endpoint
GEThttps://api.sharedcount.com/v1.1/
Your response will appear here.
Tip: Let your HTTP library encode query parameters. If you build the URL yourself, percent-encode the URL value before sending it.
Response
Read the JSON response
A successful response contains engagement totals reported by each supported network.
{
"Pinterest": 9,
"Facebook": {
"total_count": 168,
"comment_count": 53,
"reaction_count": 14,
"share_count": 101,
"comment_plugin_count": 0
}
}Facebook.total_count- The total Facebook engagement count for the canonical URL.
Pinterest- The Pinterest count reported for the URL.
nullvalues- A provider did not return a count. Handle this separately from a numeric zero.
Troubleshooting
Common API errors
Errors are JSON objects with an Error message and a machine-readable Type.
invalid_url
Send a complete public URL, including http:// or https://, and make sure the query value is encoded.
quota_exceeded
Your daily allowance is exhausted. Check your quota or compare plans; the response message tells you when to retry.
Next steps
Continue building
Choose the guide that matches what you want to do next.