census_trade_trends
Pack: census-trade · Endpoint: https://gateway.pipeworx.io/census-trade/mcp
Get monthly US trade trends for a commodity and/or country over time. Returns month-by-month values to identify seasonal patterns and shifts.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
hs_code | string | no | HS commodity code. Optional — omit for aggregate trade. |
country_code | string | no | Census country code. Optional — omit for all countries. |
start_year | string | yes | Start year (e.g., “2022”) |
end_year | string | yes | End year (e.g., “2024”) |
Example call
Arguments
{
"start_year": "2022",
"end_year": "2024"
}
curl
curl -X POST https://gateway.pipeworx.io/census-trade/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"census_trade_trends","arguments":{"start_year":"2022","end_year":"2024"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('census_trade_trends', {
"start_year": "2022",
"end_year": "2024"
});
More examples
{
"hs_code": "8471",
"country_code": "5700",
"start_year": "2021",
"end_year": "2024"
}
Response shape
Always returns: start_year, end_year, hs_code, country_code, months, trends
| Field | Type | Description |
|---|---|---|
start_year | string | Start year of trend range |
end_year | string | End year of trend range |
hs_code | string | HS commodity code or ‘all’ for aggregate |
country_code | string | Census country code or ‘all’ for all countries |
months | number | Number of monthly data points |
trends | array |
Full JSON Schema
{
"type": "object",
"properties": {
"start_year": {
"type": "string",
"description": "Start year of trend range"
},
"end_year": {
"type": "string",
"description": "End year of trend range"
},
"hs_code": {
"type": "string",
"description": "HS commodity code or 'all' for aggregate"
},
"country_code": {
"type": "string",
"description": "Census country code or 'all' for all countries"
},
"months": {
"type": "number",
"description": "Number of monthly data points"
},
"trends": {
"type": "array",
"items": {
"type": "object",
"properties": {
"period": {
"type": "string",
"description": "Month-year period"
},
"imports_usd": {
"type": "number",
"description": "Import value in USD for period"
},
"exports_usd": {
"type": "number",
"description": "Export value in USD for period"
},
"balance_usd": {
"type": "number",
"description": "Trade balance in USD for period"
}
},
"required": [
"period",
"imports_usd",
"exports_usd",
"balance_usd"
]
}
}
},
"required": [
"start_year",
"end_year",
"hs_code",
"country_code",
"months",
"trends"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"census-trade": {
"url": "https://gateway.pipeworx.io/census-trade/mcp"
}
}
}
See Getting Started for client-specific install steps.