Look Up Census Trade CTY_CODE
census_trade_lookup_country_codeTranslate a country or trade-bloc name into the Census CTY_CODE needed to filter export/import data.
Instructions
Look up the Census Bureau Schedule C CTY_CODE (and country groupings like OPEC, NAFTA, European Union, or world regions) needed to filter census_trade_query_exports/imports by country.
The Census API filters trade data by a numeric CTY_CODE, not by country name (CTY_NAME can only be requested as a descriptive field alongside CTY_CODE, not used as a filter by itself). Use this tool to translate a country name into the code you need.
Args:
query (string): country/region/bloc name or partial name, e.g. "korea", "vietnam", "european union"
limit (number, default 10): max matches to return
response_format ('markdown' | 'json', default 'markdown')
Returns: Matching entries with their CTY_CODE, name, and ISO alpha-2 code (for individual countries) or just code+name (for groupings). Note South Korea is listed as "South Korea (Republic of Korea)" and North Korea as "North Korea (Democratic People's Republic of Korea)".
Examples:
Use when: "What's the country code for Vietnam?" -> query="vietnam" -> returns CTY_CODE 5520
Use when: "I want export data for all EU countries as a group" -> query="european union" -> returns CTY_CODE 0003, then pass that as CTY_CODE in census_trade_query_exports filters
Don't use when: You already have the CTY_CODE - go straight to census_trade_query_exports/imports.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of matches to return. | |
| query | Yes | Country, region, or trade-bloc name (or partial name) to search for, e.g. 'korea', 'european union', 'canada'. Case-insensitive substring match. | |
| response_format | No | Output format: 'markdown' for a human-readable table, or 'json' for machine-readable structured data. | markdown |