LinkedIn Profile Search Scraper (Apify)
Search LinkedIn profiles and extract detailed information using the Apify harvestapi/linkedin-profile-search actor (ID: M2FMdjRVeF1HPGFcc). No cookies or LinkedIn account required.
How to Run
# Keyword search (e.g., find agency founders)
node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \
--query "agency founder" --max 100
# Keyword + location filter
node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \
--query "marketing manager" --location "Austin" --max 50
# Full profile mode (more details, $4/1k)
node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \
--query "CEO" --mode full --max 50
# Full profile + email search ($10/1k)
node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \
--query "founder" --mode email --max 25 --campaign "founder_outreach"
# Dry run (no DB writes)
node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \
--query "developer" --dry-run
Arguments
| Option |
Description |
Default |
--query |
Search keywords (e.g., "agency founder") |
- |
--location |
Filter by location (city/country) |
- |
--max |
Max profiles to return |
100 |
--mode |
Scraping depth (search/full/email) |
search |
--campaign |
Campaign name for DB tracking |
linkedin_search |
--dry-run |
Preview leads without storing |
false |
Modes & Pricing
| Mode |
Description |
Cost |
search |
Search page results (basic info) |
$0.10 per page (25 profiles) |
full |
Full profile details |
$4 per 1,000 profiles |
email |
Full profile + email search |
$10 per 1,000 profiles |
Environment Variables
APIFY_API_KEY=xxx # Required - Apify API token
DATABASE_URL=xxx # Required - PostgreSQL connection string
Apify Actor
| Actor |
ID |
Features |
| LinkedIn Profile Search Scraper |
M2FMdjRVeF1HPGFcc |
No cookies, keyword search, email lookup |
| Developer |
HarvestAPI |
|
Output Per Profile
{
"publicIdentifier": "john-doe-123",
"linkedinUrl": "https://www.linkedin.com/in/john-doe-123",
"firstName": "John",
"lastName": "Doe",
"headline": "Founder & CEO at Acme Agency",
"location": {
"linkedinText": "San Francisco, CA",
"parsed": { "city": "San Francisco", "country": "United States" }
},
"connectionsCount": 500,
"premium": false,
"openToWork": true,
"currentPosition": [{ "companyName": "Acme Agency", "title": "Founder" }],
"email": "john@example.com" // Only in email mode
}
Database
Stores in linkedin_leads table (deduped by public_identifier):
| Column |
Description |
| public_identifier |
LinkedIn username (unique) |
| linkedin_url |
Full profile URL |
| first_name, last_name |
Name |
| headline |
Job headline |
| location, location_city, location_country |
Location info |
| current_company, current_title |
Current job |
| connections_count, follower_count |
Network size |
| is_open_to_work, is_hiring |
Status flags |
| email |
Found email (email mode only) |
| campaign_name |
Campaign identifier |
| contacted, connection_sent, dm_success |
Outreach tracking |
Notes
- LinkedIn limits search results to ~2,500 per query
- For larger datasets, split by location or use more specific keywords
- Email search performs SMTP validation; not guaranteed for every profile
- Auto-skips own accounts (loaded from onboarding-config.json)
1---2name: linkedin-profile-scraper3description: Search and scrape LinkedIn profiles using Apify HarvestAPI actor (no cookies needed). Search by keyword, title, company, location. Stores leads in database with full profile details. Trigger when asked to find LinkedIn leads, search LinkedIn profiles, or scrape LinkedIn for prospects.4---56# LinkedIn Profile Search Scraper (Apify)78Search LinkedIn profiles and extract detailed information using the Apify `harvestapi/linkedin-profile-search` actor (ID: `M2FMdjRVeF1HPGFcc`). No cookies or LinkedIn account required.910## How to Run1112```bash13# Keyword search (e.g., find agency founders)14node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \15 --query "agency founder" --max 1001617# Keyword + location filter18node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \19 --query "marketing manager" --location "Austin" --max 502021# Full profile mode (more details, $4/1k)22node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \23 --query "CEO" --mode full --max 502425# Full profile + email search ($10/1k)26node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \27 --query "founder" --mode email --max 25 --campaign "founder_outreach"2829# Dry run (no DB writes)30node skills/linkedin-profile-scraper/scripts/apify-linkedin-search.js \31 --query "developer" --dry-run32```3334### Arguments3536| Option | Description | Default |37|--------|-------------|---------|38| `--query` | Search keywords (e.g., "agency founder") | - |39| `--location` | Filter by location (city/country) | - |40| `--max` | Max profiles to return | 100 |41| `--mode` | Scraping depth (search/full/email) | search |42| `--campaign` | Campaign name for DB tracking | linkedin_search |43| `--dry-run` | Preview leads without storing | false |4445### Modes & Pricing4647| Mode | Description | Cost |48|------|-------------|------|49| `search` | Search page results (basic info) | $0.10 per page (25 profiles) |50| `full` | Full profile details | $4 per 1,000 profiles |51| `email` | Full profile + email search | $10 per 1,000 profiles |5253### Environment Variables5455```env56APIFY_API_KEY=xxx # Required - Apify API token57DATABASE_URL=xxx # Required - PostgreSQL connection string58```5960## Apify Actor6162| Actor | ID | Features |63|-------|-----|---------|64| LinkedIn Profile Search Scraper | `M2FMdjRVeF1HPGFcc` | No cookies, keyword search, email lookup |65| Developer | HarvestAPI | |6667## Output Per Profile6869```json70{71 "publicIdentifier": "john-doe-123",72 "linkedinUrl": "https://www.linkedin.com/in/john-doe-123",73 "firstName": "John",74 "lastName": "Doe",75 "headline": "Founder & CEO at Acme Agency",76 "location": {77 "linkedinText": "San Francisco, CA",78 "parsed": { "city": "San Francisco", "country": "United States" }79 },80 "connectionsCount": 500,81 "premium": false,82 "openToWork": true,83 "currentPosition": [{ "companyName": "Acme Agency", "title": "Founder" }],84 "email": "john@example.com" // Only in email mode85}86```8788## Database8990Stores in `linkedin_leads` table (deduped by public_identifier):9192| Column | Description |93|--------|-------------|94| public_identifier | LinkedIn username (unique) |95| linkedin_url | Full profile URL |96| first_name, last_name | Name |97| headline | Job headline |98| location, location_city, location_country | Location info |99| current_company, current_title | Current job |100| connections_count, follower_count | Network size |101| is_open_to_work, is_hiring | Status flags |102| email | Found email (email mode only) |103| campaign_name | Campaign identifier |104| contacted, connection_sent, dm_success | Outreach tracking |105106## Notes107108- LinkedIn limits search results to ~2,500 per query109- For larger datasets, split by location or use more specific keywords110- Email search performs SMTP validation; not guaranteed for every profile111- Auto-skips own accounts (loaded from onboarding-config.json)