Mbs series
curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country_code": "156"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series"
payload = { "country_code": "156" }
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({country_code: '156'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series', 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/mbs-series",
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([
'country_code' => '156'
]),
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/mbs-series"
payload := strings.NewReader("{\n \"country_code\": \"156\"\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/mbs-series")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"country_code\": \"156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series")
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 \"country_code\": \"156\"\n}"
response = http.request(request)
puts response.read_body{
"count": 2,
"observations": [
{
"base_year": null,
"commodity_group_code": "1",
"commodity_group_name": "Total",
"country_code": 156,
"country_name": "China",
"currency_type": "$",
"estimation_type": "A",
"estimation_type_desc": "Actual",
"partner_country_code": 0,
"partner_country_name": "World",
"period": "201952",
"period_in_date": "01/01/2019",
"period_type": "A",
"series_type": "T35.A.V.$",
"table_type": "T35",
"table_type_desc": "Total trade - value",
"trade_flow": "X",
"trade_flow_desc": "Exports",
"value": 2500000,
"value_type": "V",
"value_unit": "M",
"year": 2019
},
{
"base_year": null,
"commodity_group_code": "1",
"commodity_group_name": "Total",
"country_code": 156,
"country_name": "China",
"currency_type": "$",
"estimation_type": "A",
"estimation_type_desc": "Actual",
"partner_country_code": 0,
"partner_country_name": "World",
"period": "201952",
"period_in_date": "01/01/2019",
"period_type": "A",
"series_type": "T35.A.V.$",
"table_type": "T35",
"table_type_desc": "Total trade - value",
"trade_flow": "M",
"trade_flow_desc": "Imports",
"value": 2070000,
"value_type": "V",
"value_unit": "M",
"year": 2019
}
],
"observed_at_ms": 1792433732675,
"request": {
"country_code": "156",
"period": null,
"period_type": "A",
"series_type": "T35.A.V.$",
"table_type": null,
"year": "2019"
},
"source_url": "https://comtradeapi.un.org/public/v1/getMBS?series_type=T35.A.V.%24&year=2019&country_code=156&period_type=A"
}
UN Comtrade (comtradeplus.un.org)
Mbs series
Headline total imports/exports of a country over time (back to 1946) in one call, rather than summing commodity rows; or the exchange-rate conversion factors behind them.
POST
https://api.aisa.one
/
apis
/
v1
/
comtradeplus-un-org
/
trade-statistics
/
mbs-series
Mbs series
curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country_code": "156"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series"
payload = { "country_code": "156" }
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({country_code: '156'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series', 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/mbs-series",
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([
'country_code' => '156'
]),
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/mbs-series"
payload := strings.NewReader("{\n \"country_code\": \"156\"\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/mbs-series")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"country_code\": \"156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series")
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 \"country_code\": \"156\"\n}"
response = http.request(request)
puts response.read_body{
"count": 2,
"observations": [
{
"base_year": null,
"commodity_group_code": "1",
"commodity_group_name": "Total",
"country_code": 156,
"country_name": "China",
"currency_type": "$",
"estimation_type": "A",
"estimation_type_desc": "Actual",
"partner_country_code": 0,
"partner_country_name": "World",
"period": "201952",
"period_in_date": "01/01/2019",
"period_type": "A",
"series_type": "T35.A.V.$",
"table_type": "T35",
"table_type_desc": "Total trade - value",
"trade_flow": "X",
"trade_flow_desc": "Exports",
"value": 2500000,
"value_type": "V",
"value_unit": "M",
"year": 2019
},
{
"base_year": null,
"commodity_group_code": "1",
"commodity_group_name": "Total",
"country_code": 156,
"country_name": "China",
"currency_type": "$",
"estimation_type": "A",
"estimation_type_desc": "Actual",
"partner_country_code": 0,
"partner_country_name": "World",
"period": "201952",
"period_in_date": "01/01/2019",
"period_type": "A",
"series_type": "T35.A.V.$",
"table_type": "T35",
"table_type_desc": "Total trade - value",
"trade_flow": "M",
"trade_flow_desc": "Imports",
"value": 2070000,
"value_type": "V",
"value_unit": "M",
"year": 2019
}
],
"observed_at_ms": 1792433732675,
"request": {
"country_code": "156",
"period": null,
"period_type": "A",
"series_type": "T35.A.V.$",
"table_type": null,
"year": "2019"
},
"source_url": "https://comtradeapi.un.org/public/v1/getMBS?series_type=T35.A.V.%24&year=2019&country_code=156&period_type=A"
}
Request contract
- Method and path: POST /apis/v1/comtradeplus-un-org/trade-statistics/mbs-series
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series
{
"operationId": "comtradeplus-un-org.trade-statistics.mbs-series",
"method": "POST",
"path": "/apis/v1/comtradeplus-un-org/trade-statistics/mbs-series",
"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": {
"country_code": "156",
"period_type": "A",
"year": "2019"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"country_code": {
"description": "UN M49 country code(s), comma-separated. Pattern: ^\\d{1,4}(,\\d{1,4})*$.",
"type": "string"
},
"period": {
"description": "Period(s) YYYY or YYYYMM, comma-separated. Pattern: ^\\d{4}(\\d{2})?(,\\d{4}(\\d{2})?)*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"period_type": {
"description": "Restrict to annual, quarterly or monthly observations.\n\nProvider reference: allowed values [\"A\", \"Q\", \"M\"].",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"A",
"Q",
"M"
]
}
},
"series_type": {
"default": "T35.A.V.$",
"description": "Table.frequency.measure.currency: T35 total trade value in USD, T38 conversion factors; A annual, Q quarterly, M monthly.\n\nProvider reference: allowed values [\"T35.A.V.$\", \"T35.Q.V.$\", \"T35.M.V.$\", \"T38.A.CF.\", \"T38.Q.CF.\", \"T38.M.CF.\"]; default \"T35.A.V.$\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"T35.A.V.$",
"T35.Q.V.$",
"T35.M.V.$",
"T38.A.CF.",
"T38.Q.CF.",
"T38.M.CF."
]
}
},
"table_type": {
"description": "Restrict to one MBS table.\n\nProvider reference: allowed values [\"T35\", \"T38\"].",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"T35",
"T38"
]
}
},
"year": {
"description": "Reference year(s), comma-separated; omit for every year. Pattern: ^\\d{4}(,\\d{4})*$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
}
},
"required": [
"country_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
application/json
Response
Monthly Bulletin of Statistics trade time series (GET /public/v1/getMBS): Table 35 total trade value (annual, quarterly or monthly, USD millions) and Table 38 conversion factors, for one or more countries.
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
count | number | |
observations | object[] | |
observed_at_ms | number | Unix milliseconds when this result was fetched. |
request | object | |
source_url | string | The comtradeapi.un.org request that produced this result. |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.