IntroductionThe Politwoops API allows you to request info from our application. This page explains how you can communicate with our API.
Getting startedThe API for politwoops is really simple. No authentication is required (yet?). We will monitor access however, so don't abuse it. Also note that Politwoops is not hosted on a big server, so please be polite and leave 1 second between API requests.
We only have both RSS feeds, as well as an API call for tweets. You can get a feed for the frontpage (
https://www.politwoops.(nl|com|us|eu)/feed/) or from a group (
You can get the deleted tweets by fetching
https://www.politwoops.(nl|com|us|eu)/index.json or limited to a group if you fetch
https://www.politwoops.(nl|com|us|eu)/g/<group name>.json. The output format looks like this:
content: "@DilanYesilgoz Hoort jij niet in bed te liggen?",
Note that the
details field in the tweet if the original object as we received it from Twitter. The API call has one parameter (
page) which controls pagination.
You can get a list of politicians by fetching the URL
https://www.politwoops.(nl|com|us|eu)/politicians.json. The end-result is in JSON format. The response is capped at 50 politicians, again you can use the pagination (
page) that starts at 1 (as of September 2018 we have up to 358 pages), if no page parameter is supplied
page=1 is used as default. Another optional parameter is the
group_id to filter on a certain group of users (e.g. a country group), see Group notes.
You can get a list of politicial parties by fetching the URL
https://www.politwoops.(nl|com|us|eu)/parties.json. The end-result is in JSON format.
You can get a list of groups by fetching the URL
https://www.politwoops(nl|com|us|eu)l/groups.json. The end-result is in JSON format. The country groups are located at
name: "aa en hunze",
sponsor: "Mede mogelijk gemaakt door netwerk democratie",
full_name: "De gemeenteraad van aa en hunze"
Another example to determine a group id for a certain country:
curl -sSf --compressed 'https://www.politwoops.nl/countries.json' | jq 'map(select(.group.default_language=="nl"))'
Based on this group id you can request all politicians, e.g. with:
curl -sSf --compressed 'https://www.politwoops.nl/politicians.json?group_id=1&page=[1-4]' | jq 'map(map(.politician))|add' -s