POST/v1.1/bulk
Post a large number of URLs all at once to calculate bulk social counts.
Endpoint
https://api.sharedcount.com/v1.1/bulk
Parameters
Name | Type | Description | Required |
---|---|---|---|
urls | string | One URL per line in the request body. | true |
apikey | string | Your API Key. | true |
Code Examples
curl -X POST 'https://api.sharedcount.com/v1.1/bulk?apikey=YOUR_API_KEY' \
--header 'Content-Type: text/plain' \
--data-raw 'https%3A%2F%2Fwww.nytimes.com%2F
https%3A%2F%2Fwww.wsj.com%2F
https%3A%2F%2Fedition.cnn.com%2F'
npm i sharedcount-sdk
const SharedCountApi = require('sharedcount-sdk');
let sharedCountApiInstance = new SharedCountApi('YOUR_API_KEY');
// Post a large number of URLs all at once to calculate bulk social counts
var urls = [
'https%3A%2F%2Fwww.nytimes.com%2F',
'https%3A%2F%2Fwww.wsj.com%2F',
'https%3A%2F%2Fedition.cnn.com%2F'
];
var bulkPostResponse = sharedCountApiInstance.bulkPost(urls);
pip install sharedcountsdk
from sharedcountsdk import SharedCountApi
sharedCountApiInstance = SharedCountApi('YOUR_API_KEY')
# Post a large number of URLs all at once to calculate bulk social counts
urls = [
"https%3A%2F%2Fwww.nytimes.com%2F",
"https%3A%2F%2Fwww.wsj.com%2F",
"https%3A%2F%2Fedition.cnn.com%2F"
]
bulkPostResponse = sharedCountApiInstance.bulkPost(urls)
composer require sharedcount/sharedcount-sdk
require __DIR__ . '/vendor/sharedcount/sharedcount-sdk/lib/api.php';
$sharedcountApiInstance = new SharedcountApi('YOUR_API_KEY');
// Post a large number of URLs all at once to calculate bulk social counts
$urls = [
'https%3A%2F%2Fwww.nytimes.com%2F',
'https%3A%2F%2Fwww.wsj.com%2F',
'https%3A%2F%2Fedition.cnn.com%2F'
];
$bulkPostResponse = $sharedcountApiInstance->bulkPost($urls);
URL Encoding Warning
⚠️ Important:
When making API requests, ensure that URL parameters are URL-encoded to pass the correct URL to the social networks.
✅ Good (Encoded): https%3A%2F%2Fwww.nytimes.com%2F%3Fq%3Dtechnology%26sort%3Dnewest
❌ Bad (Unencoded): https://www.nytimes.com/?q=technology&sort=newest
URL Format
URLs are transmitted one per line in the POST body, with a trailing line-break after the final URL.
Successfully completed API queries done via batching will count against your daily API quota. Requests exceeding your API quota will be rejected. Under the covers, the bulk endpoint acts as a layer on top of the existing API; one which handles the queueing and processing of a large number of queries for the purposes of reducing transit overhead.
When you make your POST request, you'll receive a response giving you a bulk_id
, and also the number of urls
that were accepted and queued for querying. Invalid URLs will be silently ignored.
Use the GET/v1.1/bulk call to retrieve your data from the endpoint after posting.
Result Format
{
"count": 921,
"bulk_id": "4a7d9ca68177713593c713cc584a7edf9ee9017c"
}