# searchJobs

This method allows you to search for jobs applying various filtering criteria.

```typescript
try {
  const workflow = await linkedapi.searchJobs.execute({
    term: "product manager",
    limit: 10,
    filter: {
      location: "San Francisco, California, United States",
      datePosted: "pastWeek",
      experienceLevels: ["midSeniorLevel", "director"],
      employmentTypes: ["fullTime"],
      workplaceTypes: ["remote", "hybrid"],
      companies: ["Example Company"],
      industries: ["Software Development"],
      jobFunctions: ["Product Management"],
      easyApply: true,
      hasVerifications: true,
      under10Applicants: false,
      inYourNetwork: false,
      fairChanceEmployer: false
    },
    customSearchUrl: "https://www.linkedin.com/jobs/search/?keywords=product%20manager"
  });

  const { data, errors } = await linkedapi.searchJobs.result(workflow.workflowId);

  // The list of possible execution errors is below
  if (errors && errors.length > 0) {
    console.warn('Workflow completed with execution errors:');
    errors.forEach(error => {
      console.warn(` - Type: ${error.type}, Message: ${error.message}`);
    });
  }

  // The structure of the 'data' object is below
  if (data) {
    console.log('Workflow completed successfully. Data:', data);
  }
} catch (e) {
  // A list of all critical errors can be found here:
  // https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
  if (e instanceof LinkedApiError) {
    console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
  } else {
    console.error('An unexpected, non-API error occurred:', e);
  }
}
```

```python
from linkedapi import SearchJobsParams, LinkedApiError

try:
    workflow = linkedapi.search_jobs.execute(
        SearchJobsParams(
            term="product manager",
            limit=10,
            filter={
                "location": "San Francisco, California, United States",
                "date_posted": "pastWeek",
                "experience_levels": ["midSeniorLevel", "director"],
                "employment_types": ["fullTime"],
                "workplace_types": ["remote", "hybrid"],
                "companies": ["Example Company"],
                "industries": ["Software Development"],
                "job_functions": ["Product Management"],
                "easy_apply": True,
                "has_verifications": True,
                "under_10_applicants": False,
                "in_your_network": False,
                "fair_chance_employer": False,
            },
            custom_search_url="https://www.linkedin.com/jobs/search/?keywords=product%20manager",
        )
    )

    result = linkedapi.search_jobs.result(workflow.workflow_id)
    data = result.data
    errors = result.errors

    # The list of possible execution errors is below
    if errors:
        print("Workflow completed with execution errors:")
        for error in errors:
            print(f" - Type: {error.type}, Message: {error.message}")

    # The structure of the 'data' object is below
    if data:
        print("Workflow completed successfully. Data:", data)
except LinkedApiError as e:
    # A list of all critical errors can be found here:
    # https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
    print(f"Critical Error - Type: {e.type}, Message: {e.message}")
except Exception as error:
    print("An unexpected, non-API error occurred:", error)
```

## Params

- `term` (optional) – keyword or phrase to search. If omitted, starts from a broad jobs search and applies the filters.
- `limit` (optional) – number of search results to return. Defaults to **10**, with a maximum value of **1000**.
- `filter` (optional) – object that specifies filtering criteria for jobs. When multiple filter fields are specified, they are combined using `AND` logic.
  - `location` (optional) – free-form location string.
  - `datePosted` (optional) – one of `anyTime`, `past24Hours`, `pastWeek`, `pastMonth`.
  - `experienceLevels` (optional) – array of `internship`, `entryLevel`, `associate`, `midSeniorLevel`, `director`, `executive`.
  - `employmentTypes` (optional) – array of `fullTime`, `partTime`, `contract`, `temporary`, `volunteer`, `internship`, `other`.
  - `workplaceTypes` (optional) – array of `onSite`, `remote`, `hybrid`.
  - `companies` (optional) – array of company names.
  - `industries` (optional) – array of industry names.
  - `jobFunctions` (optional) – array of job function names.
  - `easyApply` (optional) – when `true`, only jobs with Easy Apply.
  - `hasVerifications` (optional) – when `true`, only jobs with verification signals.
  - `under10Applicants` (optional) – when `true`, only jobs with fewer than 10 applicants.
  - `inYourNetwork` (optional) – when `true`, only jobs from your network.
  - `fairChanceEmployer` (optional) – when `true`, only fair chance employer jobs.
- `customSearchUrl` (optional) – URL copied from a LinkedIn jobs search page after configuring filters. When specified, overrides `term` and `filter`.

## Data

Array of search results. Each result contains:

- `jobId` – LinkedIn job identifier, when it can be extracted.
- `jobUrl` – LinkedIn job URL, when `jobId` can be extracted.
- `title` – job title.
- `companyName` – company name, if available.
- `location` – free-form job location, if available.
- `workplaceType` – workplace type label as shown by LinkedIn, if available.
- `salary` – parsed salary range, if LinkedIn shows one.
  - `currency` – lowercase currency code, such as `usd`, `eur`, or `gbp`.
  - `minAmount` – minimum amount in the range.
  - `maxAmount` – maximum amount in the range.
  - `period` – one of `yearly`, `monthly`, `hourly`.
- `easyApply` – whether the card mentions Easy Apply.
- `isPromoted` – whether the card is promoted.

## Errors

- `searchingNotAllowed` – LinkedIn has blocked performing the search due to exceeding limits or other restrictions.
