/ General

Open Election API

What is it?

ElectionData.MY curates and publishes comprehensive data on Malaysian elections from 1954 to the present, covering every single person or party that has ever contested an election in Malaysia. This API is the programmatic interface to that data, specifically for developers who want to query it on demand rather than download static files.

All data is dedicated to the public domain (marked with CC0 1.0 Universal), so you are free to use this API for any purpose, commercial or otherwise, with or without attribution.

The API is free to access. We monitor for abuse, but there is no hard rate limit, and therefore no premium tier. All you need is an API key, which you can generate in seconds from the API Console.

Do I need this?

ElectionData.MY offers two methods to programmatically access the data: Direct access to static files via the open data lake (use the links provided via the Data Catalogue), or this open API.

The API and the data lake serve different use cases. To put it simply, use this API if you want to build public-facing products and don’t want to build/host your own backend; use the data lake if you want the entire dataset for analysis, local use, or to spin up your own backend (although you will hopefully first explore this API, which treats developers as first-class citizens).

To put it more thoroughly, use the API (dynamic queries) if…

  • You are building a dynamic application that queries election data on demand, e.g. a candidate lookup tool or a live election dashboard.
  • You are embedding election data into another product, such as a news app, civic platform, or data pipeline.
  • You need a stable, versioned interface with consistent response schemas, rather than writing custom parsing logic against raw files that may change structure over time.

Use the data lake (static files) instead if…

  • You need bulk data for analysis and research.
  • You are working in Python, R, or a BI tool and prefer direct file downloads over API calls.
  • You need geospatial or boundary data—we do not expose these via the API, as they are better served as static files (e.g. GeoJSON, GeoParquet, FlatGeobuf).
  • You want to explore all available datasets interactively before deciding what to build.