Parlametar is a tool that aids political researchers and journalists in doing their job. It consists of several building blocks providing APIs for datasets gathered from the website of the Croatian parliament (Sabor) as well as visualisations of those datasets in an embeddable card format (like a Youtube video). The APIs are documented below, and so are links to Github with all the source code.
The Parladata API serves data as scraped from sabor.hr and it's affiliate domains. It creates a faithful copy, so mistakes in the original dataset will be present in Parladata. There might be mistakes in the parsed data. If you find any mistakes, please submit an issue. The most common mistake is wrongly assigning a speech to a person with a similar/same name. The API is divided into three main endpoints, p, pg, and s for MPs, parties (parliamentary groups), and sessions respectively.
The Parlalize API serves calculated and organized data and metrics. The calculations are performed on data accessible at the Parladata API endpoint. Most of the metrics are calculated every 24 hours or less with a few notable exceptions. If you want to access the data as it was calculated on a given day, append the date (localized to slovenian) behind the last slash in your query. The API is organized like Parladata but enforces grouping for endpoint URLs. /p for MPs, /pg for parliamentary groups, and /s for sessions.
The Parlasearch API serves as a de facto middleware between our SOLR instance and the outside world. It simplifies queries to make them more human friendly and serves as a "security" layer preventing strange queries that might impact the performance of our search engine. It also contains functions that calculate certain analyses that perform better when utilising SOLR. These results are then POSTed to Parlalize and served from there.
The code that runs Parlametar is released to the public domain. It belongs to you. Use it, fix it, reuse it, take it apart, or simply show your love. The links below will lead you to individual repositories. We encourage you to submit an issue, or, if you find the time, fix one. ;)
parladata
Parladata serves as the primary Popolo-compliant database and API for parliamentary data. In an ideal world, this is what our government would provide.
parlalize
Where the magic happens. Parlalize requests data from Parladata every 24 hours and runs all the calculations. It provides the data through a JSON API.
parlasearch
Parlasearch serves as the interface to our SOLR search engine. It provides several API endpoints to perform filtered or filterless searches.
parlanode
Provides the infrastructure to deploy embeddable, shareable cards. Provide a template and a JSON data URL and you're all set to embed and share your cards.
parlasite
Parlasite is what runs parlametar.hr. It's a simplish Node app that requests cards and injects their HTML where necessary (without iframes).
We had a couple of presentations to the local developer community, you can find the slides below. Leave a comment if you want to know more. :)