curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"table": "Reporters"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes"
payload = { "table": "Reporters" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({table: 'Reporters'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'table' => 'Reporters'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes"
payload := strings.NewReader("{\n \"table\": \"Reporters\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"table\": \"Reporters\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"table\": \"Reporters\"\n}"
response = http.request(request)
puts response.read_body{
"codes": [
{
"entryEffectiveDate": "1900-01-01T00:00:00",
"id": "156",
"isGroup": false,
"reporterCode": 156,
"reporterCodeIsoAlpha2": "CN",
"reporterCodeIsoAlpha3": "CHN",
"reporterDesc": "China",
"reporterNote": "China",
"text": "China"
},
{
"entryEffectiveDate": "1900-01-01T00:00:00",
"id": "344",
"isGroup": false,
"reporterCode": 344,
"reporterCodeIsoAlpha2": "HK",
"reporterCodeIsoAlpha3": "HKG",
"reporterDesc": "China, Hong Kong SAR",
"reporterNote": "China, Hong Kong Special Administrative Region",
"text": "China, Hong Kong SAR"
},
{
"entryEffectiveDate": "1900-01-01T00:00:00",
"id": "446",
"isGroup": false,
"reporterCode": 446,
"reporterCodeIsoAlpha2": "MO",
"reporterCodeIsoAlpha3": "MAC",
"reporterDesc": "China, Macao SAR",
"reporterNote": "China, Macao Special Administrative Region",
"text": "China, Macao SAR"
}
],
"count": 3,
"matched": 3,
"observed_at_ms": 1792433743469,
"query": "China",
"source_url": "https://comtradeapi.un.org/files/v1/app/reference/Reporters.json",
"table": "Reporters",
"total": 255
}Reference codes
Resolve a country or product name to the numeric/HS code the other functions need (China -> 156, ‘static converters’ -> 850440), or list the valid flow, customs or transport codes.
curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"table": "Reporters"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes"
payload = { "table": "Reporters" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({table: 'Reporters'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'table' => 'Reporters'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes"
payload := strings.NewReader("{\n \"table\": \"Reporters\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"table\": \"Reporters\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"table\": \"Reporters\"\n}"
response = http.request(request)
puts response.read_body{
"codes": [
{
"entryEffectiveDate": "1900-01-01T00:00:00",
"id": "156",
"isGroup": false,
"reporterCode": 156,
"reporterCodeIsoAlpha2": "CN",
"reporterCodeIsoAlpha3": "CHN",
"reporterDesc": "China",
"reporterNote": "China",
"text": "China"
},
{
"entryEffectiveDate": "1900-01-01T00:00:00",
"id": "344",
"isGroup": false,
"reporterCode": 344,
"reporterCodeIsoAlpha2": "HK",
"reporterCodeIsoAlpha3": "HKG",
"reporterDesc": "China, Hong Kong SAR",
"reporterNote": "China, Hong Kong Special Administrative Region",
"text": "China, Hong Kong SAR"
},
{
"entryEffectiveDate": "1900-01-01T00:00:00",
"id": "446",
"isGroup": false,
"reporterCode": 446,
"reporterCodeIsoAlpha2": "MO",
"reporterCodeIsoAlpha3": "MAC",
"reporterDesc": "China, Macao SAR",
"reporterNote": "China, Macao Special Administrative Region",
"text": "China, Macao SAR"
}
],
"count": 3,
"matched": 3,
"observed_at_ms": 1792433743469,
"query": "China",
"source_url": "https://comtradeapi.un.org/files/v1/app/reference/Reporters.json",
"table": "Reporters",
"total": 255
}Request contract
- Method and path: POST /apis/v1/comtradeplus-un-org/trade-statistics/reference-codes
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes
{
"operationId": "comtradeplus-un-org.trade-statistics.reference-codes",
"method": "POST",
"path": "/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"examples": {
"provider": {
"summary": "Official provider example; checked against AIsa request constraints",
"value": {
"query": "China",
"table": "Reporters"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"limit": {
"default": 200,
"description": "Maximum rows returned after filtering (HS has 8262 rows).\n\nProvider reference: minimum 1; maximum 2000; default 200.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"max": 2000,
"min": 1
}
},
"query": {
"description": "Keep rows whose id or text contains this (case-insensitive).",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"table": {
"description": "Table name as listed above (case-sensitive, as the file is named). Pattern: ^[A-Za-z0-9]{1,32}$.",
"type": "string"
}
},
"required": [
"table"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based pricing. Default request estimate: $0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.Authorizations
Body
Response
A UN Comtrade reference code table (GET /files/v1/app/reference/{table}.json): Reporters, partnerAreas, HS (all editions combined), H0-H6, S1-S4, SS, B4, B5, EB, EB02, EB10, EB10S, tradeRegimes (flows), ModeOfTransportCodes, CustomsCodes, QuantityUnits, ModeOfSupply, Frequency, TradeDataItems. Optional case-insensitive substring filter on code and text; rows pass through with the table's own columns. An unknown table name is not_found.
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
codes | object[] | |
count | number | Rows returned. |
matched | number | Rows matching the query before limit. |
observed_at_ms | number | Unix milliseconds when this result was fetched. |
query | string | |
source_url | string | The comtradeapi.un.org request that produced this result. |
table | string | As requested. |
total | number | Rows in the table. |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.