Trade Hs
by 1gateway in Developer tools
Use when you need South Korea's monthly trade for a product by HS code (e.g. 8542 chips, 870323 cars, 2710 petroleum). Data: Korea Customs Service, finalized monthly. Input: hs (2-10 digit prefix), optional month (YYYYMM, default latest), limit (1-100), sort (exports, imports, balance, total). Output: JSON totals (exports FOB, imports CIF, balance in USD, kg) with YoY % and 10-digit HSK lines with English HS descriptions and YoY. Example: ?hs=8542&month=202608
GET https://1gateway.dev/v1/trade/hs
Last 30 days
- Uptime
- 100%
- Response time
- 561 ms typical, 779 ms slowest 5%
- Last check
- 7 min ago
- Next check
- in 21 min
How to call it
GET https://1gateway.dev/v1/trade/hs
Each call costs $0.0045 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
GET https://1gateway.dev/v1/trade/hs?hs=8542&limit=20&month=202608&sort=exportsParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hs | string | Yes | HS code prefix, 2-10 digits (e.g. 8542 integrated circuits, 870323 passenger cars) |
limit | integer | No | Max 10-digit lines returned (1-100, default 20) Default: 20. |
month | string | No | Month YYYYMM (default: latest finalized month) |
sort | string | No | Line order (default exports) One of: exports, imports, balance, total. Default: "exports". |
Example response
The provider's example. We can't check it without paying.
Example response, 40 lines
{
"attribution": "Source: Korea Customs Service (관세청) trade statistics via data.go.kr (datasets 15157908, 15157941, 15101609; no usage restriction). 10-day figures are provision…",
"compareMonth": "2025-08",
"descriptionEn": "Electronic integrated circuits",
"descriptionLevel": "8542",
"hs": "8542",
"lineCount": 20,
"lines": [
{
"balanceUsd": 14762525118,
"descriptionEn": "Electronic integrated circuits; memories",
"exportsKg": 177730,
"exportsUsd": 15733149397,
"exportsYoyPct": 501.4,
"hs6": "854232",
"hsCode": "8542321010",
"importsKg": 41627,
"importsUsd": 970624279,
"importsYoyPct": 54.7,
"nameKo": "디램"
}
],
"month": "2026-08",
"notes": [
"Lines are Korea's 10-digit HSK codes under the requested prefix; descriptionEn is the international HS 6-digit description, nameKo the official Korean line nam…"
],
"sort": "exports",
"total": {
"balanceUsd": 28613943758,
"exportsKg": 1674296,
"exportsUsd": 38235698070,
"exportsYoyPct": 203.1,
"importsKg": 635066,
"importsUsd": 9621754312,
"importsYoyPct": 85.5,
"prevYearExportsUsd": 12615814759,
"prevYearImportsUsd": 5185580976
},
"unit": "USD (exports FOB, imports CIF); weights in kg (net)"
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.0045.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i 'https://1gateway.dev/v1/trade/hs?hs=8542&limit=20&month=202608&sort=exports'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - 'https://1gateway.dev/v1/trade/hs?hs=8542&limit=20&month=202608&sort=exports' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.0045 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.0045" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.0045 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2F1gateway.dev%2Fv1%2Ftrade%2Fhs
const res = await pay("https://1gateway.dev/v1/trade/hs?hs=8542&limit=20&month=202608&sort=exports");
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.0045 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.0045"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.get("https://1gateway.dev/v1/trade/hs?hs=8542&limit=20&month=202608&sort=exports")
print(res.status_code, res.text)Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 7 min ago | Passed | 402 | 601 ms | $0.0045 |
| 4 h ago | Passed | 402 | 44 ms | $0.0045 |
| 8 h ago | Passed | 402 | 117 ms | $0.0045 |
| 12 h ago | Passed | 402 | 488 ms | $0.0045 |
| 16 h ago | Passed | 402 | 164 ms | $0.0045 |
| 20 h ago | Passed | 402 | 788 ms | $0.0045 |
| 23 h ago | Passed | 402 | 568 ms | $0.0045 |
| 27 h ago | Passed | 402 | 519 ms | $0.0045 |
| 30 h ago | Passed | 402 | 561 ms | $0.0045 |
| 34 h ago | Passed | 402 | 666 ms | $0.0045 |
| 37 h ago | Passed | 402 | 496 ms | $0.0045 |
| 41 h ago | Passed | 402 | 779 ms | $0.0045 |
| 45 h ago | Passed | 402 | 615 ms | $0.0045 |
| 2 days ago | Passed | 402 | 616 ms | $0.0045 |
| 2 days ago | Passed | 402 | 615 ms | $0.0045 |