# Singapore Statistics API
> Official Singapore economic statistics straight from Statistics Singapore (SingStat) and its TableBuilder service — no key, read live. The cpi endpoint returns the Singapore Consumer Price Index (All Items, base 2024 = 100) for the latest month with the headline index plus the month-on-month and year-on-year changes, computed from the official index series. The cpi/series endpoint returns the historical monthly CPI index and year-on-year rate over the last N months, ready to chart. The cpi/groups endpoint breaks the latest CPI down across every published category (food and its sub-items, housing, transport and so on) with index and annual change for each. The table endpoint is a thin live gateway to any SingStat TableBuilder resource: pass a resource id and it returns each series with its latest value and point count, opening up SingStat's whole catalogue (GDP, population, trade, labour) beyond inflation. The meta endpoint documents the source. Live data from SingStat TableBuilder, lightly cached. Live. 5 endpoints. This serves Singapore national statistics; for the SGD exchange rate or policy rate use a central-bank / FX API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/singapore-stats-api/..."
```

## Pricing
- **Free** (Free) — 260 calls/Mo, 2 req/s
- **Basic** ($10/Mo) — 18,500 calls/Mo, 6 req/s
- **Pro** ($28/Mo) — 94,000 calls/Mo, 22 req/s
- **Mega** ($63/Mo) — 425,000 calls/Mo, 55 req/s

## Endpoints

### Inflation

#### `GET /v1/cpi` — Singapore CPI (latest month): index, MoM and YoY

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/singapore-stats-api/v1/cpi"
```

**Response:**
```json
{
    "data": {
        "base": "2024 = 100",
        "index": 102.052,
        "period": "2026 Apr",
        "source": "Statistics Singapore (SingStat TableBuilder, table M213751)",
        "country": "Singapore",
        "indicator": "Consumer Price Index (All Items)",
        "period_iso": "2026-04",
        "change_mom_pct": -0.34,
        "change_yoy_pct": 1.76
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:41.857Z",
        "request_id": "de53ea05-ef8a-4a3a-b6df-f6276c5bca8d"
    },
    "status": "ok",
    "message": "Singapore CPI retrieved",
    "success": true
}
```

#### `GET /v1/cpi/groups` — Latest CPI across all published categories

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/singapore-stats-api/v1/cpi/groups"
```

**Response:**
```json
{
    "data": {
        "base": "2024 = 100",
        "count": 23,
        "period": "2026 Apr",
        "source": "SingStat M213751",
        "country": "Singapore",
        "indicator": "CPI by category",
        "categories": [
            {
                "index": 102.052,
                "label": "All Items",
                "series_no": "1",
                "change_yoy_pct": 1.76
            },
            {
                "index": 102.73,
                "label": "Food",
                "series_no": "1.0",
                "change_yoy_pct": 1.64
            },
            {
                "index": 103.626,
                "label": "Food Excl Food & Beverage Serving Services",
                "series_no": "1.01",
                "change_yoy_pct": 2.32
            },
            {
                "index": 103.774,
                "label": "Rice & Cereal Products",
                "series_no": "1.01.1",
                "change_yoy_pct": 1.68
            },
            {
                "index": 103.602,
                "label": "Rice",
                "series_no": "1.01.1.1",
                "change_yoy_pct": -0.31
            },
            {
                "index": 102.328,
                "label": "Flour",
                "series_no": "1.01.1.2",
                "change_yoy_pct": 5.76
            },
            {
                "index": 103.339,
                "label": "Bread",
                "series_no": "1.01.1.3",
                "change_yoy_pct": 0.92
       
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/cpi/series` — Historical CPI index + YoY series

**Parameters:**
- `months` (query, optional, string) — Number of recent months (default 24, max 240) Example: `24`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/singapore-stats-api/v1/cpi/series?months=24"
```

**Response:**
```json
{
    "data": {
        "base": "2024 = 100",
        "count": 24,
        "series": [
            {
                "index": 100.209,
                "period": "2024 May",
                "period_iso": "2024-05",
                "change_yoy_pct": 3.12
            },
            {
                "index": 100.104,
                "period": "2024 Jun",
                "period_iso": "2024-06",
                "change_yoy_pct": 2.52
            },
            {
                "index": 99.818,
                "period": "2024 Jul",
                "period_iso": "2024-07",
                "change_yoy_pct": 2.46
            },
            {
                "index": 100.414,
                "period": "2024 Aug",
                "period_iso": "2024-08",
                "change_yoy_pct": 2.17
            },
            {
                "index": 100.645,
                "period": "2024 Sep",
                "period_iso": "2024-09",
                "change_yoy_pct": 1.89
            },
            {
                "index": 100.119,
                "period": "2024 Oct",
                "period_iso": "2024-10",
                "change_yoy_pct": 1.16
            },
            {
                "index": 100.387,
                "period": "2024 Nov",
                "period_iso": "2024-11",
                "change_yoy_pct": 1.6
            },
            {
                "index": 100.661,
                "period": "2024 Dec",
                "period_iso": "2024-12",
                "chan
…(truncated, see openapi.json for full schema)
```

### Catalogue

#### `GET /v1/table` — Fetch any SingStat TableBuilder resource

**Parameters:**
- `id` (query, optional, string) — SingStat resource id (default M213751 = CPI monthly) Example: `M213751`
- `limit` (query, optional, string) — Optional cap on time points returned

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/singapore-stats-api/v1/table?id=M213751"
```

**Response:**
```json
{
    "data": {
        "title": "Consumer Price Index (CPI), 2024 As Base Year, Monthly",
        "series": [
            {
                "label": "All Items",
                "latest": {
                    "value": 102.052,
                    "period": "2026 Apr",
                    "period_iso": "2026-04"
                },
                "series_no": "1",
                "data_points": 784
            },
            {
                "label": "Food",
                "latest": {
                    "value": 102.73,
                    "period": "2026 Apr",
                    "period_iso": "2026-04"
                },
                "series_no": "1.0",
                "data_points": 784
            },
            {
                "label": "Food Excl Food & Beverage Serving Services",
                "latest": {
                    "value": 103.626,
                    "period": "2026 Apr",
                    "period_iso": "2026-04"
                },
                "series_no": "1.01",
                "data_points": 436
            },
            {
                "label": "Rice & Cereal Products",
                "latest": {
                    "value": 103.774,
                    "period": "2026 Apr",
                    "period_iso": "2026-04"
                },
                "series_no": "1.01.1",
                "data_points": 256
            },
            {
                "label": "Rice",
                "latest": {
                    "value": 103.602
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — API metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/singapore-stats-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "api": "Statistics Singapore (SingStat) API",
        "notes": "Live data from SingStat TableBuilder; year-on-year and month-on-month changes computed from the index series. The table endpoint fetches any SingStat resource id.",
        "source": "Statistics Singapore — SingStat TableBuilder API (tablebuilder.singstat.gov.sg)",
        "country": "Singapore",
        "endpoints": [
            "/v1/cpi",
            "/v1/cpi/series",
            "/v1/cpi/groups",
            "/v1/table",
            "/v1/meta"
        ],
        "documentation": "https://singapore-stats-api.oanor.dev",
        "primary_table": "M213751 — Consumer Price Index, 2024 base year, monthly"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:46.164Z",
        "request_id": "54d3749d-a9a5-4ea2-a70b-25ba9bc2e115"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/singapore-stats-api
OpenAPI spec: https://www.oanor.com/api/singapore-stats-api/openapi.json
