Skip to main content
POST
/
accounts
/
headcount
Get company headcount by department
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": true
}
'
import requests

url = "https://app.pipecorn.com/api/v2/accounts/headcount"

payload = {
"company_linkedin_id": "1818",
"departments": ["Engineering", "Sales", "Finance"],
"live": True
}
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: true
})
};

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' => true
]),
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\": true\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\": true\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\": true\n}"

response = http.request(request)
puts response.read_body
{
  "Engineering": {
    "3_months_evolution": {
      "base_headcount": 8611,
      "current_headcount": 8681,
      "headcount_gain": 70,
      "headcount_gain_percentage": 1
    },
    "6_months_evolution": {
      "base_headcount": 8412,
      "current_headcount": 8681,
      "headcount_gain": 269,
      "headcount_gain_percentage": 3
    },
    "12_months_evolution": {
      "base_headcount": 8153,
      "current_headcount": 8681,
      "headcount_gain": 528,
      "headcount_gain_percentage": 6
    }
  },
  "Finance": {
    "3_months_evolution": {
      "base_headcount": 2801,
      "current_headcount": 2830,
      "headcount_gain": 29,
      "headcount_gain_percentage": 1
    },
    "6_months_evolution": {
      "base_headcount": 2774,
      "current_headcount": 2830,
      "headcount_gain": 56,
      "headcount_gain_percentage": 2
    },
    "12_months_evolution": {
      "base_headcount": 2659,
      "current_headcount": 2830,
      "headcount_gain": 171,
      "headcount_gain_percentage": 6
    }
  },
  "Sales": {
    "3_months_evolution": {
      "base_headcount": 6130,
      "current_headcount": 6258,
      "headcount_gain": 128,
      "headcount_gain_percentage": 2
    },
    "6_months_evolution": {
      "base_headcount": 5914,
      "current_headcount": 6258,
      "headcount_gain": 344,
      "headcount_gain_percentage": 6
    },
    "12_months_evolution": {
      "base_headcount": 5549,
      "current_headcount": 6258,
      "headcount_gain": 709,
      "headcount_gain_percentage": 13
    }
  }
}
{
"error": 400,
"message": "Please use only valid department values from the provided list."
}
{
"error": 123,
"message": "<string>"
}

Authorizations

X-API-KEY
string
header
required

Your API key

Body

application/json
company_linkedin_id
string
required

LinkedIn company identifier

Example:

"1818"

departments
enum<string>[]

List of departments to get headcount for. If not provided, returns data for all departments.

Available options:
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
Example:
["Engineering", "Sales", "Finance"]
live
boolean
default:true

Data source toggle. true (default) returns the live department headcount with 3/6/12-month evolution from LinkedIn. false answers from Pipecorn's companies database (Elasticsearch) instead — no integration required — returning only a current headcount snapshot (total_headcount plus departments with current_headcount), without any evolution data. A non-boolean value returns 422.

Example:

true

Response

Successfully retrieved headcount data

{key}
object