Get companies in batch
curl --request POST \
--url https://api.fetchin.io/api/v1/company/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"companies": [
"https://www.linkedin.com/company/doctolib",
"microsoft",
"urn:li:fsd_company:1441"
]
}
'import requests
url = "https://api.fetchin.io/api/v1/company/batch"
payload = { "companies": ["https://www.linkedin.com/company/doctolib", "microsoft", "urn:li:fsd_company:1441"] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companies: [
'https://www.linkedin.com/company/doctolib',
'microsoft',
'urn:li:fsd_company:1441'
]
})
};
fetch('https://api.fetchin.io/api/v1/company/batch', 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.fetchin.io/api/v1/company/batch",
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([
'companies' => [
'https://www.linkedin.com/company/doctolib',
'microsoft',
'urn:li:fsd_company:1441'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.fetchin.io/api/v1/company/batch"
payload := strings.NewReader("{\n \"companies\": [\n \"https://www.linkedin.com/company/doctolib\",\n \"microsoft\",\n \"urn:li:fsd_company:1441\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.fetchin.io/api/v1/company/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companies\": [\n \"https://www.linkedin.com/company/doctolib\",\n \"microsoft\",\n \"urn:li:fsd_company:1441\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fetchin.io/api/v1/company/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companies\": [\n \"https://www.linkedin.com/company/doctolib\",\n \"microsoft\",\n \"urn:li:fsd_company:1441\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"input": "https://www.linkedin.com/company/doctolib",
"company": {
"id": "urn:li:fsd_company:4999584",
"companyId": "4999584",
"name": "Doctolib",
"publicIdentifier": "doctolib",
"url": "https://www.linkedin.com/company/doctolib/",
"websiteUrl": "https://careers.doctolib.com/",
"domain": "careers.doctolib.com",
"industry": "Software Development",
"employeeCount": 3714,
"employeeCountRange": { "start": 1001, "end": 5000 },
"followerCount": 323490,
"logoUrl": "https://media.licdn.com/dms/image/...",
"companyType": "Privately Held",
"companyTypeCode": "PRIVATELY_HELD"
}
},
{
"input": "microsoft",
"company": {
"id": "urn:li:fsd_company:1035",
"companyId": "1035",
"name": "Microsoft",
"publicIdentifier": "microsoft",
"url": "https://www.linkedin.com/company/microsoft/",
"industry": "Software Development",
"followerCount": 29282565,
"logoUrl": "https://media.licdn.com/dms/image/...",
"companyType": "Public Company",
"companyTypeCode": "PUBLIC_COMPANY",
"hashtags": ["microsoftlife", "microsoft"]
}
},
{
"input": "urn:li:fsd_company:1441",
"error": {
"code": "RATE_LIMITED",
"message": "Not fetched: the batch ran out of time waiting for your rate limit. Send it again in a smaller batch.",
"status": 429
}
},
{
"input": "this-company-does-not-exist-123",
"error": {
"code": "COMPANY_NOT_FOUND",
"message": "Unable to find company data from slug",
"status": 404
}
}
],
"found": 2,
"notFound": 1,
"failed": 1
}
{
"error": "'companies' accepts at most 50 entries (received 51).",
"code": "INVALID_PARAMETER"
}
{
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}
{
"error": "Quota exceeded. Upgrade your plan or wait for renewal.",
"code": "QUOTA_EXHAUSTED",
"details": {
"creditsRemaining": 12,
"subscriptionCreditsRemaining": 12,
"paygCreditsRemaining": 0,
"buyCreditsUrl": "https://fetchin.io/credits"
}
}
{
"error": "Rate limit exceeded. Try again later.",
"code": "RATE_LIMITED"
}
Company
Get Companies (Batch)
Fetch up to 50 companies in one call, billed only for the companies found
POST
/
api
/
v1
/
company
/
batch
Get companies in batch
curl --request POST \
--url https://api.fetchin.io/api/v1/company/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"companies": [
"https://www.linkedin.com/company/doctolib",
"microsoft",
"urn:li:fsd_company:1441"
]
}
'import requests
url = "https://api.fetchin.io/api/v1/company/batch"
payload = { "companies": ["https://www.linkedin.com/company/doctolib", "microsoft", "urn:li:fsd_company:1441"] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companies: [
'https://www.linkedin.com/company/doctolib',
'microsoft',
'urn:li:fsd_company:1441'
]
})
};
fetch('https://api.fetchin.io/api/v1/company/batch', 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.fetchin.io/api/v1/company/batch",
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([
'companies' => [
'https://www.linkedin.com/company/doctolib',
'microsoft',
'urn:li:fsd_company:1441'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.fetchin.io/api/v1/company/batch"
payload := strings.NewReader("{\n \"companies\": [\n \"https://www.linkedin.com/company/doctolib\",\n \"microsoft\",\n \"urn:li:fsd_company:1441\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.fetchin.io/api/v1/company/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companies\": [\n \"https://www.linkedin.com/company/doctolib\",\n \"microsoft\",\n \"urn:li:fsd_company:1441\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fetchin.io/api/v1/company/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companies\": [\n \"https://www.linkedin.com/company/doctolib\",\n \"microsoft\",\n \"urn:li:fsd_company:1441\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"input": "https://www.linkedin.com/company/doctolib",
"company": {
"id": "urn:li:fsd_company:4999584",
"companyId": "4999584",
"name": "Doctolib",
"publicIdentifier": "doctolib",
"url": "https://www.linkedin.com/company/doctolib/",
"websiteUrl": "https://careers.doctolib.com/",
"domain": "careers.doctolib.com",
"industry": "Software Development",
"employeeCount": 3714,
"employeeCountRange": { "start": 1001, "end": 5000 },
"followerCount": 323490,
"logoUrl": "https://media.licdn.com/dms/image/...",
"companyType": "Privately Held",
"companyTypeCode": "PRIVATELY_HELD"
}
},
{
"input": "microsoft",
"company": {
"id": "urn:li:fsd_company:1035",
"companyId": "1035",
"name": "Microsoft",
"publicIdentifier": "microsoft",
"url": "https://www.linkedin.com/company/microsoft/",
"industry": "Software Development",
"followerCount": 29282565,
"logoUrl": "https://media.licdn.com/dms/image/...",
"companyType": "Public Company",
"companyTypeCode": "PUBLIC_COMPANY",
"hashtags": ["microsoftlife", "microsoft"]
}
},
{
"input": "urn:li:fsd_company:1441",
"error": {
"code": "RATE_LIMITED",
"message": "Not fetched: the batch ran out of time waiting for your rate limit. Send it again in a smaller batch.",
"status": 429
}
},
{
"input": "this-company-does-not-exist-123",
"error": {
"code": "COMPANY_NOT_FOUND",
"message": "Unable to find company data from slug",
"status": 404
}
}
],
"found": 2,
"notFound": 1,
"failed": 1
}
{
"error": "'companies' accepts at most 50 entries (received 51).",
"code": "INVALID_PARAMETER"
}
{
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}
{
"error": "Quota exceeded. Upgrade your plan or wait for renewal.",
"code": "QUOTA_EXHAUSTED",
"details": {
"creditsRemaining": 12,
"subscriptionCreditsRemaining": 12,
"paygCreditsRemaining": 0,
"buyCreditsUrl": "https://fetchin.io/credits"
}
}
{
"error": "Rate limit exceeded. Try again later.",
"code": "RATE_LIMITED"
}
Endpoint
POST /api/v1/company/batch
The request is a JSON body, not query parameters, and the response is
200 even when some entries — or all of them — could not be fetched. Read
found, or each entry’s error, rather than the HTTP status.Authentication
Include your API key in the request header:X-API-Key: your-api-key-here
Billing
1 credit per company returned.
- An entry that is not found, fails, or cannot be used costs nothing: only
entries that come back with a
companyare billed. A batch that finds nothing costs 0. - The balance is checked for the whole batch before any work: a batch of
N distinct entries needs N credits available, otherwise it is refused with
402QUOTA_EXHAUSTEDand nothing is fetched. - Validation errors (
400) are free. - Duplicates are fetched and billed once — see
companiesbelow.
Rate limit
A batch uses your plan’s per-second rate limit, not a separate allowance. The request itself takes one unit like any call, and each company after the first consumes one more unit from the same budget, waiting for it when the window is full. A 50-company batch on a 5 req/s plan therefore takes about 10 seconds — the same as 50 separate calls — and any other traffic you send at the same time draws on the same budget. Entries that could not be fetched within 90 seconds come back with an errorRATE_LIMITED (status: 429) and are not billed. Send those again, in a smaller
batch. Plan a client timeout of at least 120 seconds.
See Rate Limits.
Request body
string[]
required
1 to 50 companies. Each entry is any input
Get Company accepts:
- Company page URL. Example:
https://www.linkedin.com/company/microsoft - Public identifier (universal name). Example:
microsoft - Company URN. Example:
urn:li:fsd_company:1035
400 INVALID_PARAMETER and free:- missing, empty or not an array —
'companies' must be an array of 1 to 50 company URLs, public identifiers or URNs. - more than 50 entries —
'companies' accepts at most 50 entries (received 51). - an entry that is not a non-empty string —
'companies[3]' must be a non-empty string.
Response
array
One entry per distinct input, in input order. Each entry has
input and
exactly one of company or error.Show Result entry
Show Result entry
string
The entry as you sent it (trimmed).
object
Present when the company was found: the same object as
Get Company returns (
id,
companyId, name, publicIdentifier, url, industry,
employeeCount, …). Billed 1 credit.object
Present when the company was not returned. Not billed.
Show Error object
Show Error object
string
The same codes as a single call —
COMPANY_NOT_FOUND when the company
does not exist, RATE_LIMITED when the batch ran out of time waiting
for your rate limit, INVALID_PARAMETER / INVALID_URN for an entry
that is not a usable company input, SERVICE_UNAVAILABLE or
INTERNAL_ERROR on our side.string
Human-readable description. Do not branch on it.
integer
The HTTP status a single Get Company
call would have returned for this entry:
404, 429, 400, 503, …integer
Entries returned with a
company — the number of credits billed.integer
Entries whose error has
status: 404.integer
Every other error (rate limit, invalid entry, failure on our side). Worth
retrying, except an invalid entry.
Example Request
curl -X POST "https://api.fetchin.io/api/v1/company/batch" \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"companies": [
"https://www.linkedin.com/company/doctolib",
"microsoft",
"urn:li:fsd_company:1441",
"this-company-does-not-exist-123"
]
}'
const response = await fetch('https://api.fetchin.io/api/v1/company/batch', {
method: 'POST',
headers: {
'X-API-Key': 'your-api-key-here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
companies: [
'https://www.linkedin.com/company/doctolib',
'microsoft',
'urn:li:fsd_company:1441',
'this-company-does-not-exist-123',
],
}),
});
const batch = await response.json();
for (const entry of batch.results) {
if (entry.company) console.log(entry.input, entry.company.name);
else console.log(entry.input, entry.error.code);
}
import requests
response = requests.post(
'https://api.fetchin.io/api/v1/company/batch',
headers={'X-API-Key': 'your-api-key-here'},
json={
'companies': [
'https://www.linkedin.com/company/doctolib',
'microsoft',
'urn:li:fsd_company:1441',
'this-company-does-not-exist-123',
],
},
timeout=120,
)
batch = response.json()
for entry in batch['results']:
if 'company' in entry:
print(entry['input'], entry['company']['name'])
else:
print(entry['input'], entry['error']['code'])
<?php
$ch = curl_init('https://api.fetchin.io/api/v1/company/batch');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: your-api-key-here',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'companies' => [
'https://www.linkedin.com/company/doctolib',
'microsoft',
'urn:li:fsd_company:1441',
'this-company-does-not-exist-123',
],
]));
$batch = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($batch);
?>
Example Response
{
"results": [
{
"input": "https://www.linkedin.com/company/doctolib",
"company": {
"id": "urn:li:fsd_company:4999584",
"companyId": "4999584",
"name": "Doctolib",
"publicIdentifier": "doctolib",
"url": "https://www.linkedin.com/company/doctolib/",
"websiteUrl": "https://careers.doctolib.com/",
"domain": "careers.doctolib.com",
"industry": "Software Development",
"employeeCount": 3714,
"employeeCountRange": { "start": 1001, "end": 5000 },
"followerCount": 323490,
"logoUrl": "https://media.licdn.com/dms/image/...",
"companyType": "Privately Held",
"companyTypeCode": "PRIVATELY_HELD"
}
},
{
"input": "microsoft",
"company": {
"id": "urn:li:fsd_company:1035",
"companyId": "1035",
"name": "Microsoft",
"publicIdentifier": "microsoft",
"url": "https://www.linkedin.com/company/microsoft/",
"industry": "Software Development",
"followerCount": 29282565,
"logoUrl": "https://media.licdn.com/dms/image/...",
"companyType": "Public Company",
"companyTypeCode": "PUBLIC_COMPANY",
"hashtags": ["microsoftlife", "microsoft"]
}
},
{
"input": "urn:li:fsd_company:1441",
"error": {
"code": "RATE_LIMITED",
"message": "Not fetched: the batch ran out of time waiting for your rate limit. Send it again in a smaller batch.",
"status": 429
}
},
{
"input": "this-company-does-not-exist-123",
"error": {
"code": "COMPANY_NOT_FOUND",
"message": "Unable to find company data from slug",
"status": 404
}
}
],
"found": 2,
"notFound": 1,
"failed": 1
}
{
"error": "'companies' accepts at most 50 entries (received 51).",
"code": "INVALID_PARAMETER"
}
{
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}
{
"error": "Quota exceeded. Upgrade your plan or wait for renewal.",
"code": "QUOTA_EXHAUSTED",
"details": {
"creditsRemaining": 12,
"subscriptionCreditsRemaining": 12,
"paygCreditsRemaining": 0,
"buyCreditsUrl": "https://fetchin.io/credits"
}
}
{
"error": "Rate limit exceeded. Try again later.",
"code": "RATE_LIMITED"
}
Errors
See Error Handling for the shared envelope. These are errors of the whole request; an entry that fails is reported in its ownerror inside a 200.
| HTTP | code | When | Credits |
|---|---|---|---|
400 | INVALID_PARAMETER | companies missing, empty, longer than 50, or holding an entry that is not a non-empty string; malformed JSON | 0 |
401 | UNAUTHENTICATED / INVALID_API_KEY | Missing or invalid X-API-Key | 0 |
402 | QUOTA_EXHAUSTED | Your balance is smaller than the number of distinct entries | 0 |
429 | RATE_LIMITED | Your per-second budget was already spent when the request arrived | 0 |
500 | INTERNAL_ERROR | An unexpected bug on our side | 0 |
Notes
A
404 costs 1 credit on Get Company,
but a not-found entry in a batch costs nothing.Retry only what failed: collect the
input of every entry whose error.status
is 429 or 5xx and send them again. A 404 will not change on a retry, a
400 entry needs fixing first, and entries returned with a company are
already billed.Authorizations
Body
application/json
1 to 50 companies, each a company page URL, a public identifier (universal name, e.g. microsoft) or a URN (urn:li:fsd_company:1035). Duplicates (same text, case-insensitive) are fetched, billed and returned once. Refused with a free 400: not an array or empty ('companies' must be an array of 1 to 50 company URLs, public identifiers or URNs.), more than 50 entries ('companies' accepts at most 50 entries (received N).), an entry that is not a non-empty string ('companies[i]' must be a non-empty string.).
Required array length:
1 - 50 elementsExample:
[
"https://www.linkedin.com/company/doctolib",
"microsoft",
"urn:li:fsd_company:1441"
]
Response
One result per distinct input, in input order. Billed 1 credit per entry returned with a company.