Alle gelöschten Tweets von Politikern

API

Introduction

The Politwoops API allows you to request info from our application. This page explains how you can communicate with our API.

Getting started

The 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.

Tweets

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 (https://www.politwoops.(nl|com|us|eu)/g/<group name>/feed/)

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:

{
tweets: [
{
  created_at: "2011-06-22T20:49:17Z",
  politician_id: 110,
  details: (...),
  updated_at: "2011-06-22T20:49:51Z",
  id: "83636362716254209",
  content: "@DilanYesilgoz Hoort jij niet in bed te liggen?",
  user_name: "danielvanderree"
}
(...)
}

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.

Politicians

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.

Example output:

[
{
politician: {
  party_id: 119,
  id: 990,
  twitter_id: 12500,
  user_name: "breyten",
  status: 1
}
},
(...)
]

Political parties

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.

Example output:

[
{
party: {
  name: "test",
  created_at: "2011-10-16T12:34:10Z",
  updated_at: "2011-10-16T12:34:10Z"
  id: 53
}
},
(..)
]

Groups

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 https://www.politwoops(nl|com|us|eu)l/countries.json.

Example output:

[
{
group: {
  name: "aa en hunze",
  created_at: "2011-10-16T12:36:16Z",
  hide: false,
  updated_at: "2011-10-16T12:36:16Z",
  language: "nl",
  id: 159,
  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"))'

Example output:

[
  {
    "group": {
      "last_promoted_at": "2015-07-25T17:30:05+02:00",
      "notice": "
Dit zijn de verwijderde tweets van zittende kamerleden. Die van de kandidaat kamerleden kan je hier bekijken.
", "stathat_enabled": true, "moderated": false, "name": "politwoops.nl", "base_url": "https://www.politwoops.nl", "everypolitician_url": "", "flag": "nl", "time_zone": "International Date Line West", "auto_follow": false, "href": "https://www.politwoops.nl", "alt_stats_date_end": "2017-03-31T23:59:00+02:00", "continent": "Europe", "user_name": "PolitwoopsNL", "hide": false, "sponsor": "", "activity": true, "full_name": "politwoops.nl", "id": 1, "last_tweeted_at": "2018-09-19T14:11:37+02:00", "mentionable": true, "stathat_id_deleted": "Ju4e", "tweet_delay": 60, "updated_at": "2018-09-19T14:11:37+02:00", "index_name": "politwoops_nl_live", "alt_stats_date_start": "2016-12-19T00:00:00+01:00", "created_at": "2011-05-04T10:36:39+02:00", "is_domain": true, "language": "nl", "slug": "politwoops-dot-nl", "stathat_id_all": "X8lE", "default_language": "nl", "layout": "politwoops", "private": false, "href_json": "https://www.politwoops.nl/index.json" } } ]

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