Global Economy & Trade

Monthly US trade balance with a partner

Exports minus general imports per month for one partner (or the world) and one HS code (or all commodities). Both sides are the Census customs-basis series, and the answer states the basis of each - /comtrade reports CIF imports, so its balance runs a few percent lower.

get/api/v1/census/trade/balance

Query parameters

partnerstring

Partner: 'world', or a Census partner code from /census/trade/partners (5700 = China, 0003 = European Union).

Partner: 'world', or a Census partner code from /census/trade/partners (5700 = China, 0003 = European Union).

commoditystring

'all', or an HS code of 2, 4 or 6 digits (27 = mineral fuels).

'all', or an HS code of 2, 4 or 6 digits (27 = mineral fuels).

fromstring nullable

First month YYYY-MM (default: 24 months before the latest published month).

First month YYYY-MM (default: 24 months before the latest published month).

tostring nullable

Last month YYYY-MM (default: open, to the latest published month).

Last month YYYY-MM (default: open, to the latest published month).

Response

One row per month with exports, imports and the balance in USD.

Example response

{
  "meta": {
    "endpoint": "/api/v1/fred/us/cpi",
    "data_time": "2026-04-16T14:30:00Z",
    "response_time": "2026-04-16T14:30:12Z",
    "provider": "Sugra API v1.0.1",
    "data_age_days": 8.532,
    "source": "sugra_crypto",
    "attribution": "Short interest and Reg SHO daily short volume data is owned by and sourced from FINRA (Financial Industry Regulatory Authority).",
    "fallback_chain": [
      "sugra_crypto",
      "sugra_finance"
    ],
    "period": "2026-Q1",
    "notes": "the UKMTO report behind these counts is dated 2026-08-21 and is 11 days old"
  }
}

Changes

Changed in 2 of the 23 revisions of this API.4

    • added the optional property meta/data_age_days to the response with the 200 status

      response-optional-property-added

    • added the optional property meta/notes to the response with the 200 status

      response-optional-property-added

    • added the optional property meta/period to the response with the 200 status

      response-optional-property-added

    • endpoint added

      endpoint-added