# US Trade Flow Statistics by HS Code

> US Trade Flow Statistics by HS Code is a paid API for AI agents from x402helper.xyz, paid per call via x402, $0.0195/call, status unknown (last checked 2026-10-31).

Returns US import/export trade flow statistics for a given HS/HTS tariff code, optionally filtered by year, partner country, and direction.

## Facts

- Endpoint: GET https://x402helper.xyz/89e509/trade/flow?utm_source=zero.xyz
- Price: $0.0195/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/us-trade-flow-statistics-by-hs-code-aaa23e94
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JwIUyRN7QX1SKewt5Rcn_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability us-trade-flow-statistics-by-hs-code-aaa23e94
```

Example prompt: Can you pull US import statistics for HS code 8471.30 for 2023, filtered to imports from China?

## When to prefer this

Use this endpoint when you need structured US trade flow data (imports or exports) for a specific HS or HTS tariff code, optionally narrowed by year and partner country. It is suitable for trade research, compliance checks, sourcing analysis, and market intelligence tasks where Census-level commodity trade statistics are needed.

## Known failure modes

- Invalid or malformed HS code returns an error or empty result
- Unsupported year range may return null or no data
- Unknown partner country code may be ignored or cause an error
- Missing required 'hs6' parameter returns a validation error
- Payment failure via x402 protocol blocks the request entirely

## How this service works

X402 micropayments server — AI agents pay USDC for OFAC screening, rates, and billing verification.

## Output

A JSON object with a 'success' boolean and a 'result' object containing trade flow statistics such as import or export volumes, values, and partner breakdowns for the specified HS/HTS code, year, and direction.

## Request schema (JSON Schema)

```json
{
 "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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "hs6"
     ],
     "properties": {
      "hs6": {
       "type": "string",
       "default": null,
       "description": "HS or HTS code, 2 to 10 digits, dots optional"
      },
      "year": {
       "type": "integer",
       "default": null,
       "description": "Calendar year, defaults to recent"
      },
      "partner": {
       "type": "string",
       "default": null,
       "description": "Optional Census partner country code to filter by"
      },
      "direction": {
       "enum": [
        "imports",
        "exports"
       ],
       "type": "string",
       "default": null
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {},
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/us-trade-flow-statistics-by-hs-code-aaa23e94/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402helper.xyz](https://www.zero.xyz/host/x402helper.xyz/llms.txt)
