LinkedIn API

LinkedIn Company Profile API: How to Access Complete Company Data

Learn how to use the Fresh LinkedIn Scraper API to retrieve comprehensive LinkedIn company profile data without OAuth authentication.

LinkedIn Company Profile API: How to Access Complete Company Data

LinkedIn Company Profile API: How to Access Complete Company Data

Accessing LinkedIn company profile data programmatically can provide valuable insights for business intelligence, competitive analysis, and market research. In this guide, we'll explore how to use the Fresh LinkedIn Scraper API to retrieve comprehensive LinkedIn company profile information without complex OAuth authentication.

Table of Contents

Why Access LinkedIn Company Profiles?

LinkedIn company profiles contain a wealth of information that can be valuable for:

  • Market Research: Analyze company size, locations, and industries
  • Competitive Intelligence: Track competitor growth and funding
  • Lead Generation: Identify potential clients based on company attributes
  • Recruitment: Research potential employers or partners
  • Investment Research: Analyze company funding rounds and growth

The Fresh LinkedIn Scraper API

The Fresh LinkedIn Scraper API on RapidAPI provides a simple way to access LinkedIn company profile data without:

  • Complex OAuth authentication
  • LinkedIn developer program approval
  • Rate limiting concerns of direct scraping
  • Terms of service violations

How to Get LinkedIn Company Profile Data

To retrieve a company profile, you'll use the company profile endpoint with either a company name or LinkedIn URL.

API Endpoint

GET https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/profile

Request Parameters

Parameter Required Description
company Yes Company name or LinkedIn profile URL

Required Headers

x-rapidapi-host: fresh-linkedin-scraper-api.p.rapidapi.com
x-rapidapi-key: YOUR_RAPIDAPI_KEY

Example Request

curl --request GET \
	--url 'https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/profile?company=rapidapi' \
	--header 'x-rapidapi-host: fresh-linkedin-scraper-api.p.rapidapi.com'

Understanding the API Response

The API returns a comprehensive JSON object with detailed company information. Let's break down the key components of the response:

Company Basics

{
  "id": "10649600",
  "name": "Rapid",
  "universal_name": "rapidapi",
  "description": "RapidAPI is the world's largest API Hub where millions of developers find and connect to tens of thousands of public APIs.",
  "linkedin_url": "https://www.linkedin.com/company/rapidapi/",
  "website_url": "https://RapidAPI.com/"
}

Company Statistics

{
  "follower_count": 24383,
  "employee_count": 351,
  "employee_count_range": {
    "start": 51,
    "end": 200
  }
}

Company History and Location

{
  "founded_on": {
    "year": 2015
  },
  "headquarter": {
    "country": "US",
    "city": "San Francisco",
    "geographic_area": "California",
    "line1": "2 Shaw Alley",
    "line2": "Floor #4",
    "postal_code": "94105"
  }
}

Company Specialties and Industry

{
  "specialities": [
    "API Hub",
    "API",
    "Web",
    "Developers",
    "API Client",
    "REST API",
    "GraphQL"
  ],
  "industries": ["Information Technology & Services"]
}

Company Funding Information

{
  "funding_info": {
    "number_of_funding_rounds": 7,
    "last_funding_round": {
      "type": "Series D",
      "money_raised": {
        "amount": "150000000",
        "currency": "USD"
      },
      "announced_on": {
        "day": 23,
        "month": 3,
        "year": 2022
      }
    }
  }
}

Code Examples

Here are implementation examples in popular programming languages:

JavaScript/Node.js

const axios = require("axios");

const options = {
  method: "GET",
  url: "https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/profile",
  params: {
    company: "rapidapi",
  },
  headers: {
    "x-rapidapi-host": "fresh-linkedin-scraper-api.p.rapidapi.com",
    "x-rapidapi-key": "YOUR_RAPIDAPI_KEY",
  },
};

async function getCompanyProfile() {
  try {
    const response = await axios.request(options);
    console.log(response.data);
    return response.data;
  } catch (error) {
    console.error(error);
  }
}

getCompanyProfile();

Python

import requests

url = "https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/profile"

querystring = {"company":"rapidapi"}

headers = {
    "x-rapidapi-host": "fresh-linkedin-scraper-api.p.rapidapi.com",
    "x-rapidapi-key": "YOUR_RAPIDAPI_KEY"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.json())

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://fresh-linkedin-scraper-api.p.rapidapi.com/api/v1/company/profile?company=rapidapi",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-rapidapi-host: fresh-linkedin-scraper-api.p.rapidapi.com",
        "x-rapidapi-key: YOUR_RAPIDAPI_KEY"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}

Best Practices

When using the LinkedIn Company Profile API, follow these best practices:

1. Implement Error Handling

Always implement proper error handling to catch API errors and rate limiting:

try {
  const response = await axios.request(options);
  // Process successful response
} catch (error) {
  if (error.response) {
    // The API returned an error
    console.error(
      `Error ${error.response.status}: ${error.response.data.message}`
    );

    if (error.response.status === 429) {
      // Handle rate limit exceeded
      console.log("Rate limit exceeded. Try again later.");
    }
  } else {
    // Network error or request setup error
    console.error("Request failed:", error.message);
  }
}

2. Cache Responses

LinkedIn company profiles don't change frequently. Implement caching to reduce API calls:

const NodeCache = require("node-cache");
const cache = new NodeCache({ stdTTL: 86400 }); // Cache for 24 hours

async function getCompanyProfileWithCache(companyName) {
  const cacheKey = `company_${companyName}`;

  // Check if data exists in cache
  const cachedData = cache.get(cacheKey);
  if (cachedData) {
    return cachedData;
  }

  // Fetch new data
  const response = await axios.request({
    // API request options...
    params: { company: companyName },
  });

  // Store in cache
  cache.set(cacheKey, response.data);

  return response.data;
}

3. Process and Normalize Data

Transform the API response to extract only the fields you need:

function processCompanyData(apiResponse) {
  const { data } = apiResponse;

  return {
    name: data.name,
    description: data.description,
    website: data.website_url,
    industry: data.industries[0],
    size: data.employee_count,
    founded: data.founded_on.year,
    headquarters: `${data.headquarter.city}, ${data.headquarter.country}`,
    specialties: data.specialties.join(", "),
  };
}

By following this guide, you'll be able to effectively access and utilize LinkedIn company profile data through the Fresh LinkedIn Scraper API, enabling powerful business intelligence applications without the complexity of LinkedIn's official API.