API Endpoint package
API endpoint
https://app.trustservista.com/api/rest/v2/related
Supported Languages
English (native).
Russian, Arabic, Spanish, French, Chinese (with automated translation).
Description
The related API call can be used to create an article- centric story. Given an article URL, the endpoint will return all related articles forming a story centered at given article URL for a predefined time interval.
It supports three time intervals:
- last hour (“interval”: “0” – default if “interval” is missing from the request).
- last day (“interval”: “1”) and last week (“interval”: “2”), intervals related with an end date.
- end date is an optional parameter, set by default to the current date.
Example: if end date is set to 2017-08-22, last week refers to the 7 days interval between 2017-07-16 and 2017-07-22.
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.
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 '{"contentUri": "https://www.usatoday.com/story/news/world/2017/08/22/trump-afghanistan-strategy/588836001/", "interval": "0"}' \ "https://trust.servista.eu/api/rest/v2/related"
Sample JSON response
{ "totalHits": 8, "interval": "last hour", "results": [{ "id": "0ff660d42451cae17e9a05ff8d9311f1", "title": "'UNLIMITED WAR': Breitbart and the far right start to turn on Trump over his Afghanistan decision", "author": "Maxwell Tani", "source": "Business Insider", "url": "http://www.businessinsider.com/far-right-trump-backers-pan-afghanistan-speech-2017-8", "publishDate": "2017-08-22 13:14:43", "sourceLogo": "http://static3.businessinsider.com/assets/images/us/favicons/favicon.ico?v=BI-US-2016-03-31", "articleLogo": "http://static4.businessinsider.com/image/599ba86af1a8501d008b671c/unlimited-war-breitbart-and-the-far-right-start-to-turn-on-trump-over-his-afghanistan-decision.jpg", "sentiment": "neu", "trustLevel": 84, "summary": "President Donald Trump addresses a crowd. REUTERS/Joshua Roberts Vocal supporters of President Donald Trump on the far right slammed his decision to deploy additional troops to Afghanistan and ramp up engagement in the US's longest war.", "ui": "https://www.trustservista.com/alphaui/#/articledashboard/1/0ff660d42451cae17e9a05ff8d9311f1", "clickbait": 41, "similarity": 85 }, { "id": "d4dcb3b4c922a47cd110ad509835b604", "title": "Washington Monthly | Trump Is the Ultimate Disaster Capitalist", "author": "root", "source": "epeak.info", "url": "https://epeak.info/2017/08/22/washington-monthly-trump-is-the-ultimate-disaster-capitalist/", "publishDate": "2017-08-22 13:11:06", "sourceLogo": "https://epeak.info/wp-content/uploads/2017/02/cropped-newlogominimal-1-32x32.jpg", "articleLogo": "https://epeak.info/wp-content/uploads/2017/02/washington-monthly-the-intelligence-community-is-withholding-information-that-trump-doesnt-want-anyway.jpg", "sentiment": "neu", "trustLevel": 58, "summary": "iStock Towards the end of the 2016 presidential campaign, one of Trump’s favorite slogans was “drain the swamp.” What we should have been doing is tying that slogan to something Donald Trump said on Fox and Friends way back in 2014. In writing about how Steve Bannon might be a bigger asset outside the White House that he was on the inside, Sarah Kendzior reminds us of how he articulated the same vision.", "ui": "https://www.trustservista.com/alphaui/#/articledashboard/1/d4dcb3b4c922a47cd110ad509835b604", "clickbait": 45, "similarity": 75 }, { "id": "4f5e4832a5419464184a64f3cbb26208", "title": "Afghanistan's president says Trump's speech shows that America is 'with us without any time limit'", "author": "", "source": "Business Insider", "url": "http://www.businessinsider.com/afp-afghanistan-welcomes-trump-vow-to-stay-without-time-limit-2017-8", "publishDate": "2017-08-22 13:10:00", "sourceLogo": "http://static3.businessinsider.com/assets/images/us/favicons/favicon.ico?v=BI-US-2016-03-31", "articleLogo": "http://static5.businessinsider.com/image/596d61b5abc1c892048b565a/afghanistans-president-says-trumps-speech-shows-that-america-is-with-us-without-any-time-limit.jpg", "sentiment": "neu", "trustLevel": 79, "summary": "Afghan President Ashraf Ghani speaks during a press conference at the presidential palace in Kabul, Afghanistan, Tuesday, July 11, 2017. AP Photo/Rahmat Gul Kandahar (Afghanistan) (AFP) - Afghanistan Tuesday welcomed President Donald Trump's speech clearing the way for thousands more US troops to be deployed in the country, backtracking on his election promise rapidly to quit America's longest war. \"You cannot win this war,\" Ghani told the Taliban, calling on them to join talks and saying that Afghanistan wants peace with neighbouring Pakistan, long accused of fuelling the insurgency.", "ui": "https://www.trustservista.com/alphaui/#/articledashboard/1/4f5e4832a5419464184a64f3cbb26208", "clickbait": 27, "similarity": 93 }, (...) ] }