> ## 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 V2

> Search LinkedIn jobs with LinkedIn's semantic job search, the search LinkedIn now runs. It matches keywords by meaning, so results include related job titles and quoted phrases are not matched exactly. Its filters are applied to every result: workplace type, employment type, experience level, date posted, company, Easy Apply and under 10 applicants. It has no industry, job function or salary filter and no sorting (`sortBy` is accepted but has no effect): `industryId`, `functionId`, `salary`, and values its filters do not offer, are answered with status 400. A location is required. 25 jobs a page, as LinkedIn's results list shows them; LinkedIn gives no count, so `pagination.totalPages` and `pagination.totalElements` are 0 and `pagination.hasNextPage` says whether there are more jobs.

Search LinkedIn jobs with LinkedIn's semantic job search, the search LinkedIn now runs. It matches keywords by meaning,
so results include related job titles and quoted phrases are not matched exactly. Its filters are applied to every
result: workplace type, employment type, experience level, date posted, company, Easy Apply and under 10 applicants.
It has no industry, job function or salary filter and no sorting: `industryId`, `functionId` and `salary`, and values
its filters do not offer, are answered with status 400, and `sortBy` has no effect.

A location (`location` or `geoId`) is required: the search does not search worldwide.

Each page holds 25 jobs as LinkedIn's results list shows them: the posting time as LinkedIn shows it (`postedAgo`, e.g.
"3 weeks ago") and the company's name and logo, without its page. Use [Get job](https://docs.harvestapi.io/linkedin-api-reference/job/get.md) for a
job's exact posting time, company and description. LinkedIn gives no count: `pagination.totalPages` and
`pagination.totalElements` are 0, `pagination.hasNextPage` says whether there are more jobs, and a page with fewer than
25 jobs is the last.

```javascript JavaScript theme={null}
const params = new URLSearchParams({
  search: 'Growth Analyst',
  location: 'United States',
  workplaceType: 'remote',
  postedLimit: 'week',
  page: '1',
});
fetch(`https://api.harvestapi.io/linkedin/job-search-v2?${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-v2?search=Growth%20Analyst&location=United%20States&workplaceType=remote&postedLimit=week&page=1' \
  --header 'X-API-Key: <api-key>'
```

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

url = "https://api.harvestapi.io/linkedin/job-search-v2?search=Growth%20Analyst&location=United%20States&workplaceType=remote&postedLimit=week&page=1"

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

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

print(response.text)
```

## How to get Company ID

#### By company URL or ID

```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"])
```

#### By searching for a company name

```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"])
```

## 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.

```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"])
```


## OpenAPI

````yaml GET /linkedin/job-search-v2
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-v2:
    get:
      summary: Search LinkedIn jobs (v2)
      description: >-
        Search LinkedIn jobs with LinkedIn's semantic job search, the search
        LinkedIn now runs. It matches keywords by meaning, so results include
        related job titles and quoted phrases are not matched exactly. Its
        filters are applied to every result: workplace type, employment type,
        experience level, date posted, company, Easy Apply and under 10
        applicants. It has no industry, job function or salary filter and no
        sorting (`sortBy` is accepted but has no effect): `industryId`,
        `functionId`, `salary`, and values its filters do not offer, are
        answered with status 400. A location is required. 25 jobs a page, as
        LinkedIn's results list shows them; LinkedIn gives no count, so
        `pagination.totalPages` and `pagination.totalElements` are 0 and
        `pagination.hasNextPage` says whether there are more jobs.
      parameters:
        - name: search
          in: query
          required: true
          description: >-
            Keywords, up to 500 characters. LinkedIn matches them by meaning:
            results include related job titles, and quoted phrases are not
            matched exactly
          schema:
            type: string
        - name: location
          in: query
          description: >-
            Location as text, e.g. 'United States' or 'Berlin'. A location (this
            or `geoId`) is required: the search does not search worldwide
          schema:
            type: string
        - name: geoId
          in: query
          description: >-
            Location as LinkedIn Geo ID. Overrides the location query param. Use
            the /linkedin/geo-id-search endpoint to find the Geo ID. Worldwide
            (92000000) is not supported
          schema:
            type: string
        - name: companyId
          in: query
          description: Filter by company ID. One value or multiple comma-separated
          schema:
            type: string
        - name: company
          in: query
          description: >-
            Filter by company page URL, company ID or company name (a name is
            matched to a company). One value or multiple comma-separated
          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',
            'internship', 'volunteer'
          schema:
            type: string
        - name: experienceLevel
          in: query
          description: >-
            Filter by experience level. One or multiple values comma-separated.
            Supported values: 'entry', 'senior', 'manager', 'director',
            'executive'
          schema:
            type: string
        - name: postedLimit
          in: query
          description: >-
            Filter jobs by maximum posted date. Supported values: '24h', 'week',
            'month'
          schema:
            type: string
        - name: under10Applicants
          in: query
          description: Set to 'true' to get jobs with under 10 applicants only
          schema:
            type: string
        - name: easyApply
          in: query
          description: >-
            Set to 'true' to get Easy Apply jobs only. There is no filter for
            jobs without Easy Apply: 'false' is answered with status 400
          schema:
            type: string
        - name: page
          in: query
          description: >-
            Page number from 1 to 40, 25 jobs a page. A page with fewer than 25
            jobs is the last; `pagination.hasNextPage` says whether there are
            more
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: A page of jobs
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobShortV2'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    type: object
                  status:
                    type: integer
                  error:
                    type: string
                  query:
                    type: object
                    properties:
                      search:
                        type: string
                      location:
                        type: string
                      geoId:
                        type: string
                      geoTitle:
                        type: string
                      companyIds:
                        type: array
                        items:
                          type: string
                      page:
                        type: string
              example:
                elements:
                  - id: '4490000001'
                    url: https://www.linkedin.com/jobs/view/4490000001
                    title: Growth Analyst
                    company:
                      name: Acme
                      logo: >-
                        https://media.licdn.com/dms/image/v2/C4D0BAQexample/company-logo_400_400/0/1630568140219
                    location:
                      linkedinText: United States (Remote)
                    workplaceType: remote
                    postedAgo: 5 days ago
                    salary: $110K/yr - $140K/yr
                    benefits: Medical, Vision, Dental, 401(k)
                    easyApply: false
                    earlyApplicant: true
                    verified: true
                    insights: []
                  - id: '4490000002'
                    url: https://www.linkedin.com/jobs/view/4490000002
                    title: Product Analyst, Growth
                    company:
                      name: Globex
                      logo: null
                    location:
                      linkedinText: Boston, MA (Remote)
                    workplaceType: remote
                    postedAgo: 22 hours ago
                    salary: null
                    benefits: null
                    easyApply: true
                    earlyApplicant: false
                    verified: false
                    insights:
                      - Actively reviewing applicants
                pagination:
                  totalPages: 0
                  totalElements: 0
                  pageNumber: 1
                  previousElements: 0
                  pageSize: 25
                  hasNextPage: true
                status: 200
                query:
                  search: Growth Analyst
                  location: United States
                  geoId: '103644278'
                  geoTitle: United States
                  companyIds: []
                  page: '1'
        '400':
          description: >-
            `search` or a location is missing, or a parameter or value the
            search does not support was given (`industryId`, `functionId`,
            `salary`, `easyApply=false`, an unsupported value), or `page` is
            over 40
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    JobShortV2:
      required:
        - id
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        title:
          type: string
          nullable: true
        company:
          type: object
          nullable: true
          description: >-
            The company's name and logo. Its page is in the job's details
            (/linkedin/job)
          properties:
            name:
              type: string
            logo:
              type: string
              nullable: true
              description: URL of the company logo
        location:
          type: object
          properties:
            linkedinText:
              type: string
              nullable: true
              description: The location as LinkedIn shows it, e.g. 'Boston, MA (Remote)'
        workplaceType:
          type: string
          nullable: true
          enum:
            - remote
            - hybrid
            - on_site
          description: From the label after the location; null without one
        postedAgo:
          type: string
          nullable: true
          description: >-
            When the job was posted, as LinkedIn shows it, e.g. '3 weeks ago'.
            The exact time is in the job's details (/linkedin/job)
        salary:
          type: string
          nullable: true
          description: The pay range LinkedIn shows, e.g. '$125K/yr - $222K/yr'
        benefits:
          type: string
          nullable: true
          description: The benefits LinkedIn shows, e.g. 'Medical, Vision, Dental, 401(k)'
        easyApply:
          type: boolean
        earlyApplicant:
          type: boolean
          description: LinkedIn's 'Be an early applicant'
        verified:
          type: boolean
          description: LinkedIn marks the job as verified
        insights:
          type: array
          items:
            type: string
          description: >-
            LinkedIn's other notes on the job, e.g. 'Actively reviewing
            applicants'
    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
        hasNextPage:
          type: boolean
          description: >-
            Whether there are more results after this page, for searches
            LinkedIn gives no count for (their totalPages and totalElements are
            0)
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.