Use our free public API to classify articles based on their political bias. Max 200 requests/day. See Stats

API Endpoint:

https://topbottomcenter.com/api/

POST Parameters:

Parameter Required Description
title yes Article title.
text yes Text body. Minimum 400 characters. Maximum 4000 characters.


JSON Response:

Political Bias ranges from -1.0 to +1.0, where -1.0 is very American Liberal, 0.0 is neutral, and +1.0 is very American Conservative.
{ "political_bias": -0.5 }


Error Response

{ "error": 'Rate Limit Exceeded (Max 200 requests/day and 10/min)' }
{ "error": 'Text too short. (minimum 400 characters)' }
{ "error": 'Text too long. (maximum 4000 characters)' }


Python3 Example

>>> import json
>>> import requests
>>> title = 'blah'
>>> text = 'blah blah'
>>> data = requests.post('https://topbottomcenter.com/api/',
>>> data={'title': title, 'text': text}, headers={'Accept':'application/json'}).json()
>>> print(data['political_bias'])