# data.gov.my API

> Returns Malaysian open data including dataset rows, weather forecasts and warnings, fuel prices, and consumer price indices.

Category: Government & Open Data. Region: MY. 10 endpoints at `https://api.hoshime.com/v1/datagovmy/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/datagovmy
## GET /v1/datagovmy/catalogue

Rows of one open dataset of data.gov.my, such as the monthly consumer price index (cpi_headline).

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Data catalogue id, such as cpi_headline. (e.g. cpi_headline) |
| `limit` | integer | no | Items per page, 1 to 1000. (default 100) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `values` (map)

```bash
curl "https://api.hoshime.com/v1/datagovmy/catalogue?id=cpi_headline" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/weatherForecast

The daily weather forecast of the locations whose name contains the text, from the Malaysian Meteorological Department.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `location` | string | yes | Text in a location name, such as Selangor or Kuala Lumpur. (e.g. Selangor) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `afternoon` (string), `date` (string), `locationId` (string), `locationName` (string), `maxTemp` (integer (int64)), `minTemp` (integer (int64)), `morning` (string), `night` (string), `summary` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/weatherForecast?location=Selangor" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/weatherWarnings

The latest weather warnings issued for Malaysia, newest first.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `endAt` (string), `heading` (string), `instruction` (string), `issuedAt` (string), `startAt` (string), `text` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/weatherWarnings" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/fuelPrices

Weekly retail fuel prices in ringgit per litre: RON95, RON97 and diesel, newest first.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 500. (default 12) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `diesel` (string), `ron95` (string), `ron97` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/fuelPrices" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/cpiHeadline

Monthly consumer price index of Malaysia (base 2010 = 100) for the overall index and each division, newest first.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 500. (default 12) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `division` (string), `index` (number (double)), `state` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/cpiHeadline" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/cpiState

Monthly consumer price index of each Malaysian state, newest first.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 500. (default 12) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `division` (string), `index` (number (double)), `state` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/cpiState" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/cpiStrata

Monthly consumer price index of Malaysia split into urban and rural areas, for each division, newest first.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 500. (default 12) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `division` (string), `index` (number (double)), `strata` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/cpiStrata" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/labourForce

Monthly labour force survey of Malaysia: labour force, employed and unemployed in thousands, and the rates in per cent.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 500. (default 12) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `employed` (number (double)), `employmentPopulationRate` (number (double)), `labourForce` (number (double)), `outsideLabourForce` (number (double)), `participationRate` (number (double)), `unemployed` (number (double)), `unemploymentRate` (number (double))

```bash
curl "https://api.hoshime.com/v1/datagovmy/labourForce" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/gdpQuarterly

Quarterly gross domestic product of Malaysia at constant prices, in million ringgit, newest first.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 500. (default 12) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `series` (string), `value` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/gdpQuarterly" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/datagovmy/population

Population of each Malaysian state by year, in thousands, newest first; all ages and both sexes.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `state` | string | no | State name, such as Johor. Empty lists every state. (e.g. Johor) |
| `limit` | integer | no | Items per page, 1 to 1000. (default 100) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `population` (number (double)), `state` (string)

```bash
curl "https://api.hoshime.com/v1/datagovmy/population?state=Johor" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
