2019 Turkish Mayoral Elections – Scraping Ballot Box Level Data

A while ago, I compiled the election data for the 2019 mayoral elections in Turkey, which took place on March 31, 2019, through the Anadolu Agency website, only accessible information back then because the website for the Turkey’s Higher Electoral Commission (YSK) was down and they did not make the official election data available until recently. This data was also limited as the Anadolu Agency only provided overall numbers (not for each ballot box). Now, it seems that YSK’s website is alive back again and provides a nice-user friendly dashboard for the election data at the ballot box level. However, their dashboard is not very data-analyst friendly for those who has been starving for a more deeper analysis. Here, I provide the data and the R code I used to scrap this data from YSK’s website.

Cengiz Zopluoglu (University of Miami)
05-24-2019

A while ago, I compiled the election data for the 2019 mayoral elections in Turkey, which took place on March 31, 2019, through the Anadolu Agency website, only accessible information back then because the website for the Turkey’s Higher Electoral Commission (YSK) was down and they did not make the election data available until recently. The blog post about that attempt is here. This data was limited as the agency only provided overall numbers (not for each ballot box).

Now, it seems that YSK’s website is alive back again and provides a nice-user friendly dashboard for the election data at the ballot box level. However, their dashboard is not very data-analyst friendly for those who has been starving for a more deeper analysis to look at the electrol irregularities (aka @abdaydgn, see his recent piece at the Washington Post).

As Turkey’s democracy is at stake for the last couple years, here is my share to support it. I provide the downloadable datasets below for metropolitan mayoral elections, district municipal mayoral elections, municipal council elections, and provincial council elections. For comparison purposes, I also compiled the exact same data from 2014 corresponding elections.

As a reference, I also added the links for the R code I used to compile each dataset below from YSK’s API. They are all very similar with a few tweaks required because of the different nature of each dataset.

Below are a list of variables common in these datasets:

The rest of the columns are acronyms for the political parties participated in each election.

Please be mindful about the time spent to compile these datasets and give acknowledgement if you use these datasets for any publication (research papers, blogs, articles, etc.). A sample reference is provided at the bottom.

2019 Mayoral Elections Ballot Box Level Data

2014 Mayoral Elections Ballot Box Level Data

Citation

For attribution, please cite this work as

Zopluoglu (2019, May 24). Cengiz Zopluoglu: 2019 Turkish Mayoral Elections – Scraping Ballot Box Level Data. Retrieved from https://github.com/czopluoglu/website/tree/master/docs/posts/local-elections-2019-turkey2/

BibTeX citation

@misc{zopluoglu20192019,
  author = {Zopluoglu, Cengiz},
  title = {Cengiz Zopluoglu: 2019 Turkish Mayoral Elections – Scraping Ballot Box Level Data},
  url = {https://github.com/czopluoglu/website/tree/master/docs/posts/local-elections-2019-turkey2/},
  year = {2019}
}