curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "2019",
"reporter_code": "842"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data"
payload = {
"period": "2019",
"reporter_code": "842"
}
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({period: '2019', reporter_code: '842'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data', 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/tariffline-data",
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([
'period' => '2019',
'reporter_code' => '842'
]),
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/tariffline-data"
payload := strings.NewReader("{\n \"period\": \"2019\",\n \"reporter_code\": \"842\"\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/tariffline-data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"2019\",\n \"reporter_code\": \"842\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data")
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 \"period\": \"2019\",\n \"reporter_code\": \"842\"\n}"
response = http.request(request)
puts response.read_bodyTariffline data
Which national tariff lines under an HS6 code a reporter traded with a partner in a period, with value, quantity and weight, e.g. USA imports from China under 850440 in 2019. For HS6-and-above aggregates use trade_data.
curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "2019",
"reporter_code": "842"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data"
payload = {
"period": "2019",
"reporter_code": "842"
}
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({period: '2019', reporter_code: '842'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data', 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/tariffline-data",
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([
'period' => '2019',
'reporter_code' => '842'
]),
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/tariffline-data"
payload := strings.NewReader("{\n \"period\": \"2019\",\n \"reporter_code\": \"842\"\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/tariffline-data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"2019\",\n \"reporter_code\": \"842\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data")
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 \"period\": \"2019\",\n \"reporter_code\": \"842\"\n}"
response = http.request(request)
puts response.read_bodyRequest contract
- Method and path: POST /apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data
{
"operationId": "comtradeplus-un-org.trade-statistics.tariffline-data",
"method": "POST",
"path": "/apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data",
"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": {
"cmd_code": "850440",
"flow_code": "M",
"partner_code": "352",
"period": "2019",
"reporter_code": "842"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"classification": {
"default": "HS",
"description": "HS edition in the URL path (tariffline is goods only).\n\nProvider reference: allowed values [\"HS\", \"H6\", \"H5\", \"H4\", \"H3\", \"H2\", \"H1\", \"H0\"]; default \"HS\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"HS",
"H6",
"H5",
"H4",
"H3",
"H2",
"H1",
"H0"
]
}
},
"cmd_code": {
"description": "Commodity code(s), comma-separated: HS6 codes select every national line beneath them; national 8-10 digit codes are accepted as the reporter publishes them. Pattern: ^[A-Za-z0-9]{1,12}(,[A-Za-z0-9]{1,12})*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"customs_code": {
"description": "Customs procedure code(s), comma-separated (C00 total). Pattern: ^[A-Za-z0-9]{1,4}(,[A-Za-z0-9]{1,4})*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"flow_code": {
"description": "Trade flow code(s), comma-separated: M import, X export, RM re-import, RX re-export, MIP/XIP/MOP/XOP/MIF/XIF/DX/FM sub-flows. Omit for every flow. Pattern: ^[A-Za-z]{1,3}(,[A-Za-z]{1,3})*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"freq_code": {
"default": "A",
"description": "Frequency: A annual (period YYYY), M monthly (period YYYYMM).\n\nProvider reference: allowed values [\"A\", \"M\"]; default \"A\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"A",
"M"
]
}
},
"include_desc": {
"description": "Ask the API for description and ISO columns.",
"type": "boolean",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"mot_code": {
"description": "Mode of transport code(s), comma-separated (0 total). Pattern: ^\\d{1,4}(,\\d{1,4})*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"partner2_code": {
"description": "Second partner (consignment) code(s), comma-separated. Pattern: ^\\d{1,4}(,\\d{1,4})*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"partner_code": {
"description": "Partner area code(s), comma-separated. 0 is World (the reporter's total); omit for a breakdown by every partner. Look codes up with reference_codes table=partnerAreas. Pattern: ^\\d{1,4}(,\\d{1,4})*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"period": {
"description": "Period(s) YYYY or YYYYMM, comma-separated. Pattern: ^\\d{4}(\\d{2})?(,\\d{4}(\\d{2})?)*$.",
"type": "string"
},
"reporter_code": {
"description": "UN M49 numeric reporter code(s), comma-separated (156 China, 842 USA, 276 Germany). Look codes up with reference_codes table=Reporters. Pattern: ^\\d{1,4}(,\\d{1,4})*$.",
"type": "string"
},
"type_code": {
"default": "C",
"description": "Type of trade: C commodities (goods), S services.\n\nProvider reference: allowed values [\"C\", \"S\"]; default \"C\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"C",
"S"
]
}
}
},
"required": [
"period",
"reporter_code"
],
"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
National tariff-line trade records (reporter's own 8-10 digit codes) from the public tariffline preview (GET /public/v1/previewTariffline/{type}/{freq}/{classification}). One request per call; the API silently caps the answer at 500 records and truncated says so. Tariffline rows carry no description for national codes (cmd_desc null) and mode of transport / customs / second partner only where the reporter publishes them.
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
count | number | |
observed_at_ms | number | Unix milliseconds when this result was fetched. |
records | object[] | |
request | object | The selection as sent upstream (defaults filled in). |
source_url | string | The comtradeapi.un.org request that produced this result. |
truncated | boolean | True when the answer hit the 500-record preview cap. |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.