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

NameTypeRequiredDescription
hs_codestringnoHS commodity code. Optional — omit for aggregate trade.
country_codestringnoCensus country code. Optional — omit for all countries.
start_yearstringyesStart year (e.g., “2022”)
end_yearstringyesEnd 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

FieldTypeDescription
start_yearstringStart year of trend range
end_yearstringEnd year of trend range
hs_codestringHS commodity code or ‘all’ for aggregate
country_codestringCensus country code or ‘all’ for all countries
monthsnumberNumber of monthly data points
trendsarray
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.

Regenerated from source · build May 9, 2026