Get choices for a parameter
curl --request GET \
--url https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices \
--header 'x-apikey: <x-apikey>'import requests
url = "https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices"
headers = {"x-apikey": "<x-apikey>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-apikey': '<x-apikey>'}};
fetch('https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices', 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.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-apikey: <x-apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apikey", "<x-apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices")
.header("x-apikey", "<x-apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apikey"] = '<x-apikey>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "us",
"name": "United States"
},
{
"id": "gb",
"name": "United Kingdom"
}
],
"page": 1,
"limit": 100,
"has_next_page": false,
"total_count": 2
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Enrichments
Get choices for a parameter
Returns paginated choices for a select/mselect parameter. Use the q parameter to search, and page/limit for pagination.
GET
/
v1
/
enrichments
/
{enrichment_id}
/
params
/
{param_slug}
/
choices
Get choices for a parameter
curl --request GET \
--url https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices \
--header 'x-apikey: <x-apikey>'import requests
url = "https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices"
headers = {"x-apikey": "<x-apikey>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-apikey': '<x-apikey>'}};
fetch('https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices', 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.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-apikey: <x-apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-apikey", "<x-apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices")
.header("x-apikey", "<x-apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.databar.ai/v1/enrichments/{enrichment_id}/params/{param_slug}/choices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-apikey"] = '<x-apikey>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "us",
"name": "United States"
},
{
"id": "gb",
"name": "United Kingdom"
}
],
"page": 1,
"limit": 100,
"has_next_page": false,
"total_count": 2
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
API Key for authentication
Path Parameters
The ID of the enrichment
The parameter slug/name
Query Parameters
Search query to filter choices
Page number
Required range:
x >= 1Items per page (max 500)
Required range:
1 <= x <= 500⌘I