Trade Tools
These tools answer questions like:
- "Who are the top exporters of semiconductors globally?"
- "What are Thailand's main trade partners for electronics?"
- "Has Vietnam's share of US electronics imports grown?"
- "What's the trade balance between the US and China for solar panels?"
- "Which countries dominate EV battery exports?"
Tools at a glanceβ
| Tool | What it does | Credits |
|---|---|---|
find_hs | Resolve a goods/services concept to an HS/EBOPS code | Free |
search_trade | Trade flows for a country over time | BYOK |
top_partners | Top trading partners for a country + product | BYOK |
top_traders | Countries ranked by trade in a product | BYOK |
trade_balance | Trade surplus/deficit for a country | BYOK |
:::info BYOK β Bring Your Own Key Comtrade data tools require a UN Comtrade API key connected to your account. Without a key, the tools return a call-to-action with a link to connect one. You can still answer from general knowledge in the meantime.
find_hs is always free β no key required.
:::
find_hs β Resolve a concept to a trade codeβ
Translates any goods or services concept to its UN Comtrade classification code. Always call this first β never guess an HS code.
- Goods β HS code (Harmonized System):
"semiconductors"β8542,"electric vehicles"β8703,"soybeans"β1201 - Services β EBOPS code:
"financial services"βSB,"tourism"βST
Works in any language: "ΰΈΰΈ΄ΰΈ" β semiconductor codes, "εε°δ½" β same.
Returns ranked candidates at multiple granularities (chapter / heading / subheading) β pick the level of specificity you need, then pass the code(s) to the Comtrade tools.
This resolver is free (0 credits).
search_trade β Trade flows over timeβ
Returns a country's exports or imports for a specific HS code over time β annual series showing how the flows evolved.
search_trade(
reporter="Thailand",
partner="US",
hs_code="8542", # semiconductors
flow="export",
from_year=2018
)
Key params:
reporterβ reporting country (name, ISO, or M49 code; resolved server-side)partnerβ counterpart country, or"World"for all partnershs_codeβ fromfind_hsflowβexportorimportfrom_year/to_yearβ year range
top_partners β Top trading partnersβ
Returns the top trading partners for a country in a specific product category β how much they traded and what share each partner represents.
top_partners(
reporter="Vietnam",
hs_code="8471", # computers
flow="export",
year=2023
)
Use this for: "Who buys Thailand's electronics?" or "Where does Germany source its lithium from?"
top_traders β Countries ranked by tradeβ
Returns countries ranked by how much they export or import a specific product. Pass multiple HS codes to combine them (e.g. chicken + pork in a single livestock total).
top_traders(
codes=["0207", "0203"], # chicken + pork combined
flow="export",
year=2023,
limit=15
)
Use this for: "Which countries dominate EV battery exports?" or "Who are the biggest rice exporters?"
trade_balance β Trade surplus and deficitβ
Returns the trade surplus or deficit for a country across all products (or a specific HS code), showing how the balance has evolved over time.
trade_balance(reporter="US", partner="China", from_year=2018)
trade_balance(reporter="Germany", hs_code="8703") # EVs only
Typical workflowβ
Trade questions typically follow this pattern:
1. find_hs("semiconductors") β hs_code: "8542" (free)
2. top_traders(codes=["8542"], flow="export", year=2023)
β Taiwan 38%, South Korea 22%, Netherlands 12% β¦
3. find_hs("electric vehicle batteries") β hs_code: "8507"
4. top_partners(reporter="China", hs_code="8507", flow="export")
β EU 34%, US 18%, Korea 11% β¦
When to use trade toolsβ
Trade context is most valuable as a backdrop for an investment read β not as a standalone answer:
| Scenario | Trade question to ask |
|---|---|
| Exporter facing tariffs | Which products are affected? β find_hs β search_trade |
| Supply chain analysis | Which countries dominate this input? β top_traders |
| Country/sector read | How dependent is this market on a single partner? β top_partners |
| Trade policy impact | How has the balance shifted since tariffs were applied? β trade_balance over time |
For a company with heavy cross-border revenue, asset_pulse returns revenue_by_region and related_assets β use those to identify which trade flows matter before querying Comtrade.
Routing guideβ
| You want to⦠| Use |
|---|---|
| Get an HS code for a product | find_hs (free, always do this first) |
| How have Thailand's chip exports changed? | find_hs β search_trade |
| Who are the biggest solar panel exporters? | find_hs β top_traders |
| Who does Japan buy its LNG from? | find_hs β top_partners |
| US-China trade balance in EVs | find_hs β trade_balance |