Bulgarian Elections OpenData API

release: v1.1.0

This API provides JSON-formatted election data at different geographical levels, from individual voting sections up to country-wide totals.

Available Elections

API Structure

Each election date and the combined data provide access to four hierarchical levels:

Country Level

Access country-wide aggregated data:

/api/{election_date}/total/
/api/combined/total/

Regional Election Commission (RIK) Level

Access RIK level data (two-digit code):

/api/{election_date}/riks/{code}/
/api/combined/riks/{code}/

Municipality Level

Access municipality level data (four-digit code):

/api/{election_date}/municipalities/{code}/
/api/combined/municipalities/{code}/

Section Level

Access individual section data (nine-digit identifier):

/api/{election_date}/sections/{id}/
/api/combined/sections/{id}/

Common Reference Data

Static reference data is available at:

Custom Analytics

Specialized analytical views:

JSON Response Structure

All hierarchical levels (total, RIK, municipality, section) share the same JSON structure:

{
    "id": "Identifier (varies by level)",
    "e": "Election date (YYYYMMDD)",
    "prv": "Pre-registered voters",
    "rv": "Registered voters",
    "olv": "On-site listed voters",
    "v": "Total voters who voted",
    "db": "Distributed ballots",
    "uupb": "Unused paper ballots",
    "dpb": "Destroyed paper ballots",
    "ub": "Used ballots",
    "upb": "Used paper ballots",
    "umb": "Used machine ballots",
    "ipb": "Invalid paper ballots",
    "vv": "Valid votes",
    "vvp": "Valid votes for parties",
    "vvsn": "Valid votes for 'support none'",
    "vd": [
        {
            "id": "Party/candidate registration code",
            "n": "Party/candidate name",
            "p": "Paper votes",
            "m": "Machine votes",
            "md": "Machine data votes",
            "t": "Total votes"
        }
    ]
}
        

Combined Data Structure

For the combined endpoints (/api/combined/), the structure is modified to accommodate multiple elections:

{
    "id": "Identifier (varies by level)",
    "prv": [
        {
            "e": "Election date (YYYYMMDD)",
            "v": "Number of pre-registered voters"
        }
    ],
    "rv": [
        {
            "e": "Election date (YYYYMMDD)",
            "v": "Number of registered voters"
        }
    ],
    "vd": [
        {
            "id": "Party/candidate registration code",
            "n": "Party/candidate name",
            "p": [
                {
                    "e": "Election date (YYYYMMDD)",
                    "v": "Number of paper votes"
                }
            ],
            "m": [
                {
                    "e": "Election date (YYYYMMDD)",
                    "v": "Number of machine votes"
                }
            ],
            "t": [
                {
                    "e": "Election date (YYYYMMDD)",
                    "v": "Total number of votes"
                }
            ]
        }
    ]
}
        

Note: All numeric fields in the combined data structure are wrapped in arrays of objects with election date (e) and value (v).

License

This API data is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0).