# Kompas Indonesia Air Quality and Traffic API

> Kompas: air quality and weather forecasts for Indonesian cities, and traffic incidents by province

- Vendor: `kompasindonesiaairqualityandtr` · version 1.0 · category Weather · tags indonesia air quality api, jakarta aqi api, indonesia traffic api, jakarta traffic api, kompas api, indonesia weather api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/kompasindonesiaairqualityandtr
- This document: https://apiclay.com/docs/kompasindonesiaairqualityandtr.md
- OpenAPI 3.1: https://apiclay.com/api/kompasindonesiaairqualityandtr/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `kompasindonesiaairqualityandtr`
- Updated: 2026-11-18

## About

## Kompas Indonesia Air Quality and Traffic API

The data service behind kompas.com's air-quality and traffic widgets, run by Kompas Gramedia: for an Indonesian city, the air quality index and its status with temperature, wind, humidity, weather and chance of rain, hour by hour for today and day by day for the next week; and the traffic incidents reported in a province over a time window (congestion, accidents, closures, fuel shortages at toll rest areas), each classified with category, subcategory and severity, located to province, regency, district and village with coordinates, and linked to the source post.

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

Typical flow: POST `/air-quality` with `{"city": "jakarta"}`; `/traffic?province=DKI Jakarta&amp;from=2026-11-14 00:00:00&amp;to=2026-11-14 23:59:59`, then `page=2` while `total_pages` is larger.

### Routes

#### POST `/air-quality` - Air quality
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| city | body | string | yes | City in lower case, e.g. `jakarta`, `bandung`, `surabaya`, `medan`, `bogor`, `depok`, `tangerang`, `bekasi`. |

Returns: `city`, `province`, `current.weather` (hourly: `forecast_datetime`, `quality_index`, `quality_status`, `temperature`, `wind_speed`, `humidity`, `weather`, `rain_probability`) and `daily` (7 days with `temp_max` and `temp_min`).

#### GET `/traffic` - Traffic incidents
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| province | query | string | yes | Province, e.g. `DKI Jakarta`, `Jawa Barat`, `Jawa Timur`, `Banten`. |
| from | query | string | yes | Start, `YYYY-MM-DD HH:MM:SS` (Jakarta time). |
| to | query | string | yes | End, same format. |
| page | query | number | no | Page of 100 incidents. |

Returns: `total_records`, `page`, `page_size`, `total_pages` and `records`: `id`, `title`, `description`, `shortDescription`, `createdAt`, `location` (`full_address`, `province`, `regency`, `district`, `village`), `latitude`, `longitude`, `category`, `subcategory`, `severity`, `affectedPaths`, `alternativeRoutes`, `author`, `url` and `publisherName` of the source post.

### Caveats

- Statuses, weather and incident texts are in Indonesian. Traffic incidents are compiled from public posts by toll operators and traffic police; an unknown province or city returns no records or `invalid city`.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by kompas.com.

## 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.

### POST /air-quality — Air quality
- Gateway: `POST https://api.apiclay.com/v1/api/kompasindonesiaairqualityandtr/air-quality`
- Body sample (JSON):

```json
{"city": "jakarta"}
```

- 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 /traffic — Traffic incidents
- Gateway: `GET https://api.apiclay.com/v1/api/kompasindonesiaairqualityandtr/traffic`
- Public query params: `province` (string, required), `from` (string, required), `to` (string, required), `page` (number)
- 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 POST "https://api.apiclay.com/v1/api/kompasindonesiaairqualityandtr/air-quality" \
  -H "token: <YOUR_APICLAY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"city": "jakarta"}'
```

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