Election Monitoring

Election monitoring is the observation of an election by one or more independent parties, typically from another country or a non-governmental organization (NGO), primarily to assess the conduct of an election process on the basis of national legislation and international election standards.

This Application Programming Interface (API) gives software developers access to election monitoring data collected by various organizations specialised in observing Kosovo's electoral process.

We care about sharing and improvements so the software behind this API is free and open under the GNU GPL v2.0 license. Anyone who distributes the code or a derivative work is required to make the source available under the same terms.


Data

Currently, you can use this API to access Kosovo's 2013 local and 2014 general elections observations collected by Democracy in Action (DiA).


Disclaimer

This API is an alpha version. This means that it is still under development and may be subject to bugs. You can help by contacting us to report issues or contribute fixes and improvements to the code base.


Getting Data

Retrieving data from the API is done through RESTful HTTP GET Requests.

The directory structure of the GET requests typically follow the following pattern:
http://opendatakosovo.org/api/election-monitoring/<monitoring-organization>/<data-identifier>/<election-year>/<election-type>/<election-round>/<commune-slug>/<voting-center-slug>/<station-number>


Directory Value
monitoring-organization A string identifying which organization we want to access data from. The options are:
  • dia – Democracy in Action
data-identifier The type of data we want to retrive.
For DiA, the options are:
  • voting-centers – voting center data.
  • observations – Observation data.
  • psc-members-gender-distribution – PSC members gender distribution data.
  • hour-vote-count – Cast ballot count at pre-determined hours.
election-year A four digit value representing the election year. e.g. '2014'.
election-type The election type.
The options are:
  • local-elections – Local elections.
  • general-elections – General elections.
election-round The election round.
The options are:
  • first-round – First round of elections.
  • second-round – Second round of elections.
cummune-slug A slug representation of the commune name. e.g. 'fushe-kosova'.
polling-station-slug A slug representation of the voting station name. e.g. 'mihal-graneno'.
station-number The station number of the voting center.


Searching the DiA's dataset

The directory structure of the GET requests follows the following pattern:
http://opendatakosovo.org/api/election-monitoring/<monitoring-organization>/search/<election-year>/<election-type>/<election-round>/?<searc_param_key>=<searc_param_value>

The possible values for the URL directories are the same as those elaborated previously.
The possible values for the URL query string parameters are the following:


Search Parameter Key Search Parameter Value
commune A slug representation of the commune name. e.g. 'fushe-kosova'.
voting-center A slug representation of the voting center name. e.g. 'mihal-graneno'.
ultra-violet-control How frequent were voters controlled with utra violet.
The options are:
  • always
  • sometimes
  • rarely
  • never
finger-sprayed How frequent were voters' fingers sprayed.
The options are:
  • always
  • sometimes
  • rarely
  • never
missing-voting-booth Indicate whether voting cabins were missing.
The options are:
  • true
  • false
missing-ballot-box Indicate whether ballot boxes were missing.
The options are:
  • true
  • false
missing-ballots Indicate whether ballots were missing.
The options are:
  • true
  • false
missing-poll-book Indicate whether poll books were missing.
The options are:
  • true
  • false
missing-uv-lamp Indicate whether UV lamps were missing.
The options are:
  • true
  • false


Sample Requests

Getting data collected by DiA

Get polling stations grouped by commune:
/api/election-monitoring/dia/voting-centers/2013/local-elections/first-round

Get observations for a given commune:
/api/election-monitoring/dia/observations/2013/local-elections/first-round/ferizaj

Get observations for a given commune and polling station:
/api/election-monitoring/dia/observations/2013/local-elections/first-round/ferizaj/zaskok

Get observations for a given commune, polling station, and room number:
/api/election-monitoring/dia/observations/2013/local-elections/first-round/ferizaj/zaskok/03D

Get KVV members gender distribtion for a given commune:
/api/election-monitoring/dia/psc-members-gender-distribution/2013/local-elections/first-round/ferizaj

Get KVV members gender distribtion for a given commune and polling station:
/api/election-monitoring/dia/psc-members-gender-distribution/2013/local-elections/first-round/ferizaj/zaskok

Get KVV members gender distribtion for a given commune, polling station, and room number:
/api/election-monitoring/dia/psc-members-gender-distribution/2013/local-elections/first-round/ferizaj/zaskok/03D

Get votes count for given commune:
/api/election-monitoring/dia/hour-vote-count/2013/local-elections/first-round/ferizaj

Get votes count for given commune and polling station:
/api/election-monitoring/dia/hour-vote-count/2013/local-elections/first-round/ferizaj/zaskok

Get votes count for given commune, polling station, and room number:
/api/election-monitoring/dia/hour-vote-count/2013/local-elections/first-round/ferizaj/zaskok/03D



Searching data collected by DiA

Get observations collected from the "11 Marsi" voting center in Prizren:
/api/election-monitoring/dia/search/2013/local-elections/first-round/?commune=prizren&voting-center=11-marsi

Get observations collected from the "11 Marsi" voting center in Prizren where UV lamps and ballots boxes were missing:
/api/election-monitoring/dia/search/2013/local-elections/first-round/?commune=prizren&voting-center=11-marsi&missing-uv-lamp=true&missing-ballot-box=true

Get observations collected from the "11 Marsi" voting center in Prizren where voters' fingers where always sprayed and UV lamps were missing:
/api/election-monitoring/dia/search/2013/local-elections/first-round/?commune=prizren&voting-center=11-marsi&finger-sprayed=never&missing-uv-lamp=true