Census Trade Trends
census_trade_trendsMonthly US trade trends with ONE trading partner, month-by-month imports and exports for a country, optionally narrowed to an HS commodity, to show seasonality and shifts. A country is required: an unfiltered monthly query spans every partner and the Census API cannot return it in time. For all-countries totals use census_imports / census_exports instead.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"country": "China",
"end_year": "2024",
"start_year": "2024"
},
"name": "census_trade_trends"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country | No | Country name in plain English (e.g., "Mexico"). Preferred, resolved for you. REQUIRED unless you pass country_code. | |
| hs_code | No | HS commodity code. Optional, omit for aggregate trade. | |
| end_year | No | End year (e.g., "2024"). Optional, defaults to the last fully-published year (last calendar year; Census publishes on a lag). | |
| start_year | No | Start year (e.g., "2022"). Optional, defaults to the same year as end_year, i.e. a single year. Maximum span 3 years. | |
| country_code | No | Census Schedule C country code (e.g. "5700" China, "2010" Mexico). NOT an ISO code. Prefer `country`. Satisfies the country requirement. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| months | Yes | Number of monthly data points | |
| trends | Yes | ||
| country | Yes | Resolved country name as Census reports it, or 'all' for all countries | |
| hs_code | Yes | HS commodity code or 'all' for aggregate | |
| end_year | Yes | End year of trend range | |
| start_year | Yes | Start year of trend range | |
| country_code | Yes | Census country code or 'all' for all countries |