# External trade

## `GET /v1/trade` (key required)

Monthly merchandise **exports and imports by commodity**, from the Pakistan Bureau of Statistics' trade releases.

| Param | Type | Notes |
|---|---|---|
| `flow` | string | `export` or `import` |
| `commodity` | string | Commodity-name filter, partial and case-insensitive (e.g. `RICE`, `COTTON`, `PETROLEUM`) |
| `group` | string | Commodity-group filter (e.g. `FOOD GROUP`, `TEXTILE GROUP`) |
| `from`, `to` | date | Month window |
| `limit` | int | Default 1000 |
| `sort` | `asc`\|`desc` | Default `desc` |

```bash
curl -H "X-API-Key: pk_live_xxx" \
  "https://api.pakdatahub.com/v1/trade?flow=export&commodity=RICE&limit=2"
```

```json
{ "success": true, "count": 2, "data": [
  { "flow": "export", "commodity": "1.RICE", "group": "FOOD GROUP", "date": "2026-08-31",
    "unit": "M.T", "quantity": 308481.3520889, "value_pkr_mn": 53294.1391308608, "value_usd_th": 191791.4218023 },
  { "flow": "export", "commodity": "1.RICE / a) BASMATI", "group": "FOOD GROUP", "date": "2026-08-31",
    "unit": "M.T", "quantity": 77795.0193211, "value_pkr_mn": 24341.3079150581, "value_usd_th": 87612.2720203 } ] }
```

| Field | Meaning |
|---|---|
| `commodity` | PBS line item. Sub-items are parent-qualified, e.g. `1.RICE / a) BASMATI` |
| `unit` | Quantity unit (`M.T` = metric tonnes, `DOZ`, `SQM`, ...) |
| `value_pkr_mn` | Value in Rs million |
| `value_usd_th` | Value in US$ thousand |

**History:** roughly the trailing year of monthly releases (PBS rotates older files off its site), growing month by month.

For longer-run trade aggregates, use the SBP series in the `external` module: total exports and imports as per the balance of payments since 2003, and exports by country and commodity. See the [External dataset](https://pakdatahub.com/docs/data-external.md).

---
Source: https://pakdatahub.com/docs/api-trade - PakDataHub docs index: https://pakdatahub.com/docs/llms.txt
