Sanctions Filter API
Retrieve aggregated filter options (country, topics, datasource) for a keyword, to be used as faceted filters in the page endpoint.
ENDPOINTS
POST /api/v1/sanctions/filter
Request parameters
keyword
string
Search keyword.
- Required:
Yes - Example:
MARKETS
datasourceType
integer
Data source type. 1 = collection, 2 = dataset.
- Required:
No - Example:
1
datasourceId
string
Data source ID.
- Required:
No - Example:
default
Request Example
{
"keyword": "MARKETS",
"datasourceType": 1,
"datasourceId": "default"
}
curl https://api.tradedata.io/api/v1/sanctions/filter \
-H "Authorization: Bearer yourTokenHere" \
-H "Content-Type: application/json" \
-d '{"keyword": "MARKETS", "datasourceType": 1, "datasourceId": "default"}'
import requests
response = requests.post(
"https://api.tradedata.io/api/v1/sanctions/filter",
headers={
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
json={
"keyword": "MARKETS",
"datasourceType": 1,
"datasourceId": "default",
},
)
print(response.json())
const response = await fetch("https://api.tradedata.io/api/v1/sanctions/filter", {
method: "POST",
headers: {
"Authorization": "Bearer yourTokenHere",
"Content-Type": "application/json",
},
body: JSON.stringify({
"keyword": "MARKETS",
"datasourceType": 1,
"datasourceId": "default"
}),
});
const data = await response.json();
<?php
$ch = curl_init("https://api.tradedata.io/api/v1/sanctions/filter");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer yourTokenHere",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"keyword" => "MARKETS",
"datasourceType" => 1,
"datasourceId" => "default"
]),
]);
echo curl_exec($ch);
Response parameters
data.country
array
Available country filter options.
data.country.count
integer
Number of matching entities in this country.
- Example:
112
data.country.iso3Code
string
Country ISO3 code.
- Example:
USA
data.country.countryName
string
Country name.
- Example:
United States
data.country.key
string
Country ISO2 key for use in f_country filter.
- Example:
us
data.topics
array
Available topic filter options.
data.topics.count
integer
Number of matching entities with this topic.
- Example:
117
data.topics.key
string
Topic key for use in f_topics filter.
- Example:
reg.action
data.datasource
array
Available datasource filter options.
data.datasource.count
integer
Number of matching entities from this datasource.
- Example:
105
data.datasource.name
string
Datasource name.
- Example:
US FINRA Enforcement Actions
data.datasource.key
string
Datasource key for use in f_datasource filter.
- Example:
us_finra_actions
Response Example
{
"code": 200,
"success": true,
"data": {
"country": [
{
"count": 112,
"iso3Code": "USA",
"countryName": "United States",
"key": "us"
}
],
"topics": [
{
"count": 117,
"key": "reg.action"
}
],
"datasource": [
{
"count": 105,
"name": "US FINRA Enforcement Actions",
"key": "us_finra_actions"
}
]
},
"msg": "OK",
"total": 0,
"pageSize": 0,
"current": 0,
"sumResult": null
}