World share
curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "2019",
"reporter_code": "156"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share"
payload = {
"period": "2019",
"reporter_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({period: '2019', reporter_code: '156'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share', 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/world-share",
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' => '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/world-share"
payload := strings.NewReader("{\n \"period\": \"2019\",\n \"reporter_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/world-share")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"2019\",\n \"reporter_code\": \"156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share")
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\": \"156\"\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"observed_at_ms": 1792433707432,
"request": {
"freq_code": "A",
"period": "2019",
"reporter_code": "156",
"type_code": "C"
},
"shares": [
{
"data_count": 1,
"dataset_desc": "China CA 2019",
"first_released": "2020-10-27T04:41:22.7",
"freq_code": "A",
"is_available": true,
"last_released": "2022-05-21T09:34:45.3933333",
"period": "2019",
"reporter_code": 156,
"reporter_desc": "China",
"reporter_iso": "CHN",
"type_code": "C",
"world_share": 0.12031413468204072
}
],
"source_url": "https://comtradeapi.un.org/public/v1/getWorldShare/C/A?period=2019&reporterCode=156"
}UN Comtrade (comtradeplus.un.org)
World share
How large a reporter is in world goods or services trade in a year or month, and whether its figures for that period are published or estimated.
POST
https://api.aisa.one
/
apis
/
v1
/
comtradeplus-un-org
/
trade-statistics
/
world-share
World share
curl --request POST \
--url https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "2019",
"reporter_code": "156"
}
'import requests
url = "https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share"
payload = {
"period": "2019",
"reporter_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({period: '2019', reporter_code: '156'})
};
fetch('https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share', 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/world-share",
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' => '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/world-share"
payload := strings.NewReader("{\n \"period\": \"2019\",\n \"reporter_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/world-share")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"2019\",\n \"reporter_code\": \"156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share")
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\": \"156\"\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"observed_at_ms": 1792433707432,
"request": {
"freq_code": "A",
"period": "2019",
"reporter_code": "156",
"type_code": "C"
},
"shares": [
{
"data_count": 1,
"dataset_desc": "China CA 2019",
"first_released": "2020-10-27T04:41:22.7",
"freq_code": "A",
"is_available": true,
"last_released": "2022-05-21T09:34:45.3933333",
"period": "2019",
"reporter_code": 156,
"reporter_desc": "China",
"reporter_iso": "CHN",
"type_code": "C",
"world_share": 0.12031413468204072
}
],
"source_url": "https://comtradeapi.un.org/public/v1/getWorldShare/C/A?period=2019&reporterCode=156"
}Request contract
- Method and path: POST /apis/v1/comtradeplus-un-org/trade-statistics/world-share
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/world-share
{
"operationId": "comtradeplus-un-org.trade-statistics.world-share",
"method": "POST",
"path": "/apis/v1/comtradeplus-un-org/trade-statistics/world-share",
"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": {
"period": "2019",
"reporter_code": "156"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"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"
]
}
},
"period": {
"description": "Period(s) YYYY or YYYYMM, comma-separated, or `recent`. Pattern: ^(recent|\\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
application/json
Response
A reporter's share of world trade for a period, including UN estimates where the reporter has not published (GET /public/v1/getWorldShare/{type}/{freq}), with availability and release dates.
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. |
request | object | |
shares | 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.