PhantomBuster Skill
Manage PhantomBuster phantoms and LinkedIn automation via the API v2.
Quick Start
All scripts:
- Accept an optional
--output-dirparameter (defaults tooutput/) - Save raw JSON and processed CSV under the output directory (created automatically)
- Return JSON with
{"output_files": [...], "summary": "..."}
Authentication
Set PHANTOMBUSTER_API_KEY in .env:
export PHANTOMBUSTER_API_KEY="your-api-key"
Optional: PHANTOMBUSTER_ORG_ID for multi-org setups.
API uses header X-Phantombuster-Key for auth, base URL https://api.phantombuster.com/api/v2.
Core Operations
Test Authentication
python scripts/auth.py
Organization Info
python scripts/get_org.py
python scripts/get_org.py --include-resources --include-running
List All Agents (Phantoms)
python scripts/list_agents.py
python scripts/list_agents.py --output-dir output
Get Agent Details
python scripts/get_agent.py --agent-id "AGENT_ID"
python scripts/get_agent.py --agent-id "AGENT_ID" --include-output
Launch an Agent
Async launch (fire and forget):
python scripts/launch_agent.py --agent-id "AGENT_ID"
Sync launch (wait for completion):
python scripts/launch_agent.py --agent-id "AGENT_ID" --sync --timeout 300
With argument overrides (dynamic configuration):
python scripts/launch_agent.py \
--agent-id "AGENT_ID" \
--arguments '{"spreadsheetUrl": "https://...", "message": "Hello!"}'
From arguments file:
python scripts/launch_agent.py \
--agent-id "AGENT_ID" \
--arguments-file path/to/args.json
Stop a Running Agent
python scripts/stop_agent.py --agent-id "AGENT_ID"
Get Agent Output/Results
python scripts/get_output.py --agent-id "AGENT_ID"
python scripts/get_output.py --agent-id "AGENT_ID" --output-dir output
Lead Storage
List all lead lists
python scripts/manage_leads.py list-all
Create a lead list
python scripts/manage_leads.py create-list --name "LinkedIn Targets Q1"
Save leads to a list
python scripts/manage_leads.py save \
--list-id "LIST_ID" \
--leads-file path/to/leads.json
Lead JSON format:
[
{"linkedinUrl": "https://linkedin.com/in/username", "firstName": "John", "lastName": "Doe"},
{"linkedinUrl": "https://linkedin.com/in/other", "firstName": "Jane", "lastName": "Smith"}
]
Search leads
python scripts/manage_leads.py search \
--query '{"linkedinUrl": "linkedin.com/in/username"}'
Delete leads
python scripts/manage_leads.py delete \
--list-id "LIST_ID" \
--lead-ids "id1" "id2"
LinkedIn Automation Workflow
PhantomBuster phantoms are pre-configured in the PhantomBuster dashboard for specific LinkedIn tasks. Via API, you:
- List agents to find the right phantom for the task
- Launch with optional argument overrides (target URLs, messages, etc.)
- Poll status or use sync mode to wait for completion
- Fetch output to get results (connections sent, messages delivered, profiles visited)
LinkedIn Phantom Types & Argument Configs
LinkedIn Auto Connect (linkedin-auto-connect):
{
"sessionCookie": "li_at cookie",
"spreadsheetUrl": "Google Sheets URL or org-storage://leads/by-list/{listId}",
"numberOfProfilesToProcess": 10,
"message": "Hi {firstName}, I'd love to connect!",
"onlySecondCircle": true,
"disableScrapingWhenAlreadyConnected": true,
"waitBetweenActions": 5
}
LinkedIn Message Sender (linkedin-message-sender):
{
"sessionCookie": "li_at cookie",
"spreadsheetUrl": "Google Sheets URL or org-storage://leads/by-list/{listId}",
"numberOfProfilesToProcess": 10,
"message": "Hi {firstName}, ...",
"onlyFirstCircle": true,
"waitBetweenActions": 10
}
Note: Message Sender only works with 1st-degree connections. Use InMail for non-connections (requires LinkedIn Premium).
LinkedIn Profile Visitor (linkedin-profile-visitor):
{
"sessionCookie": "li_at cookie",
"spreadsheetUrl": "Google Sheets URL",
"numberOfProfilesToProcess": 50,
"waitBetweenActions": 3
}
LinkedIn Connection Accepter (linkedin-connection-accepter):
{
"sessionCookie": "li_at cookie",
"message": "Thanks for connecting, {firstName}!",
"numberOfConnectionsToAccept": 20,
"waitBetweenActions": 3
}
Template variables: {firstName}, {lastName}, {company}, {title}, {school}
LinkedIn Daily Limits (Platform-Enforced)
| Action | Daily Limit | Per Launch |
|---|---|---|
| Connection requests | 80-100 | 10-20 |
| Messages | 100-150 | 10-20 |
| Profile visits | 200-300 | 30-50 |
Outreach Pipeline Pattern
- Search prospects -> 2. Visit profiles (wait 1 day) -> 3. Connect (wait 2 days) -> 4. Message new connections
API Endpoints Reference
| Endpoint | Method | Script |
|---|---|---|
/agents/fetch-all |
GET | list_agents.py |
/agents/fetch |
GET | get_agent.py |
/agents/launch |
POST | launch_agent.py |
/agents/stop |
POST | stop_agent.py |
/agents/fetch-output |
GET | get_output.py |
/orgs/fetch |
GET | get_org.py |
/orgs/fetch-resources |
GET | get_org.py --include-resources |
/orgs/fetch-running-containers |
GET | get_org.py --include-running |
/org-storage/lists/* |
GET/POST | manage_leads.py |
/org-storage/leads/* |
POST | manage_leads.py |
/containers/fetch-result-object |
GET | get_output.py |