census_trade_balance

Pack: census-trade · Endpoint: https://gateway.pipeworx.io/census-trade/mcp

Check US trade balance with a specific country for a given year. Returns net trade value and breakdown by end-use commodity category.

Parameters

NameTypeRequiredDescription
country_codestringyesCensus country code (e.g., “5700” for China, “2010” for Mexico)
yearstringyesTrade year (e.g., “2024”)

Example call

Arguments

{
  "country_code": "5700",
  "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_balance","arguments":{"country_code":"5700","year":"2024"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('census_trade_balance', {
  "country_code": "5700",
  "year": "2024"
});

More examples

{
  "country_code": "2010",
  "year": "2023"
}

Response shape

Always returns: country, country_code, year, total_imports_usd, total_exports_usd, trade_balance_usd, deficit_or_surplus

FieldTypeDescription
countrystringCountry name
country_codestringCensus country code
yearstringTrade year
total_imports_usdnumberTotal imports in USD
total_exports_usdnumberTotal exports in USD
trade_balance_usdnumberNet trade balance (exports minus imports)
deficit_or_surplusstringTrade balance classification
Full JSON Schema
{
  "type": "object",
  "properties": {
    "country": {
      "type": "string",
      "description": "Country name"
    },
    "country_code": {
      "type": "string",
      "description": "Census country code"
    },
    "year": {
      "type": "string",
      "description": "Trade year"
    },
    "total_imports_usd": {
      "type": "number",
      "description": "Total imports in USD"
    },
    "total_exports_usd": {
      "type": "number",
      "description": "Total exports in USD"
    },
    "trade_balance_usd": {
      "type": "number",
      "description": "Net trade balance (exports minus imports)"
    },
    "deficit_or_surplus": {
      "type": "string",
      "enum": [
        "surplus",
        "deficit"
      ],
      "description": "Trade balance classification"
    }
  },
  "required": [
    "country",
    "country_code",
    "year",
    "total_imports_usd",
    "total_exports_usd",
    "trade_balance_usd",
    "deficit_or_surplus"
  ]
}

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