{"uid":"cap_CjI_mPEZOm8zbqzVuQX6J","slug":"us-trade-flow-by-hs-code-census-bureau-21454125","name":"US Trade Flow by HS Code (Census Bureau)","description":"US monthly import or export trade flow for a commodity from the Census Bureau. Give an HS code, a direction and an optional partner country and get monthly values, a trend and a supplier-concentration index. Degrades cleanly when the Census key is not configured.","url":"https://api.agentstools.dev/trade/flow","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["hs6"],"properties":{"hs6":{"type":"string","description":"HS or HTS code, 2 to 10 digits, dots optional"},"year":{"type":"integer","description":"Calendar year, defaults to recent"},"partner":{"type":"string","description":"Optional Census partner country code to filter by"},"direction":{"enum":["imports","exports"],"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.015","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.015/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KT71mi3jFfhik6IyK8A04","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.015","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns monthly US import or export trade values, trend, and supplier-concentration index for a given HS commodity code, with optional partner-country filtering.","exampleAgentPrompt":"Can you pull the US import trade flow for HS code 847130 (laptops) for 2023, filtered to China as the partner country, and tell me the monthly values and how concentrated the supplier base is?","exampleUseCases":[{"title":"Monitor semiconductor supply chain risk","prompt":"Show me the monthly import trend for HS code 254712 (semiconductors) over the last year and calculate how concentrated our supplier base is—I need to know if we're over-dependent on any single country."},{"title":"Track agricultural export performance","prompt":"Pull the export data for HS code 100590 (corn and maize) for 2024 and break down the monthly values by top partner countries—I want to see if our sales volume is growing or declining."},{"title":"Benchmark competitor sourcing patterns","prompt":"Can you get the monthly US import values for HS code 620462 (apparel fabrics) filtered to Vietnam for the past 18 months, and tell me the trend direction so I can understand how our supply strategy compares to industry norms?"}],"resultDescription":"Returns monthly import or export trade values for the specified HS commodity code and year, along with a computed trend direction and a supplier-concentration index indicating how reliant US trade is on a small number of partners. Optionally filtered to a single Census partner country.","failureModes":["Invalid or unrecognized HS code returns an error or empty dataset","Census Bureau API key not configured causes graceful degradation with a clear error message","Partner country code not found in Census data returns empty results","Year requested is outside available Census data range","Rate limit or upstream Census API outage causes timeout or 5xx response"],"whenToPreferThis":"Use this endpoint when you need structured, monthly-level US import or export trade data for a specific commodity (by HS/HTS code) sourced directly from the Census Bureau, especially when you also want a pre-computed trend and supplier-concentration metric rather than raw data. Prefer this over general web searches or custom Census API queries when you need a clean, agent-ready JSON response with analytical enrichment.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:09:37.941Z","isFirstParty":false}