{
  "openapi": "3.0.1",
  "info": {
    "title": "All-in one Linkedin Scraper",
    "description": "LinkedIn scraper — 8 modes: Profiles, Companies, Jobs, Posts, Search, Search Profiles, Profile Complete, Company Employees. Premium residential proxy (~95% success rate) + email discovery (11 patterns + Hunter.io). From $1/1K — up to 75% cheaper. MCP-ready for AI agents.",
    "version": "0.1",
    "x-build-id": "BXyNnrcixY5ini7qy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/get-leads~linkedin-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-get-leads-linkedin-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/get-leads~linkedin-scraper/runs": {
      "post": {
        "operationId": "runs-sync-get-leads-linkedin-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/get-leads~linkedin-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-get-leads-linkedin-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Scraping Mode",
            "enum": [
              "profiles",
              "companies",
              "jobs",
              "posts",
              "search",
              "search_profiles",
              "profile_complete",
              "company_employees",
              "monitor"
            ],
            "type": "string",
            "description": "What to scrape. Companies/Jobs/Search work WITHOUT cookies. Profiles/Posts/Search Profiles/Profile Complete/Company Employees work best WITH a cookie. 'profiles' = profile data (15 fields). 'companies' = company pages (15 fields). 'jobs' = job search with filters (20 fields — salary field now populates on 50-70% of listings via description-text extraction). 'posts' = posts with engagement + hashtags, cookie required (14 fields). 'search' = find profiles by keywords (9 fields, 5-engine parallel SERP with cross-engine field union). 'search_profiles' = search by name + full enrichment (15 fields; returns all matching people with canonical-slug dedupe). 'profile_complete' = profile + about + posts + engagement score (19 fields). 'company_employees' = find people at a company (8 fields; three-path discovery returns 20-100+ employees per company when cookie provided). Smart proxy routing: DC for Companies/Jobs/Posts/Search, residential only for Profiles/Search Profiles/Profile Complete.",
            "default": "profiles"
          },
          "urls": {
            "title": "LinkedIn URLs",
            "type": "array",
            "description": "LinkedIn URLs to scrape. REQUIRED for modes: profiles, companies, posts, profile_complete, company_employees. URL format by mode — Profiles / Profile Complete: /in/username · Companies / Company Employees: /company/name · Posts: profile OR company URLs. Not used by Jobs / Search / Search Profiles (use Search Query instead). Submitting an empty `urls` array to a URL-input mode fails fast with an example of the correct shape.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Search keywords. REQUIRED for modes: jobs, search, search_profiles. Jobs: role keywords (e.g. 'software engineer'). Search: profile keywords (e.g. 'product manager'). Search Profiles: a person's full name (e.g. 'Sunny Savita') — the scraper finds every matching LinkedIn profile and enriches each. Submitting an empty `searchQuery` to a query-input mode fails fast with an example of the correct shape."
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Location filter for Jobs and Search modes. Examples: 'San Francisco', 'United States', 'London, UK'."
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of results to return. Default: 25. Runs that exceed the per-mode soft cap (profile_complete: 100, profiles/search_profiles: 200, company_employees: 250, posts: 500) require `confirmLargeRun: true` to proceed — this prevents accidental multi-dollar bills from a mistyped input. Low-unit-price modes (jobs, search, companies) have no soft cap and accept values up to 1000 without confirmation.",
            "default": 25
          },
          "timePosted": {
            "title": "Time Posted",
            "enum": [
              "24h",
              "week",
              "month"
            ],
            "type": "string",
            "description": "Filter jobs by when they were posted."
          },
          "jobType": {
            "title": "Job Type",
            "enum": [
              "full-time",
              "part-time",
              "contract",
              "temporary",
              "volunteer",
              "internship"
            ],
            "type": "string",
            "description": "Filter by job type."
          },
          "experienceLevel": {
            "title": "Experience Level",
            "enum": [
              "internship",
              "entry",
              "associate",
              "mid-senior",
              "director",
              "executive"
            ],
            "type": "string",
            "description": "Filter by experience level."
          },
          "workType": {
            "title": "Work Type",
            "enum": [
              "onsite",
              "remote",
              "hybrid"
            ],
            "type": "string",
            "description": "Filter by work arrangement."
          },
          "startDate": {
            "title": "Start Date (Posts Mode)",
            "type": "string",
            "description": "Filter posts from this date onwards (YYYY-MM-DD format). Posts mode only. Requires li_at cookie. Example: '2025-01-01'."
          },
          "endDate": {
            "title": "End Date (Posts Mode)",
            "type": "string",
            "description": "Filter posts up to this date (YYYY-MM-DD format). Posts mode only. Requires li_at cookie. Example: '2026-04-01'."
          },
          "discoverEmails": {
            "title": "Discover Emails",
            "type": "boolean",
            "description": "Try to find email addresses for profiles by scraping employer websites and generating email patterns. Adds ~2-4 seconds per profile. Works for Profiles, Search Profiles, and Profile Complete modes. AUTOMATICALLY DISABLED for Company Employees mode regardless of this setting — email discovery per employee (~15-20s each) would exceed the default run timeout on 25+ employee batches. To enrich employee emails, run Profiles mode on the URLs returned by Company Employees in a follow-up call. The per-run summary log emits a source breakdown (`json-ld` / `company-website` / `search-engine` / `hunter` / `none`) so you can audit which discovery strategies are producing your emails and decide whether the optional Hunter.io key is worth adding.",
            "default": true
          },
          "includePosts": {
            "title": "Include Posts (Profile Complete)",
            "type": "boolean",
            "description": "When `profile_complete` mode: include posts array + posts_count + total_engagement. Set to false to skip post retrieval (~5-15s + multiple Voyager calls saved per profile). Useful when you only need profile data without engagement metrics.",
            "default": true
          },
          "includeEngagement": {
            "title": "Include Engagement Metrics (Profile Complete)",
            "type": "boolean",
            "description": "When `profile_complete` mode: include per-post engagement enrichment (likes/comments/shares). Set to false to skip the extra Voyager enrichment pass per post. `includePosts` must be true for this to matter. Saves ~1s + 1 Voyager call per post.",
            "default": true
          },
          "includeAbout": {
            "title": "Include About Section (Profile Complete)",
            "type": "boolean",
            "description": "When `profile_complete` mode: include the `about` field. Set to false to skip the `ProfileTabInitialCards` Voyager call that fetches this.",
            "default": true
          },
          "enrichEmployeeLocation": {
            "title": "Enrich Employee Location (Company Employees)",
            "type": "boolean",
            "description": "When `company_employees` mode: for employees whose location is missing from SERP snippets, do a direct LinkedIn HTML fetch to extract location. Adds ~1-2s + ~0.5MB residential proxy usage per enriched employee. Disabled by default because SERP discovery already delivers 20-100+ employees per company; enable only if downstream workflows require location for every employee. Expected lift: location 8% → 80-90% populated.",
            "default": false
          },
          "filterRoles": {
            "title": "Filter Employee Roles (Company Employees)",
            "type": "array",
            "description": "When `company_employees` mode: only return employees whose headline/title contains one of these keywords (case-insensitive, AND logic with company filter). Examples: `['Engineer', 'Senior Engineer']` returns only people with Engineer in their title. Leave empty to return all employees.",
            "items": {
              "type": "string"
            }
          },
          "streamDataset": {
            "title": "Stream Dataset Writes",
            "type": "boolean",
            "description": "When enabled, the scraper pushes each result to the dataset IMMEDIATELY as it's collected (one `Actor.pushData` per record). Default behavior batches all results at mode-end — the default is faster on small runs but on 100+ record runs it can delay first-row visibility by minutes. Streaming is recommended for large company_employees / jobs / search runs where you want progressive results.",
            "default": false
          },
          "proxyCountry": {
            "title": "Proxy Country (Multi-Region)",
            "type": "string",
            "description": "Override the residential-proxy country. When set, overrides the Evomi endpoint's default country. Use if your `li_at` cookie was extracted from a specific country — best practice is to match proxy country to cookie origin to avoid LinkedIn's geolocation-mismatch burns. Supported values: `US`, `GB`, `DE`, `NL`, `CA`, `FR`, `AU`, `IN`, `MY`, or any ISO 3166 alpha-2 code supported by your Evomi plan. Leave empty to use the default (whichever country the `RESIDENTIAL_PROXY_URL` env var is configured for)."
          },
          "validateSlugs": {
            "title": "Validate Slugs Before Scraping",
            "type": "boolean",
            "description": "When true (default), the scraper runs one Voyager search before the main scrape loop to verify each input slug. Genuinely unreachable slugs (empty, or zero search results) are flagged with `error: invalid_slug` so you can reconcile bad input. Ambiguous slugs (e.g. celebrity short-forms like `williamhgates` whose derived name doesn't round-trip through search) are NOT blocked — the scraper proceeds and the direct-fetch path handles them. Only runs when an li_at cookie is available (no-op in cookie-free mode). Turn off if you're 100% confident your input slugs are correct and want to save one Voyager search call per profile. Applies to Profiles and Profile Complete modes.",
            "default": true
          },
          "forceRefresh": {
            "title": "Force Fresh Scrape (Bypass Cache)",
            "type": "boolean",
            "description": "When true, bypasses the 24-hour profile cache and forces a fresh scrape. Useful for testing, verifying recent changes, or re-running after fixing input errors. Default: false (use cache when available).",
            "default": false
          },
          "confirmLargeRun": {
            "title": "Confirm Large Run",
            "type": "boolean",
            "description": "Opt-in confirmation for runs that would exceed per-mode soft caps (profiles/search_profiles: 200, profile_complete: 100, company_employees: 250, posts: 500). Soft caps exist so high-unit-price modes don't accidentally bill $5+ from a misconfigured `maxResults`. Low-unit-price modes (jobs, search, companies) have no soft cap and run up to 1000 results without confirmation. Set to true only after reviewing your intended spend.",
            "default": false
          },
          "dryRun": {
            "title": "Dry Run (Validate + Estimate Cost, No Scraping)",
            "type": "boolean",
            "description": "When true, validates the input and pushes a single dry-run report row to the dataset with estimated event count, estimated cost (USD), and any warnings — then exits WITHOUT making any HTTP calls or billing events. Useful for previewing spend before launching large runs. Leave at `false` (default) to run the scraper for real.",
            "default": false
          },
          "hunterApiKey": {
            "title": "Hunter.io API Key (Optional — Email Finder)",
            "type": "string",
            "description": "Optional Hunter.io API key for email enrichment. When provided, Hunter Email Finder is used as fallback after website scraping. Get your free API key at hunter.io/api-keys (25 free searches/month)."
          },
          "proxyConfig": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. Smart routing: residential proxy only for Profiles/Search Profiles/Profile Complete (direct LinkedIn access). All other modes use cheaper datacenter proxies automatically.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "minDelay": {
            "title": "Min Delay (ms)",
            "minimum": 500,
            "maximum": 30000,
            "type": "integer",
            "description": "Minimum delay between requests in milliseconds.",
            "default": 2000
          },
          "maxDelay": {
            "title": "Max Delay (ms)",
            "minimum": 1000,
            "maximum": 60000,
            "type": "integer",
            "description": "Maximum delay between requests in milliseconds.",
            "default": 5000
          },
          "urlsFileUrl": {
            "title": "URLs File (Batch Input)",
            "type": "string",
            "description": "URL to a text or CSV file containing LinkedIn URLs (one per line). Use this for batch runs with 100+ URLs instead of pasting them manually. Supports plain text (.txt) and CSV files. Lines starting with # are ignored."
          },
          "alertEmail": {
            "title": "Alert Email (Monitor Mode)",
            "type": "string",
            "description": "Email address for health check alerts. Used in monitor mode — receives alerts when runs fail or return empty results. Leave blank to disable email alerts."
          },
          "webhookUrl": {
            "title": "Webhook URL (Optional)",
            "type": "string",
            "description": "URL to receive a POST request when the scraper finishes. The webhook payload includes: mode, itemCount, datasetId, runId, status. Useful for large batch runs — get notified when results are ready instead of polling."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}