# Census US exports and imports by HS code

Monthly US trade in goods by Harmonized System commodity and partner country (values, quantities, shipping weights): exports with E_COMMODITY and ALL_VAL_MO. Needs flow, get and time. Served by US Census Bureau.

Monthly US trade in goods by Harmonized System commodity and partner country (values, quantities, shipping weights): exports with E_COMMODITY and ALL_VAL_MO, imports with I_COMMODITY and GEN_VAL_MO. Filter by month, commodity, HS level and Census country code ('5700' = China); rows come as arrays, first row = headers.

- Tool ID: `census/international-trade`
- Provider: [US Census Bureau](/providers/census.md)
- Capability: [Knowledge & research](/tools/knowledge.md)
- Price: no charge per call
- Authentication: an authorised Agentik workspace is required for execution, including zero-price tools.

## Pricing contract

No charge per call. A workspace is still needed so your agent can call it.


```json
{
  "model": "per_call",
  "amountUsd": 0
}
```

## Complete input schema


```json
{
  "type": "object",
  "properties": {
    "flow": {
      "type": "string",
      "enum": [
        "exports",
        "imports"
      ],
      "description": "Trade direction, e.g. 'exports'"
    },
    "get": {
      "type": "string",
      "minLength": 1,
      "maxLength": 800,
      "pattern": "^[A-Za-z0-9_(),.]+$",
      "description": "Variables, e.g. exports 'CTY_NAME,E_COMMODITY,E_COMMODITY_SDESC,ALL_VAL_MO' or imports 'CTY_NAME,I_COMMODITY,GEN_VAL_MO'"
    },
    "time": {
      "type": "string",
      "minLength": 4,
      "maxLength": 30,
      "pattern": "^(from )?[0-9]{4}(-[0-9]{2})?( to [0-9]{4}(-[0-9]{2})?)?$",
      "description": "Month or range, e.g. '2024-01' or 'from 2024-01 to 2024-06'"
    },
    "e_commodity": {
      "type": "string",
      "pattern": "^[0-9-]{1,10}$",
      "description": "Export HS code filter (exports only), e.g. '8703'"
    },
    "i_commodity": {
      "type": "string",
      "pattern": "^[0-9-]{1,10}$",
      "description": "Import HS code filter (imports only), e.g. '8703'"
    },
    "comm_lvl": {
      "type": "string",
      "enum": [
        "HS2",
        "HS4",
        "HS6",
        "HS10"
      ],
      "description": "Commodity detail level, e.g. 'HS4'"
    },
    "cty_code": {
      "type": "string",
      "pattern": "^[0-9A-Z-]{1,5}$",
      "description": "Census country code, e.g. '5700' China, '4280' Germany; '-' = all countries total"
    }
  },
  "required": [
    "flow",
    "get",
    "time"
  ],
  "additionalProperties": false
}
```

## Published example

This is the provider tool’s published example. Replace example values with the user’s requested inputs, respecting the schema; do not execute an example merely to test a connection.


```json
{
  "tool_id": "census/international-trade",
  "input": {
    "flow": "exports",
    "get": "CTY_NAME,E_COMMODITY,E_COMMODITY_SDESC,ALL_VAL_MO",
    "time": "2024-01",
    "e_commodity": "8703",
    "cty_code": "5700"
  }
}
```

## Execute and retrieve

Inspect again before execution, explain the price and obtain the required authority. Use MCP run_tool or POST /v1/run with this tool ID, valid input and an idempotency key. Save the returned run ID and follow the actual state. If Agentik answers that the tool is temporarily unavailable, do not retry it blindly; use discovery to propose an alternative.

A partial or uncertain result can still have consumed provider resources. Consult [billing](/docs/billing.md), [idempotency](/docs/idempotency.md) and [asynchronous results](/docs/async.md).

Licence: Public domain (U.S. Government work); Census Data API Terms of Service.

Attribution: This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau..

[Provider documentation](https://www.census.gov/foreign-trade/reference/guides/Guide_to_International_Trade_Datasets.pdf)

[REST inspection](https://api.agentik.cc/v1/tools/census/international-trade) · [OpenAPI](/openapi.json) · [Connection guide](/connect.md)

---

[HTML page](/providers/census/international-trade) · [Agent index](/llms.txt)
