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

# Search Jobs

> Search LinkedIn jobs by title, company, location, and more.

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    search: 'Software Engineer',
    companyId: '1441', // Google
    location: 'US',
    sortBy: 'date',
    workplaceType: 'hybrid,remote',
    employmentType: 'full-time',
    postedLimit: 'month',
    page: '1',
    salary: '100k+',
  });
  fetch(`https://api.harvestapi.io/linkedin/job-search?${params.toString()}`, {
    headers: { 'X-API-Key': '<api-key>' },
  })
    .then((response) => response.json())
    .then((data) => console.log(data));
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.harvestapi.io/linkedin/job-search?search=Software%20Engineer&companyId=1441&location=US&sortBy=date&workplaceType=hybrid&postedLimit=month&page=1 \
    --header 'X-API-Key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.harvestapi.io/linkedin/job-search?search=Software%20Engineer&companyId=1441&location=US&sortBy=date&workplaceType=hybrid&postedLimit=month&page=1"

  headers = {"X-API-Key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  ```
</CodeGroup>

## How to get Company ID

#### By company URL or ID

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    query: 'https://www.linkedin.com/company/google',
    // query: 'google', // 'google' is also accepted as a company ID (last part of the URL)
    apiKey: '<api-key>',
  });

  fetch(`https://api.harvestapi.io/linkedin/company?${params.toString()}`)
    .then((res) => res.json())
    .then((data) => {
      const company = data.element;
      console.log(`LinkedIn ID for Google: ${company?.id}`);
    });
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.harvestapi.io/linkedin/company?query=google \
    --header 'X-API-Key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.harvestapi.io/linkedin/company?query=google"

  headers = {"X-API-Key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print("LinkedIn ID for Google: " + response.json()["element"]["id"])
  ```
</CodeGroup>

#### By searching for a company name

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    search: 'Google',
    apiKey: '<api-key>',
  });

  fetch(`https://api.harvestapi.io/linkedin/company-search?${params.toString()}`)
    .then((res) => res.json())
    .then((data) => {
      const companies = data.elements;
      const firstMatchId = companies[0].id;
      console.log(`LinkedIn ID for Google: ${firstMatchId}`);
    });
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.harvestapi.io/linkedin/company-search?search=Google \
    --header 'X-API-Key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.harvestapi.io/linkedin/company-search?search=Google"

  headers = {"X-API-Key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print("LinkedIn ID for Google: " + response.json()["elements"][0]["id"])
  ```
</CodeGroup>

## Search by LinkedIn GeoID

For most of the cases, when specifying full location name, the search by the `location` parameter works fine.\
However sometimes search by location may not give you what you expect, as LinkedIn have some other suggested location for your text query.
For example, `NY` returns `New Zealand` instead of `New York`; `UK` returns `Ukraine` instead of `United Kingdom`.
The location search is based on LinkedIn autocomplete feature, you can try it [on the website](https://www.linkedin.com/search/results/people/?geoUrn=%5B%22103644278%22%5D) first.
The scraper will use the first suggestion from the autocomplete popup when you type your location.

The same autocomplete is available via our API. You can look up a location and get LinkedIn GeoID to use for the API endpoint.

<CodeGroup>
  ```javascript JavaScript theme={null}
  const apiKey = '<api-key>';

  fetch(`https://api.harvestapi.io/linkedin/geo-id-search?search=New York`, {
    headers: { 'X-API-Key': apiKey },
  })
    .then((response) => response.json())
    .then((data) => {
      console.log('All matches:', data.elements);
      console.log('Closest match GeoID:', data.entityId);

      // Search for profiles in New York
      const params = new URLSearchParams({
        geoId: data.entityId,
        apiKey,
      });
      fetch(`https://api.harvestapi.io/linkedin/profile-search?${params.toString()}`)
        .then((response) => response.json())
        .then((data) => console.log(data));
    });
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.harvestapi.io/linkedin/geo-id-search?search=New%20York \
    --header 'X-API-Key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.harvestapi.io/linkedin/geo-id-search?search=New York"

  headers = {"X-API-Key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  data = response.json()
  print("All matches:", data["elements"])
  print("Closest match GeoID:", data["id"])
  ```
</CodeGroup>


## OpenAPI

````yaml GET /linkedin/job-search
openapi: 3.0.1
info:
  title: HarvestAPI LinkedIn API reference
  description: HarvestAPI LinkedIn API reference
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.harvestapi.io
security:
  - ApiKeyAuthHeader: []
paths:
  /linkedin/job-search:
    get:
      summary: Search LinkedIn jobs
      description: Search LinkedIn jobs by title, company, location, and more.
      parameters:
        - name: search
          in: query
          description: Search jobs by title
          schema:
            type: string
        - name: companyId
          in: query
          description: Filter by company ID. One value or multiple comma-separated.
          schema:
            type: string
        - name: location
          in: query
          description: Filter by location text
          schema:
            type: string
        - name: geoId
          in: query
          description: >-
            Filter by location as LinkedIn Geo ID. Overrides the location query
            param. Use the /linkedin/geo-id-search endpoint to find the Geo ID
          schema:
            type: string
        - name: sortBy
          in: query
          description: 'Sort by field. Supported values: ''relevance'', ''date'''
          schema:
            type: string
        - name: workplaceType
          in: query
          description: >-
            Filter by workplace type. One or multiple values comma-separated.
            Supported values: 'office', 'hybrid', 'remote'
          schema:
            type: string
        - name: employmentType
          in: query
          description: >-
            Filter by employment type. One or multiple values comma-separated.
            Supported values: 'full-time', 'part-time', 'contract', 'temporary',
            'internship'
          schema:
            type: string
        - name: salary
          in: query
          description: >-
            Filter by salary range. Supported values: '40k+', '60k+', '80k+',
            '100k+', '120k+', '140k+', '160k+', '180k+', '200k+'
          schema:
            type: string
        - name: postedLimit
          in: query
          description: >-
            Filter posts by maximum posted date. Supported values: '24h',
            'week', 'month'
          schema:
            type: string
        - name: experienceLevel
          in: query
          description: >-
            Filter by experience level. One or multiple values comma-separated.
            Supported values: 'internship', 'entry', 'associate', 'mid-senior',
            'director', 'executive'
          schema:
            type: string
        - name: industryId
          in: query
          description: >-
            Filter by industry ID. One value or multiple comma-separated
            industry IDs. Full list of IDs:
            https://github.com/HarvestAPI/linkedin-industry-codes-v2/blob/main/linkedin_industry_code_v2_all_eng.csv
          schema:
            type: string
        - name: functionId
          in: query
          description: >-
            Filter by job function ID. One value or multiple comma-separated
            function IDs. Full list of IDs:
            https://github.com/HarvestAPI/apify-linkedin-profile-search/blob/main/.actor/input_schema.json#L142
          schema:
            type: string
        - name: under10Applicants
          in: query
          description: Include this parameter to filter jobs with under 10 applicants
          schema:
            type: string
        - name: easyApply
          in: query
          description: >-
            Set this parameter to 'true' filter jobs with Easy Apply option or
            'false' to exclude. Values can be 'true' or 'false'
          schema:
            type: string
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Job search response
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobShort'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    type: object
                  status:
                    type: string
                  error:
                    type: string
                  query:
                    type: object
                    properties:
                      title:
                        type: string
                      companyId:
                        type: string
                      location:
                        type: string
                      geoId:
                        type: string
                      sortBy:
                        type: string
                      workplaceType:
                        type: string
                      postedLimit:
                        type: string
                      page:
                        type: integer
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    JobShort:
      required:
        - id
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        title:
          type: string
        postedDate:
          type: string
          format: date-time
        company:
          type: object
          properties:
            name:
              type: string
            universalName:
              type: string
            linkedinUrl:
              type: string
        location:
          type: object
          properties:
            linkedinText:
              type: string
        easyApply:
          type: boolean
    Pagination:
      type: object
      properties:
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int32
        pageNumber:
          type: integer
          format: int32
        previousElements:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        paginationToken:
          type: string
          format: nullable
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuthHeader:
      type: apiKey
      in: header
      name: X-API-Key

````