Skip to main content

linkedin-autobot

PyPI GitHub Python License: Apache 2.0

linkedin-autobot helps you collect LinkedIn profile data, analyze leads, and automate outreach.

Install

pip install linkedin-autobot

For local browser automation, install automation dependencies manually:

pip install "linkedin-autobot[automation]"
python -m playwright install chromium

Choose Your Mode

  1. Hosted mode: recommended for production (stable, backend-driven).
  2. Local bot mode: runs browser automation on the user machine.
  3. Colab/Jupyter mode: use async bot (AsyncLinkedInBot).

Environment Variables

Hosted:

  • LINKEDIN_AUTOBOT_BASE_URL
  • LINKEDIN_AUTOBOT_API_KEY (optional if your backend does not require it)

Local bot:

  • LINKEDIN_EMAIL
  • LINKEDIN_PASSWORD
  • GMAIL_APP_PASSWORD (optional, for automatic 2FA email verification handling)

Analytics (optional):

  • GOOGLE_API_KEY

2FA Email Verification Handling

When LinkedIn requires email verification (common in automated login scenarios), the bot can automatically fetch and submit the verification code from your Gmail inbox.

Setup:

  1. Enable 2-Step Verification on your Google account: https://myaccount.google.com/security
  2. Generate a Gmail App Password: https://myaccount.google.com/apppasswords
  3. Set GMAIL_APP_PASSWORD environment variable or pass it to LinkedInBot:
with LinkedInBot.from_env(headless=False) as bot:
    # Automatically handles 2FA if LinkedIn requires verification
    bot.login()

How it works:

  • Detects LinkedIn's verification challenge
  • Connects to Gmail IMAP
  • Fetches the 6-digit code from LinkedIn's verification email
  • Automatically enters the code and continues login

Requirements:

Tutorial: Hosted Client

1) Create client with from_env(...)

from linkedin_autobot import LinkedInAutobotClient

client = LinkedInAutobotClient.from_env()

2) Collect profile by name with collect_profile_by_name(name)

profile = client.collect_profile_by_name("Satya Nadella")
print(profile.profile_url, profile.full_name, profile.title)

Returned data fields:

  • profile.profile_url
  • profile.full_name
  • profile.title
  • profile.location
  • profile.about
  • profile.experience
  • profile.status
  • profile.metadata

3) Collect profile by URL with collect_profile_by_url(profile_url)

profile = client.collect_profile_by_url("https://www.linkedin.com/in/satyanadella/")
print(profile.full_name, profile.location)

This method returns the same LinkedInProfile fields listed above.

4) Analyze profile with analyze_profile(profile, prompt)

analysis = client.analyze_profile(
    profile,
    prompt="Score this lead and suggest the best outreach angle."
)
print(analysis.score, analysis.decision_maker_level)

5) Send outreach with send_connection_request(profile_url, message=None)

sent = client.send_connection_request(
    "https://www.linkedin.com/in/satyanadella/",
    message="Hi Satya, I would love to connect."
)
print(sent)

Tutorial: Local Bot

1) Install local requirements, then create bot with from_env(...) and login with login()

from linkedin_autobot import LinkedInBot

with LinkedInBot.from_env(headless=False) as bot:
    bot.login()

Tutorial: Colab / Jupyter (Async)

In notebook environments, use AsyncLinkedInBot (not LinkedInBot sync API).

import asyncio
from linkedin_autobot import AsyncLinkedInBot

async def run():
    async with AsyncLinkedInBot.from_env(headless=True) as bot:
        await bot.login()
        profile = await bot.collect_profile_by_name("Satya Nadella")
        print(profile.profile_url, profile.full_name)

await run()

2) Open a profile with visit_profile(profile_url)

with LinkedInBot.from_env(headless=False) as bot:
    bot.login()
    bot.visit_profile("https://www.linkedin.com/in/satyanadella/")

3) Find profile URL with find_profile_url_by_name(name)

with LinkedInBot.from_env(headless=False) as bot:
    bot.login()
    profile_url = bot.find_profile_url_by_name("Satya Nadella")
    print(profile_url)

4) Collect profile with collect_profile(profile_url)

with LinkedInBot.from_env(headless=False) as bot:
    bot.login()
    profile = bot.collect_profile("https://www.linkedin.com/in/satyanadella/")
    print(profile.full_name, profile.title)

Returned data fields:

  • profile.profile_url
  • profile.full_name
  • profile.title
  • profile.location
  • profile.about
  • profile.experience
  • profile.status
  • profile.metadata

5) Collect by name with collect_profile_by_name(name)

with LinkedInBot.from_env(headless=False) as bot:
    bot.login()
    profile = bot.collect_profile_by_name("Satya Nadella")
    print(profile.profile_url)

This method returns the same LinkedInProfile fields listed above.

6) Send request with send_connection_request(profile_url, message=None)

with LinkedInBot.from_env(headless=False) as bot:
    bot.login()
    sent = bot.send_connection_request(
        "https://www.linkedin.com/in/satyanadella/",
        message="Hi Satya, let's connect."
    )
    print(sent)

7) Close bot manually with close()

from linkedin_autobot import LinkedInBot

bot = LinkedInBot.from_env(headless=False)
bot.login()
# ... your actions ...
bot.close()

Tutorial: Local Analytics Engine

Analyze with LeadAnalyticsEngine.analyze(profile, prompt)

from linkedin_autobot import LeadAnalyticsEngine, LinkedInProfile

profile = LinkedInProfile(
    profile_url="https://www.linkedin.com/in/example/",
    full_name="Jane Founder",
    title="Founder & CEO",
    about="B2B growth and sales.",
)

engine = LeadAnalyticsEngine()  # uses GOOGLE_API_KEY if available
result = engine.analyze(profile, "Score this lead and propose outreach.")
print(result.score, result.insights_strategic)

Tutorial: Django Helpers

profile_from_lead_model(lead)

from linkedin_autobot.django import profile_from_lead_model

profile = profile_from_lead_model(lead_instance)

analyze_lead_model(lead, prompt, api_key=None)

from linkedin_autobot.django import analyze_lead_model

analysis = analyze_lead_model(lead_instance, "Score this lead.")
print(analysis.score)

Data Models

  • LinkedInCredentials(email, password)
  • LinkedInProfile(...)
  • AnalysisResult(...)

Exceptions

  • LinkedinAutobotError
  • MissingDependencyError
  • AuthenticationError
  • ScrapingError

Practical Notes

  • LinkedInBot.login() performs preflight checks and raises clear instructions when Chromium is missing.
  • If local browser automation is blocked by OS permissions, use hosted mode.
  • For production-grade stability, hosted mode is recommended.

Metadata

Release files for linkedin-autobot 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for linkedin-autobot 0.1.7
File Size Uploaded Provenance Actions
linkedin_autobot-0.1.7.tar.gz 19.8 kB Without provenance Details for linkedin_autobot-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for linkedin-autobot 0.1.7
File Interpreter ABI Platform Actions
linkedin_autobot-0.1.7-py3-none-any.whl Python 3 none any Details for linkedin_autobot-0.1.7-py3-none-any.whl

Total release size: 41.1 kB

Release files / linkedin_autobot-0.1.7.tar.gz

Download URL linkedin_autobot-0.1.7.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5ff489c4d484088a98751dd4148701d9f207f6dc01c92fe821c5ee7b4b6da436
BLAKE2b-256 checksum
How to use checksums
4550173493a7f8148713fd2cc1f505fb681e6cf9ea3813f3911ab6a6d0daef04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / linkedin_autobot-0.1.7-py3-none-any.whl

Download URL linkedin_autobot-0.1.7-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
448d5f8840289c6922091fb5cc2cc5733a869344b4d35b5799d8de2f12e9c27d
BLAKE2b-256 checksum
How to use checksums
178f04073b23850a25738b0f69cc8190ab094b1e95b4562657177db85f5f598a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Security for linkedin-autobot 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page