> ## Documentation Index
> Fetch the complete documentation index at: https://docs.api.nickautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scrape LinkedIn Data

> Scrapes LinkedIn Sales Navigator search results.
Returns up to 25 items per request (1 page).




## OpenAPI

````yaml /openapi-consumer.yaml post /scrape
openapi: 3.0.3
info:
  title: LinkedIn Scraper API
  description: >
    API for scraping LinkedIn Sales Navigator search results.


    ## Authentication

    - API key required via `x-api-key` header (unless disabled in configuration)


    ## Rate Limiting

    - Default: 0.2 requests per second (12 requests per minute)

    - Configurable per API key


    ## Getting LinkedIn Cookies


    Use the **Cookie-Editor** browser extension: [Chrome Web
    Store](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm)


    1. Install Cookie-Editor and log in to LinkedIn in your browser.

    2. Click the Cookie-Editor icon, then click **Export**.

    3. **Select "Header"** format (NOT JSON, NOT Netscape).

    4. The cookie string is copied to your clipboard. Paste it into the
    `cookies` field.


    The export must contain `li_at` and `JSESSIONID` cookies.


    ## Important Notes

    - Requires valid LinkedIn cookies for authentication

    - Respects LinkedIn's rate limits with built-in delays

    - Supports both contact and account scraping
  version: 1.0.0
  contact:
    name: API Support
    email: support@example.com
servers:
  - url: http://localhost:8000
    description: Development server
  - url: https://api.nickautomations.com/linkedin
    description: Production server
security: []
tags:
  - name: Scraping
    description: LinkedIn data extraction endpoints
  - name: Health
    description: Service health and monitoring
paths:
  /scrape:
    post:
      tags:
        - Scraping
      summary: Scrape LinkedIn Data
      description: |
        Scrapes LinkedIn Sales Navigator search results.
        Returns up to 25 items per request (1 page).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScraperRequest'
            examples:
              contacts:
                summary: Scrape contacts/people
                value:
                  cookies: li_at=AQEDxxxxxx; JSESSIONID=ajax:1234567890
                  url: >-
                    https://www.linkedin.com/sales/search/people?query=(filters:List())
                  start: 0
                  scraper_type: contacts
              accounts:
                summary: Scrape companies/accounts
                value:
                  cookies: li_at=AQEDxxxxxx; JSESSIONID=ajax:1234567890
                  url: >-
                    https://www.linkedin.com/sales/search/accounts?query=(filters:List())
                  start: 0
                  scraper_type: accounts
      responses:
        '200':
          description: Successfully scraped data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScraperResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ScraperRequest:
      type: object
      required:
        - url
      properties:
        cookies:
          type: string
          description: >
            Full cookie string from LinkedIn browser session, exported as a
            Header

            string via the Cookie-Editor extension. Must contain `li_at` and

            `JSESSIONID` cookies.


            Get it: Cookie-Editor extension → Export → select "Header" (NOT
            JSON).
          example: li_at=AQEDxxxxxx; JSESSIONID="ajax:1234567890"
        cookie:
          type: string
          description: Deprecated - use 'cookies' instead
          deprecated: true
        url:
          type: string
          description: >
            LinkedIn Sales Navigator search or list URL.

            Paths include `/sales/search/people`, `/sales/search/accounts`,

            `/sales/search/company`, `/sales/search/leads`, and
            `/sales/lists/...`.
          example: https://www.linkedin.com/sales/search/people
        start:
          type: integer
          description: |
            Starting offset for pagination.
            Must be a multiple of 25, maximum 2475.
          minimum: 0
          maximum: 2475
          default: 0
          example: 0
        scraper_type:
          type: string
          enum:
            - contacts
            - accounts
          description: Type of data to scrape
          default: contacts
    ScraperResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/ContactData'
              - $ref: '#/components/schemas/AccountData'
        total_scraped:
          type: integer
          description: Number of items scraped
        pages_processed:
          type: integer
          description: Number of pages processed
        message:
          type: string
        paging:
          type: object
          properties:
            total:
              type: integer
            start:
              type: integer
            count:
              type: integer
    ErrorResponse:
      type: object
      properties:
        error_id:
          type: string
          description: Unique error identifier for tracking
        message:
          type: string
          description: Error message
        error:
          type: string
          description: Error code
        request_id:
          type: string
          description: Request tracking ID
    ValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            properties:
              loc:
                type: array
                items:
                  type: string
              msg:
                type: string
              type:
                type: string
    ContactData:
      type: object
      properties:
        id:
          type: string
        entityUrn:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        fullName:
          type: string
        headline:
          type: string
        title:
          type: string
        companyName:
          type: string
        location:
          type: string
        industry:
          type: string
    AccountData:
      type: object
      properties:
        id:
          type: string
        entityUrn:
          type: string
        companyName:
          type: string
        name:
          type: string
          description: Same as companyName when present (backward compatibility)
        companyPictureDisplayImage:
          type: object
          description: LinkedIn image object (artifacts, rootUrl, etc.)
          additionalProperties: true
        description:
          type: string
        employeeCountRange:
          type: string
          example: 51-200 employees
        employeeDisplayCount:
          type: string
          example: '24'
        industry:
          type: string
        location:
          type: string
        websiteUrl:
          type: string
        employeeCount:
          type: string
          description: Legacy; may mirror employeeCountRange when only range is returned
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````