curl --request POST \
--url https://api.datalegion.ai/company/enrich/bulk \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"domain": "acme.com",
"metadata": {
"crm_id": "abc-123"
}
},
{
"company_name": "Globex",
"metadata": {
"crm_id": "def-456"
}
}
]
}
'import requests
url = "https://api.datalegion.ai/company/enrich/bulk"
payload = { "items": [
{
"domain": "acme.com",
"metadata": { "crm_id": "abc-123" }
},
{
"company_name": "Globex",
"metadata": { "crm_id": "def-456" }
}
] }
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{domain: 'acme.com', metadata: {crm_id: 'abc-123'}},
{company_name: 'Globex', metadata: {crm_id: 'def-456'}}
]
})
};
fetch('https://api.datalegion.ai/company/enrich/bulk', 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.datalegion.ai/company/enrich/bulk",
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([
'items' => [
[
'domain' => 'acme.com',
'metadata' => [
'crm_id' => 'abc-123'
]
],
[
'company_name' => 'Globex',
'metadata' => [
'crm_id' => 'def-456'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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.datalegion.ai/company/enrich/bulk"
payload := strings.NewReader("{\n \"items\": [\n {\n \"domain\": \"acme.com\",\n \"metadata\": {\n \"crm_id\": \"abc-123\"\n }\n },\n {\n \"company_name\": \"Globex\",\n \"metadata\": {\n \"crm_id\": \"def-456\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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.datalegion.ai/company/enrich/bulk")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"domain\": \"acme.com\",\n \"metadata\": {\n \"crm_id\": \"abc-123\"\n }\n },\n {\n \"company_name\": \"Globex\",\n \"metadata\": {\n \"crm_id\": \"def-456\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/company/enrich/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"domain\": \"acme.com\",\n \"metadata\": {\n \"crm_id\": \"abc-123\"\n }\n },\n {\n \"company_name\": \"Globex\",\n \"metadata\": {\n \"crm_id\": \"def-456\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"matches": [
{
"company": {
"legion_id": "c8a1b2c3-d4e5-6f7a-8b9c-0d1e2f3a4b5c",
"company_name": "acme corp",
"company_domain": "acme.com"
},
"match_metadata": {
"matched_on": [
"domain"
],
"match_type": "exact",
"match_confidence": "high"
}
}
],
"total": 1,
"metadata": {
"crm_id": "abc-123"
}
},
{
"error": "No company found matching the provided parameters.",
"metadata": {
"crm_id": "def-456"
}
}
]
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Company Bulk Enrichment (Beta)
Company Bulk Enrichment API endpoint: match and enrich up to 50 companies in a single request, each item billed independently and returned in input order.
curl --request POST \
--url https://api.datalegion.ai/company/enrich/bulk \
--header 'API-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"domain": "acme.com",
"metadata": {
"crm_id": "abc-123"
}
},
{
"company_name": "Globex",
"metadata": {
"crm_id": "def-456"
}
}
]
}
'import requests
url = "https://api.datalegion.ai/company/enrich/bulk"
payload = { "items": [
{
"domain": "acme.com",
"metadata": { "crm_id": "abc-123" }
},
{
"company_name": "Globex",
"metadata": { "crm_id": "def-456" }
}
] }
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{domain: 'acme.com', metadata: {crm_id: 'abc-123'}},
{company_name: 'Globex', metadata: {crm_id: 'def-456'}}
]
})
};
fetch('https://api.datalegion.ai/company/enrich/bulk', 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.datalegion.ai/company/enrich/bulk",
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([
'items' => [
[
'domain' => 'acme.com',
'metadata' => [
'crm_id' => 'abc-123'
]
],
[
'company_name' => 'Globex',
'metadata' => [
'crm_id' => 'def-456'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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.datalegion.ai/company/enrich/bulk"
payload := strings.NewReader("{\n \"items\": [\n {\n \"domain\": \"acme.com\",\n \"metadata\": {\n \"crm_id\": \"abc-123\"\n }\n },\n {\n \"company_name\": \"Globex\",\n \"metadata\": {\n \"crm_id\": \"def-456\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Key", "<api-key>")
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.datalegion.ai/company/enrich/bulk")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"domain\": \"acme.com\",\n \"metadata\": {\n \"crm_id\": \"abc-123\"\n }\n },\n {\n \"company_name\": \"Globex\",\n \"metadata\": {\n \"crm_id\": \"def-456\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalegion.ai/company/enrich/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"domain\": \"acme.com\",\n \"metadata\": {\n \"crm_id\": \"abc-123\"\n }\n },\n {\n \"company_name\": \"Globex\",\n \"metadata\": {\n \"crm_id\": \"def-456\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"matches": [
{
"company": {
"legion_id": "c8a1b2c3-d4e5-6f7a-8b9c-0d1e2f3a4b5c",
"company_name": "acme corp",
"company_domain": "acme.com"
},
"match_metadata": {
"matched_on": [
"domain"
],
"match_type": "exact",
"match_confidence": "high"
}
}
],
"total": 1,
"metadata": {
"crm_id": "abc-123"
}
},
{
"error": "No company found matching the provided parameters.",
"metadata": {
"crm_id": "def-456"
}
}
]
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}/company/enrich call. Bulk is a throughput tool, not a discount or a latency shortcut.
How it works
- Per item: send the identifiers you already have for each company. Every item accepts the full set of
/company/enrichidentifiers and options (see Company Enrichment for the minimum-requirement rules). - Defaults vs. overrides: top-level flags (
multiple_resultsandlimit, an enterprise feature switched on per account,min_confidence,include_fields,exclude_fields, …) apply to every item. Set the same flag on an individual item to override the default for that item. - Order preserved:
resultsare returned in the same order asitems. Each slot independently reports itsmatches, or anerrorif that item didn’t match. A per-item failure never fails the whole batch. - Synchronous: all results come back in one response. There is no job ID or polling.
Billing
Each item is billed exactly like a standalone/company/enrich call, following your account’s existing billing model. Bulk is a throughput convenience and doesn’t change your pricing. An upfront check verifies the maximum possible cost of the batch before processing.
Identifiers and metadata
Each item carries the same identifiers as single enrichment, plus an optionalmetadata object (up to 10 keys) that is echoed back unchanged on that item’s result so you can map results to your own records. Values must be primitive: string, number, or boolean. Nested objects and arrays are rejected.
{
"items": [
{ "domain": "acme.com", "metadata": { "crm_id": "abc-123" } },
{ "name": "Globex", "metadata": { "crm_id": "def-456" } }
]
}
Limits and rate limits
| Limit | Value |
|---|---|
| Max items per request | 50 |
| Default rate limit | 10 requests/min (each up to 50 records) |
| Max payload size | 1 MB |
Batch size guidance
- Real-time (interactive SLA): keep batches small (10–20 items).
- Asynchronous backfill: use full 50-item batches and fan out multiple requests concurrently.
Authorizations
Body
Bulk company enrichment request. Top-level flags act as defaults applied to every item; per-item flags override them.
List of company enrichment requests (1-50 items).
1 - 50 elementsShow child attributes
Show child attributes
Default for all items: if true, return multiple matches sorted by confidence. Enterprise only: enabled per account (ask your account manager or support@datalegion.ai); without it the request answers 403 feature_not_available. Each match returned is billed.
Default for all items: maximum number of results per item when multiple_results=true (default: 2, max: 10).
1 <= x <= 10Default for all items: minimum match confidence level to include ('high', 'moderate', or 'low').
Default for all items: if true, format text fields in title case.
Default for all items: comma-separated list of fields that must be present, else the match is filtered out.
Default for all items: comma-separated list of fields to include in the response. If omitted, all fields are returned.
Default for all items: comma-separated list of fields to exclude from the response. Applied after include_fields.
If true, pretty-print the JSON response with indentation.
Response
Per-item results, in input order (each item is a match set or an error)
Bulk company enrichment response.
Per-item results, in the same order as the input items.
Show child attributes
Show child attributes