Skip to content

About

LinkedIn Python SDK for AI agents: people research, profile enrichment, post engagers and resumable research-to-CRM workflows with one LeadAdapter API key.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build a repeatable LinkedIn research report

LinkedIn + your AI assistant · powered by LeadAdapter

You want the same useful research report each time, with profiles, source identities and a reviewed CRM shortlist. Your existing reporting tool uses Python, and your coding assistant can handle that setup.

Made for: People building a research report with a coding assistant

Real tasks need a LeadAdapter account. Connect LinkedIn too when your task needs fresh LinkedIn activity.

Ask your AI to set this up

Paste this into a coding assistant that can open project files and run commands, such as Codex, Claude Code or Grok Build. You do not need to understand the code first.

Help me use this project: https://github.com/jannikco/linkedin-python-sdk

I'm not a programmer. My goal is: Build a repeatable LinkedIn research report.

Read the project instructions and set it up in a new folder without overwriting my work.
Guide me through LeadAdapter and its private key setup; never ask me to paste secrets into
this chat. Run a documented sample-data demo if available, then help me get a first small
result from my connected app. Explain the result in plain English. Ask before changing
records, sending messages or publishing anything.

Three useful things to ask for

Help me connect this project to my existing Python-based report and explain the required
LeadAdapter access.
Prepare a repeatable research shortlist with source identities and a saved checkpoint. Ask
before promoting exact reviewed prospects into CRM.
Turn the research results into a repeatable team report with the returned profile
identities, useful findings and a proposed CRM shortlist.

Your path to a real result

flowchart LR
  A["Ask your AI"] --> B["Connect LeadAdapter"] --> C["Build a repeatable<br/>LinkedIn research…"] --> D["Review together"]
Loading
  1. Open LeadAdapter setup and sign in or create your account.
  2. Connect a LinkedIn profile if your chosen task needs fresh LinkedIn activity.
  3. Create the product API key through the official setup, add it privately to your AI project's environment, and ask your AI to try a small read.

What to expect: You need one LeadAdapter API key and the workspace access required by the task. LinkedIn operations also depend on the connected profile, consent and available tools. Work that is queued stays pending until a real result is returned.

Add your LeadAdapter key privately in your project settings. Keep keys out of chat and public repositories.

Keep going

Technical reference: installation commands, exact capabilities and troubleshooting

LinkedIn Python SDK — LeadAdapter

Bring LinkedIn research and lead workflows into Python with a standard-library client.

Use LeadAdapter from Python scripts, data pipelines and agent services. The public client includes operation metadata from the pinned API contract, explicit request parameters and a job-polling helper; runtime dependencies are limited to Python’s standard library.

Create your LeadAdapter account · See plans and pricing · API documentation · Full API reference

Built for coding agents

Download SDKs and the agent kit from GitHub Releases.

Use this API from Claude Code, Codex or Grok Build in your current coding session. Install the skills into the project where you are building:

python3 -m leadadapter agents install --client codex --scope project --project /path/to/your/project
# Replace codex with claude or grok for that client.

No additional AI model key is needed. Live LinkedIn operations use your LeadAdapter API key and connected account permissions. Installation never writes credentials or overwrites conflicting files.

Ask your agent: “Research B2B software founders, produce a shortlist with evidence, and wait for my review before adding anyone to CRM.”

Run a complete workflow now

python3 -m leadadapter workflows research-to-crm --fixture

Then follow the research → review → CRM cookbook for authorized live reads and reviewed CRM handoff. capabilities.json and llms.txt provide concise machine-readable discovery. The SDK keeps its raw request API alongside task-level resources. Five runnable task recipes are included in examples/: people research, post engagers, profile enrichment, reviewed CRM handoff and existing CRM sync. Run each without flags for a plan; --fixture uses synthetic receipts. Live mutation recipes require explicit approvals and caller-supplied stable idempotency keys.

What you can build

  • Read captured leads into an internal reporting pipeline.
  • Request profile research and inspect terminal job results.
  • Connect lead qualification scripts to existing LeadAdapter CRM records.

Built for: Python developers, data teams and builders of sales research agents.

Start with one LeadAdapter API key

Create or sign in to LeadAdapter, choose an owned workspace, complete required onboarding, and create a workspace API key under Settings → API keys. The only service credential required by this repository is LEADADAPTER_API_KEY.

Use a key with api:read for these examples. Fresh LinkedIn research needs a connected profile, supported execution access and required consent; your plan’s allowances apply. For a workspace with multiple profiles, add the documented profile_id to select one.

Your first useful API call

Read your existing lead data with one workspace key. The Python client returns response dictionaries so you can inspect the actual API receipt.

export LEADADAPTER_API_KEY="YOUR_WORKSPACE_API_KEY"
curl --fail-with-body --silent --show-error \
  "https://leadadapter.com/api/v1/leads?per_page=10" \
  -H "Authorization: Bearer $LEADADAPTER_API_KEY" \
  -H "Accept: application/json"

The response uses LeadAdapter’s envelope: ok, data, governance context and request/action identifiers where available. Inspect the actual response; the pinned schema intentionally does not invent a universal lead, profile or search-result shape.

Use the Python client

Requires Python 3.10+. Clone this repository; the included leadadapter package runs from the project directory without third-party runtime dependencies:

git clone https://github.com/jannikco/linkedin-python-sdk.git
cd linkedin-python-sdk
export LEADADAPTER_API_KEY="YOUR_WORKSPACE_API_KEY"
import os
from leadadapter import LeadAdapterClient

client = LeadAdapterClient(os.environ["LEADADAPTER_API_KEY"])
receipt = client.request("list_leads_get", query={"per_page": 10})
print(receipt)

What the full LeadAdapter platform covers

This repository focuses on the reusable client. Your LeadAdapter account also provides the following documented API surfaces; account access, adapter support and operation prerequisites apply.

Capability Build this Documented API routes Execution considerations
People and post discovery Research prospects and relevant conversations POST /linkedin/searches/people
POST /linkedin/searches/posts
Fresh retrieval needs a connected, supported executor.
Company research Build account context and inspect known company pages POST /linkedin/searches/companies
GET /linkedin/companies
POST /linkedin/company-enrichments
Company-voice operations require the relevant page-admin rights.
Profile enrichment Add visible professional context to selected leads POST /linkedin/profile-enrichments Allowance, profile-view budget and returned coverage apply; email availability is conditional.
Post engagement Research the people engaging with a selected post POST /linkedin/post-engager-requests Results depend on what the connected account and adapter can retrieve.
Leads and export Read, qualify and move captured lead data GET /leads
GET /leads/export
Workspace-scoped data; pagination is explicit.
Native CRM Work with companies, pipelines, stages, deals and tasks GET /crm/{entity}
POST /crm/{entity}
GET /crm/{entity}/records
Write scopes and entity-specific inputs apply.
Stored content and publishing Connect editorial review and scheduled publishing GET /content-posts
GET /scheduled-posts
POST /scheduled-posts
Queued or scheduled work is distinct from confirmed publication.
Messages and connections Build reviewed conversation and connection workflows GET /messages
POST /linkedin/messages
POST /linkedin/connection-requests
Outbound actions remain capped, permissioned and subject to applicable approval.
Engagement actions Prepare relevant comments and reactions POST /linkedin/comments
POST /linkedin/post-reactions
Writes require the appropriate scope and governance acceptance.
Comment-to-lead workflows Connect a comment keyword to a controlled follow-up process GET /automations
POST /automations
Supported triggers are comment_keyword and any_comment; DM prerequisites and limits apply.
Lead pages and tracked links Connect campaigns with lead capture and tracked assets GET /lead-pages
GET /links
Publication and asset management are separate governed operations.
Approvals and audit Review proposed actions and understand execution decisions GET /approvals
POST /approvals/{approval_id}/decisions
GET /actions
Approval does not override caps or unavailable capabilities.
Webhooks React to supported lead, comment, message and approval events GET /webhooks
POST /webhooks
GET /webhooks/{id}/deliveries
Configure subscriptions and validate signed deliveries in your receiver.
Sales intelligence Connect research with business context and reviewable opportunities GET /signals
GET /sales-opportunities
GET /business-context
Availability follows the account’s configured features and existing records.

Operations highlighted in this repository

Operation ID HTTP route, relative to /api/v1 Required scope
list_leads_get GET /leads api:read

The SDK additionally includes all 134 operations from its pinned OpenAPI contract. Use the API reference for complete inputs, limits and operation behavior.

Fresh data, queued jobs and reliable outcomes

Stored workspace data can return immediately. Fresh LinkedIn retrieval or outbound work may return a job receipt, including job_id, instead of a completed result. When a job is returned:

  1. Keep its identifier and the request’s idempotency key.
  2. Poll GET /api/v1/jobs/{job_id} with the same workspace key. A documented wait=true can hold the read for up to25 seconds.
  3. Inspect the terminal status and result/error: done, failed or cancelled. queued and leased are still in progress.
export JOB_ID="REPLACE_WITH_RETURNED_JOB_ID"
curl --fail-with-body --silent --show-error \
  "https://leadadapter.com/api/v1/jobs/$JOB_ID?wait=true" \
  -H "Authorization: Bearer $LEADADAPTER_API_KEY" \
  -H "Accept: application/json"

The SDK provides wait_for_job to poll a job. It can return a failed or cancelled terminal receipt; inspect the returned status and error. An accepted request, an approved action and confirmed LinkedIn delivery are separate states. Do not report successful delivery from a queue acknowledgement.

Permissions and operational control

  • One workspace key, explicit scopes. Use api:read for the documented reads, and grant write access only for the operations your application needs. Store keys server-side; do not place them in browser bundles, commits or issue reports.
  • Connected-account execution. Browser-mode work uses the user’s connected browser. Supported consented cloud operations can run independently of Chrome. Availability is checked per operation; an API route does not grant unrestricted LinkedIn access.
  • Governed actions. Workspace/profile caps, pacing, do-not-engage rules, account permissions and required approvals still apply. Some operations support dry_run; check the operation’s schema before sending it.
  • Explicit retries. Operations requiring Idempotency-Key include fresh-data POST reads as well as writes. Reuse the same key and payload for the same logical request. Resolve uncertain outcomes before issuing a new request.
  • Useful errors. Handle permission/capability refusals, validation errors and429 pacing responses. Preserve request identifiers for support and follow any returned retry guidance.

Public client, private service

This repository publishes client code under MIT. LeadAdapter’s hosted application, connected-account execution, governance, data storage and commercial service remain private. The public code does not include the service backend or a self-hosted substitute for a LeadAdapter account. This is an independent LeadAdapter integration, not an official LinkedIn API or LinkedIn-endorsed SDK.

Continue building

Verification and support

This code is checked with contract fixtures; the MCP artifact also tests stdio tools/call. These checks establish client behavior, not live LinkedIn provider execution or conversion outcomes. See integration.json and SHA256SUMS for the recorded artifact evidence. The source contract is LeadAdapter’s public OpenAPI.

For a reproducible client bug, open a repository issue with the operation ID and a sanitized request identifier. For account access, plans or execution availability, use LeadAdapter’s in-app support. Never include API keys, personal lead data or session material.

About

LinkedIn Python SDK for AI agents: people research, profile enrichment, post engagers and resumable research-to-CRM workflows with one LeadAdapter API key.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages