Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn Data API Python

Extract LinkedIn profile and company data using Python and MagicalAPI.

This repository is a simple starter kit for developers who want to fetch structured LinkedIn data for lead generation, sales automation, enrichment, and analytics.

What you can build

  • Lead generation tools
  • Sales prospect enrichment
  • B2B contact intelligence
  • Company data dashboards
  • Growth and marketing automation
  • CRM enrichment pipelines

Installation

git clone https://github.com/magicalapi/linkedin-data-api-python.git
cd linkedin-data-api-python

python -m venv .venv
source .venv/bin/activate

python -m pip install -r requirements.txt

Setup

Create a .env file:

cp .env.example .env

Add your API key:

MAG_API_KEY=your_api_key_here

Get your API key

  1. Go to https://panel.magicalapi.com/api-info
  2. Sign up
  3. Copy your API key
  4. Add it to your .env file

Important

This API works with LinkedIn usernames, not full URLs.

Example:

  • Profile: https://www.linkedin.com/in/conanobrien/conanobrien
  • Company: https://www.linkedin.com/company/google/google

Get LinkedIn profile data

python examples/get_profile_data.py

Example:

result = await client.profile_data.get_profile_data(
    profile_name="conanobrien"
)

Get LinkedIn company data

python examples/get_company_data.py

Example:

result = await client.company_data.get_company_data(
    company_username="google"
)

Batch LinkedIn data fetching

python examples/batch_linkedin_fetch.py

Example output

{
  "name": "Conan O'Brien",
  "headline": "Comedian, Writer, Producer",
  "location": "United States",
  "followers": 1000000,
  "experience": [],
  "education": []
}

Use the full MagicalAPI Python SDK

This repository focuses only on LinkedIn profile and company data.

For all MagicalAPI services, use the official SDK:

https://github.com/magicalapi/magicalapi-python

Supported MagicalAPI services

  • Resume Parser
  • Resume Checker
  • Resume Matcher
  • LinkedIn Profile Data
  • LinkedIn Company Data

License

MIT

Releases

Packages

Contributors