Perform companies search

Learn how to search for companies on LinkedIn using Unipile API.

Whether you are using LinkedIn Classic or Sales Navigator, Unipile offers two methods tu run a search :

  • With filters : you provide any combination of parameters directly in the method body. E.g. : location, headcount, industry, etc.
  • From URL : you provide the URL of a LinkedIn native search so the filters can be automatically infered.

📘

Note about Search Parameters

Many of the search filters on LinkedIn work with IDs that reference parameters, rather than the parameters themselves.

For example, in the location filter, you cannot directly insert San Francisco, but instead you should use the corresponding city ID.

Each LinkedIn product has an associated endpoint on Unipile to help you find the IDs of the parameters you need:

📘

Note about pagination

Pagination on the endpoints in this guide uses exclusively the offset parameter.


Classic Search

Search with filters

To get a list of companies search results with filters, use the Perform Companies Search endpoint with a parameters body.

const { data } = await linkedInApi.performClassicCompaniesSearch({
  path: {
    account_id: "acc_123456789",
  },
  body: {
    keywords: 'Software development',
    location: ['01234', '56789'],
    industry: ['65321']
  },
});
companies = linked_in_api.perform_classic_companies_search(
    "acc_123456789",
    perform_classic_companies_search_request={
        "keywords": "Software development",
        "location": ["01234", "56789"],
        "industry": ["65321"],
    },
)
curl --request POST \
     --url https://api.unipile.com/v2/account_id/linkedin/search/companies \
     --header 'accept: application/json'  
     --data '
{
   "keywords": "Software development",
   "location": ["01234", "56789"],
   "industry": ["65321"]
}'

Search from URL

For a URL to be considered valid in the context of a companies search, it must match the following pattern : https://www.linkedin.com/search/results/companies.

To get a list of companies search results out of a URL, use Perform Classic Search from URL.

const { data } = await linkedInApi.performClassicSearchFromUrl({
  path: {
    account_id: "acc_123456789",
  },
  body: {
    url: "https://www.linkedin.com/search/results/companies?[...]",
  },
});
companies = linked_in_api.perform_classic_search_from_url(
    "acc_123456789",
    {"url": "https://www.linkedin.com/search/results/companies?[...]"},
)
curl --request POST \
     --url https://api.unipile.com/v2/account_id/linkedin/search \
     --header 'accept: application/json'  
     --data '
{
   "url": "https://www.linkedin.com/search/results/companies?[...]"
}'

Sales Navigator Search

In LinkedIn Sales Navigator lingo, companies are referred to as accounts.

Search with filters

To get a list of accounts search results with filters, use the Perform Accounts Search endpoint with a parameters body.

const { data } = await linkedInApi.performSalesCompaniesSearch({
  path: {
    account_id: "acc_123456789",
  },
  body: {
    keywords: 'CEO',
    seniority: {
     include: ['OWNER/PARTNER', 'DIRECTOR']
    }
  },
});
accounts = linked_in_api.perform_sales_companies_search(
    "acc_123456789",
    perform_sales_companies_search_request={
        "keywords": "CEO",
        "seniority": {
            "include": ["OWNER/PARTNER", "DIRECTOR"],
        },
    },
)
curl --request POST \
     --url https://api.unipile.com/v2/account_id/linkedin/sales-navigator/search/leads \
     --header 'accept: application/json'  
     --data '
{
   "keywords": "CEO",
   "seniority": {
      "include": ["OWNER/PARTNER", "DIRECTOR"]
   }
}'

Search from URL

For a URL to be considered valid in the context of an accounts search, it must match the following pattern : https://www.linkedin.com/sales/search/company.

To get a list of accounts search results out of a URL, use Perform Sales Navigator Search from URL.

const { data } = await linkedInApi.performSalesSearchFromUrl({
  path: {
    account_id: "acc_123456789",
  },
  body: {
    url: "https://www.linkedin.com/sales/search/company?[...]",
  },
});
accounts = linked_in_api.perform_sales_search_from_url(
    "acc_123456789",
    {"url": "https://www.linkedin.com/sales/search/company?[...]"},
)
curl --request POST \
     --url https://api.unipile.com/v2/account_id/linkedin/sales-navigator/search \
     --header 'accept: application/json'  
     --data '
{
   "url": "https://www.linkedin.com/sales/search/company?[...]"
}'