API Endpoint package
API endpoint
https://app.trustservista.com/api/rest/v2/statistics
Description
The endpoint will return relevant statistics generated in time by TrustServista for a website that is part of the list of processed publishers.
The API call has 3 parameters:
- endDate: the end date for the statistics.
- startDate: the start date for the statistics.
- webDomain: the wen domain for the statistics.
The API response will provide the following statistics:
- the date when it was added to the TrustServista RSS processing service.
- the language of the publisher’s content.
- the country where the publisher is registered (or where the audience is targeted).
- source type: newspaper, blog, satire, organization, other.
- the publisher declared ownership (where available)
- the number of processed articles between the startDate and endDate.
- average Content Quality Score (TrustLevel).
- average clickbait probability score.
- sentiment distribution: very negative, negative, neutral, positive, very positive.
Sample cURL call
curl -X POST -H "X-TRUS-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Cache-Control: no-cache" \
-d '{"endDate": "2018-05-05", "startDate": "2017-05-05", "webDomain": "bbc.com"}' \
"${API_SERVICE_URL}/rest/v2/statistics"
Sample JSON response
{
"webDomain": "bbc.com",
"startDate": "2017-05-05",
"endDate": "2018-05-05",
"metadata": {
"name": "BBC",
"dateAdded": "2017-01-06",
"language": "ENG",
"country": "GBR",
"type": "newspaper",
"owner": "British Broadcasting Company"
},
"articleCount": 17066,
"averageTrustlevel": 72.59779678893707,
"averageClickbait": 30.871381694597446,
"sentimentDistribution": {
"Very Positive": 4.41,
"Neutral": 31.4,
"Negative": 29.13,
"Positive": 13.4,
"Very Negative": 21.65
}
}
