# Japan Trade Statistics API (UN Comtrade)

> Japan Trade Statistics API (UN Comtrade) is a paid API for AI agents from jp-data-api-production.up.railway.app, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Returns Japan bilateral import/export trade values by partner country and HS commodity code from UN Comtrade official data, in annual USD figures.

## Facts

- Endpoint: GET https://jp-data-api-production.up.railway.app/trade/japan
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/japan-trade-statistics-api-un-comtrade-a020bae4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kgaTeYci0IYU2MyWdqEII

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 japan-trade-statistics-api-un-comtrade-a020bae4
```

Example prompt: Pull Japan's export data to China (partner code 156) for 2023 — I'm doing a supply chain analysis and need the UN Comtrade bilateral trade values in USD.

## When to prefer this

Use this endpoint when you need official UN Comtrade bilateral trade statistics specifically for Japan — imports or exports by partner country and commodity — for supply chain research, market entry analysis, tariff impact studies, or trade flow monitoring. Prefer this over generic trade databases when Japan-specific HS-level annual data in USD is required.

## Known failure modes

- Invalid or unsupported year returns empty or error response
- Unknown UN partner country code returns no data
- Missing required query parameters may return all data or an error
- Data unavailable for very recent years not yet published by UN Comtrade
- Payment failure (HTTP 402) if x402 payment is not completed

## How this service works

Japan import export trade statistics (UN Comtrade official data): bilateral trade values by partner country and HS commodity code, annual USD. Use for supply chain research, market entry analysis, tariff impact studies, sourcing from Japan, semiconductor/auto/machinery trade flows.

## Output

Returns annual USD trade values for Japan's imports or exports with a specified partner country (or world aggregate), broken down by HS commodity code, sourced from UN Comtrade official data.

## 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": [],
     "properties": {
      "flow": {
       "type": "string",
       "description": "X=exports, M=imports"
      },
      "year": {
       "type": "string",
       "description": "e.g. 2023"
      },
      "partner": {
       "type": "string",
       "description": "UN country code, e.g. 842=USA, 156=China. 0=world"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/japan-trade-statistics-api-un-comtrade-a020bae4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from jp-data-api-production.up.railway.app](https://www.zero.xyz/host/jp-data-api-production.up.railway.app/llms.txt)
