curl --request POST \
--url https://app.pipecorn.com/api/v2/accounts/headcount \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"company_linkedin_id": "1818",
"departments": [
"Engineering",
"Sales",
"Finance"
],
"live": false
}
'import requests
url = "https://app.pipecorn.com/api/v2/accounts/headcount"
payload = {
"company_linkedin_id": "1818",
"departments": ["Engineering", "Sales", "Finance"],
"live": False
}
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({
company_linkedin_id: '1818',
departments: ['Engineering', 'Sales', 'Finance'],
live: false
})
};
fetch('https://app.pipecorn.com/api/v2/accounts/headcount', 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://app.pipecorn.com/api/v2/accounts/headcount",
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([
'company_linkedin_id' => '1818',
'departments' => [
'Engineering',
'Sales',
'Finance'
],
'live' => false
]),
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://app.pipecorn.com/api/v2/accounts/headcount"
payload := strings.NewReader("{\n \"company_linkedin_id\": \"1818\",\n \"departments\": [\n \"Engineering\",\n \"Sales\",\n \"Finance\"\n ],\n \"live\": false\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://app.pipecorn.com/api/v2/accounts/headcount")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_linkedin_id\": \"1818\",\n \"departments\": [\n \"Engineering\",\n \"Sales\",\n \"Finance\"\n ],\n \"live\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pipecorn.com/api/v2/accounts/headcount")
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 \"company_linkedin_id\": \"1818\",\n \"departments\": [\n \"Engineering\",\n \"Sales\",\n \"Finance\"\n ],\n \"live\": false\n}"
response = http.request(request)
puts response.read_bodyDepartment headcount
Retrieve headcount information for specified departments or all departments if none specified.
By default the data comes from Pipecorn’s companies database (live: false), with no integration required: a current snapshot per department, without evolution, in this shape:
{
"total_headcount": 18769,
"departments": {
"Engineering": { "current_headcount": 8681 },
"Sales": { "current_headcount": 6258 }
}
}
Set live: true to get the data live from LinkedIn instead, with 3/6/12-month evolution per department as documented below. It requires a connected Sales Navigator account.
Credits: 1 credit per request. A lookup that matches no company costs nothing.
Rate limit: 20 requests per second, on top of your plan’s per-minute request limit
curl --request POST \
--url https://app.pipecorn.com/api/v2/accounts/headcount \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"company_linkedin_id": "1818",
"departments": [
"Engineering",
"Sales",
"Finance"
],
"live": false
}
'import requests
url = "https://app.pipecorn.com/api/v2/accounts/headcount"
payload = {
"company_linkedin_id": "1818",
"departments": ["Engineering", "Sales", "Finance"],
"live": False
}
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({
company_linkedin_id: '1818',
departments: ['Engineering', 'Sales', 'Finance'],
live: false
})
};
fetch('https://app.pipecorn.com/api/v2/accounts/headcount', 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://app.pipecorn.com/api/v2/accounts/headcount",
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([
'company_linkedin_id' => '1818',
'departments' => [
'Engineering',
'Sales',
'Finance'
],
'live' => false
]),
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://app.pipecorn.com/api/v2/accounts/headcount"
payload := strings.NewReader("{\n \"company_linkedin_id\": \"1818\",\n \"departments\": [\n \"Engineering\",\n \"Sales\",\n \"Finance\"\n ],\n \"live\": false\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://app.pipecorn.com/api/v2/accounts/headcount")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_linkedin_id\": \"1818\",\n \"departments\": [\n \"Engineering\",\n \"Sales\",\n \"Finance\"\n ],\n \"live\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pipecorn.com/api/v2/accounts/headcount")
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 \"company_linkedin_id\": \"1818\",\n \"departments\": [\n \"Engineering\",\n \"Sales\",\n \"Finance\"\n ],\n \"live\": false\n}"
response = http.request(request)
puts response.read_bodyCompany identification
Provide one of:company_linkedin_id: the LinkedIn company identifiercompany_linkedin_url: the company’s LinkedIn profile URL (regular or Sales Navigator)
400. With live: true, the URL is resolved to its LinkedIn id; with live: false, the company is looked up by URL in the Pipecorn database.
{
"company_linkedin_url": "https://www.linkedin.com/company/microsoft",
"departments": ["Engineering", "Sales"],
"live": false
}
Credits and rate limits
- Credits: 1 credit per request, with
live: trueorlive: false. A lookup that matches no company (404) costs nothing. - 20 requests per second per user, on top of your plan’s per-minute limit (see Rate Limiting). The counter is shared with # people at company.
402 Payment Required and code: "insufficient_credits" before any lookup. A
workspace weekly credit limit returns 403 Forbidden with
code: "workspace_limit_exceeded" instead. See
Credit and limit errors.Headers
A unique value you generate per operation, such as a UUID. Retrying with the same key and the same body returns the stored response instead of running the request again, so a retry after a timeout never charges twice. Successful responses are kept for 24 hours; a failed request is not stored and can be retried with the same key.
255"4f1c2e9a-8a7d-4c1b-9f63-2d6e0b5a7c11"
Body
- Option 1
- Option 2
List of departments to get headcount for. If not provided, returns data for all departments.
Accounting, Administrative, Arts and Design, Business Development, Community and Social Services, Consulting, Customer Success and Support, Education, Engineering, Entrepreneurship, Finance, Healthcare Services, Human Resources, Information Technology, Legal, Marketing, Media and Communication, Military and Protective Services, Operations, Product Management, Program and Project Management, Purchasing, Quality Assurance, Real Estate, Research, Sales ["Engineering", "Sales", "Finance"]
Data source toggle. false (default) answers from Pipecorn's companies database (Elasticsearch), with no integration required, returning a current headcount snapshot (total_headcount plus departments with current_headcount) without evolution data. true returns the live department headcount with 3/6/12-month evolution from LinkedIn and requires a connected Sales Navigator account. A non-boolean value returns 422.
false
Was this page helpful?