{"uid":"cap_Xlrz4U3JSVFoOK5iY247l","slug":"us-trade-flow-by-hs-code-census-bureau-via-payai-agentstools-dev-d88f2cff","name":"US Trade Flow by HS Code (Census Bureau via payai.agentstools.dev)","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://payai.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_O6k1fRBGSsy7hDYVJ_F2_","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 US monthly import or export trade flow data for a commodity (by HS code), including monthly values, trend, and supplier-concentration index, optionally filtered by partner country.","exampleAgentPrompt":"Pull me the US monthly import trade flow for HS code 8542 (integrated circuits) for 2023, and flag if China is a major supplier — include the supplier-concentration index.","exampleUseCases":null,"resultDescription":"Returns monthly trade values (in USD) for the requested commodity and direction, a computed trend indicator, a supplier-concentration index (e.g. HHI-style), and optionally data filtered by a specific partner country. Degrades gracefully if the Census API key is not configured.","failureModes":["Invalid or unrecognized HS code returns an error or empty result","Census Bureau API key not configured — endpoint degrades cleanly but may return limited/no data","Invalid direction value (not 'imports' or 'exports') returns a validation error","Requested year outside available Census data range returns empty or error","Invalid partner country code returns no filtered data or an error"],"whenToPreferThis":"Use this endpoint when you need structured, time-series US trade flow data for a specific commodity identified by HS/HTS code, including trend analysis and supply concentration metrics. Prefer this over raw Census Bureau APIs when you want normalized monthly values and a pre-computed concentration index without managing Census API credentials directly.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:04:03.648Z","isFirstParty":false}