# Malaysia Open Data API

> data.gov.my: Malaysian government data catalogue, DOSM statistics, weather forecasts and warnings

- Vendor: `malaysiaopendataapi` · version 1.0 · category Government Data · tags malaysia open data api, data.gov.my api, dosm api, malaysia fuel price api, malaysia weather api, malaysia statistics api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/malaysiaopendataapi
- This document: https://apiclay.com/docs/malaysiaopendataapi.md
- OpenAPI 3.1: https://apiclay.com/api/malaysiaopendataapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `malaysiaopendataapi`
- Updated: 2026-11-18

## About

## Malaysia Open Data API

Malaysia's official open data API (api.data.gov.my): query any dataset of the national data catalogue, such as weekly fuel prices or population by state, and the Department of Statistics (DOSM) series, such as the consumer price index, with filters, sorting, date ranges and column selection. Also the Meteorological Department's 7-day forecasts for every district and its active weather and earthquake warnings.

Data comes from **data.gov.my** (https://data.gov.my). Every route calls the source's own public API and returns it unchanged.

Typical flow: `/catalogue?id=fuelprice&amp;sort=-date&amp;limit=5`, `/dosm?id=cpi_core&amp;limit=12` or `/weather-forecast?contains=Langkawi@location__location_name`.

### Routes

#### GET `/catalogue` - Catalogue
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| id | query | string | yes | Dataset id from data.gov.my, e.g. `fuelprice`, `population_state` or (for `/dosm`) `cpi_core`. |
| limit | query | number | no | Rows to return. |
| filter | query | string | no | Exact match `value@column`, e.g. `Selangor@state`; comma-separate several. |
| ifilter | query | string | no | Case-insensitive exact match. |
| contains | query | string | no | Substring match `value@column`. |
| icontains | query | string | no | Case-insensitive substring match. |
| range | query | string | no | Numeric range `column[min:max]`. |
| sort | query | string | no | Column, `-` prefix for descending, e.g. `-date`. |
| date_start | query | string | no | `YYYY-MM-DD@date`: rows on or after. |
| date_end | query | string | no | `YYYY-MM-DD@date`: rows on or before. |
| include | query | string | no | Columns to keep. |
| exclude | query | string | no | Columns to drop. |

Returns: array of rows keyed by the dataset's columns.

#### GET `/dosm` - DOSM
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| id | query | string | yes | Dataset id from data.gov.my, e.g. `fuelprice`, `population_state` or (for `/dosm`) `cpi_core`. |
| limit | query | number | no | Rows to return. |
| filter | query | string | no | Exact match `value@column`, e.g. `Selangor@state`; comma-separate several. |
| ifilter | query | string | no | Case-insensitive exact match. |
| contains | query | string | no | Substring match `value@column`. |
| icontains | query | string | no | Case-insensitive substring match. |
| range | query | string | no | Numeric range `column[min:max]`. |
| sort | query | string | no | Column, `-` prefix for descending, e.g. `-date`. |
| date_start | query | string | no | `YYYY-MM-DD@date`: rows on or after. |
| date_end | query | string | no | `YYYY-MM-DD@date`: rows on or before. |
| include | query | string | no | Columns to keep. |
| exclude | query | string | no | Columns to drop. |

Returns: array of rows of the DOSM series.

#### GET `/weather-forecast` - Weather forecast
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | number | no | Rows to return. |
| contains | query | string | no | e.g. `Langkawi@location__location_name`. |
| filter | query | string | no | Exact match `value@column`. |
| sort | query | string | no | e.g. `date`. |

Returns: array of `location` (`location_id`, `location_name`), `date`, morning/afternoon/night forecast text, `summary_forecast`, `min_temp` and `max_temp`.

#### GET `/weather-warnings` - Weather warnings
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | number | no | Rows to return. |
| sort | query | string | no | Sort column. |

Returns: array of warnings with `warning_issue`, `valid_from`, `valid_to`, `heading_en` and `text_en`.

#### GET `/earthquakes` - Earthquakes
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | number | no | Rows to return. |
| sort | query | string | no | e.g. `-utcdatetime`. |

Returns: array of earthquakes with `utcdatetime`, `localdatetime`, `lat`, `lon`, `depth`, `magdefault` and `location`.

### Caveats

- Forecast and warning text is in Malay, with English fields (`text_en`, `heading_en`) for warnings.
- Data is under the Creative Commons Attribution 4.0 licence; credit data.gov.my and the source agency.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by data.gov.my.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /catalogue — Catalogue
- Gateway: `GET https://api.apiclay.com/v1/api/malaysiaopendataapi/catalogue`
- Public query params: `id` (string, required), `limit` (number), `filter` (string), `ifilter` (string), `contains` (string), `icontains` (string), `range` (string), `sort` (string), `date_start` (string), `date_end` (string), `include` (string), `exclude` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /dosm — DOSM
- Gateway: `GET https://api.apiclay.com/v1/api/malaysiaopendataapi/dosm`
- Public query params: `id` (string, required), `limit` (number), `filter` (string), `ifilter` (string), `contains` (string), `icontains` (string), `range` (string), `sort` (string), `date_start` (string), `date_end` (string), `include` (string), `exclude` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /weather-forecast — Weather forecast
- Gateway: `GET https://api.apiclay.com/v1/api/malaysiaopendataapi/weather-forecast`
- Public query params: `limit` (number), `contains` (string), `filter` (string), `sort` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /weather-warnings — Weather warnings
- Gateway: `GET https://api.apiclay.com/v1/api/malaysiaopendataapi/weather-warnings`
- Public query params: `limit` (number), `sort` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /earthquakes — Earthquakes
- Gateway: `GET https://api.apiclay.com/v1/api/malaysiaopendataapi/earthquakes`
- Public query params: `limit` (number), `sort` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/malaysiaopendataapi/catalogue?id=<id>" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
