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.
- Lead generation tools
- Sales prospect enrichment
- B2B contact intelligence
- Company data dashboards
- Growth and marketing automation
- CRM enrichment pipelines
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.txtCreate a .env file:
cp .env.example .envAdd your API key:
MAG_API_KEY=your_api_key_here- Go to https://panel.magicalapi.com/api-info
- Sign up
- Copy your API key
- Add it to your
.envfile
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
python examples/get_profile_data.pyExample:
result = await client.profile_data.get_profile_data(
profile_name="conanobrien"
)python examples/get_company_data.pyExample:
result = await client.company_data.get_company_data(
company_username="google"
)python examples/batch_linkedin_fetch.py{
"name": "Conan O'Brien",
"headline": "Comedian, Writer, Producer",
"location": "United States",
"followers": 1000000,
"experience": [],
"education": []
}This repository focuses only on LinkedIn profile and company data.
For all MagicalAPI services, use the official SDK:
https://github.com/magicalapi/magicalapi-python
- Resume Parser
- Resume Checker
- Resume Matcher
- LinkedIn Profile Data
- LinkedIn Company Data
MIT