Topstories API call

API Endpoint package

News Analytics

API endpoint

https://trust.servista.eu/api/rest/v2/topstories

Supported Languages

English, German, Spanish

Description

The endpoint will return the top stories (or clusters) for a given time interval. The generated top stories automatically group together articles based on their semantic similarity, in order to understand which are the hour’s/day’s top topics.

Currently, only two fixed time intervals are supported:

  • last hour (“interval”: “0”)
  • last day (“interval”: “1”) with last day being the default, if the interval is not specified.

The results of this API call depend on the websites processed by TrustServista. Contact us if you want to add your own websites list to your account.

This endpoint is used in the TrustServista Web Dashboard to generate the Trending Stories dashboard:

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 '{"interval": "1" }' \
"${API_SERVICE_URL}/rest/v2/topstories"

Sample JSON response

{
	"interval": "last day",
	"stories": [{
			"name": "Deferred Action For Childhood Arrivals, Congress, President",
			"count": 148,
			"articles": [{
					"id": "256a066bf9f3ea5bbcb4bdefcf069a76",
					"url": "http://www.scmp.com/news/world/united-states-canada/article/2110007/its-just-sadness-dreamers-accuse-trump-leaving-them",
					"title": "‘It’s just sadness’: Dreamers say Trump’s decision to rescind DACA leaves them in limbo",
					"publishDate": "2017-09-06 07:54:09",
					"source": "South China Morning Post",
					"sourceType": "newspaper",
					"language": "EN",
					"country": "CHN"
				}, {
					"id": "05ceaff895779268e0b8bb04272cf83d",
					"url": "http://profit.ndtv.com/news/international-business/article-indian-immigrants-in-us-fear-deportation-post-daca-repeal-1746638",
					"title": "Indian Immigrants In US Fear Deportation Post DACA Repeal",
					"publishDate": "2017-09-06 06:04:24",
					"source": "NDTV",
					"sourceType": "newspaper",
					"language": "EN",
					"country": "IND"
				}, 
(...)
	]
		}, {
			"name": "President Obama, America, Americans",
			"count": 23,
			"articles": [{
					"id": "5f34e9037e224e8600cba59ea1e1e311",
					"url": "https://hillarydaily.com/brandon/2017/09/05/obama-releases-statement-slamming-trumps-daca-decision/",
					"title": "Obama Releases Statement Slamming Trump’s DACA Decision",
					"publishDate": "2017-09-06 04:10:01",
					"source": "hillarydaily.com",
					"sourceType": "blog",
					"language": "EN",
					"country": "USA"
				},
(...)

		}
	]
}

Try our API for free!

Includes 1,000 API requests for all available endpoints.

Request API key