Install the linkedin-jobs-api package
masterYou can install the linkedin-jobs-api package using either npm or yarn.
npm i linkedin-jobs-api
# or
yarn add linkedin-jobs-apirepository·master·Indexed 43 days ago
https://github.com/vishwagauravin/linkedin-jobs-apiA lightweight Node.js library for scraping and querying public LinkedIn job postings. Version 1.0.7 provides the `query()` method to filter jobs by keyword, location, salary, and experience level, and includes built-in pagination, rate limiting with exponential backoff, and an internal cache with a 1-hour TTL.
You can install the linkedin-jobs-api package using either npm or yarn.
npm i linkedin-jobs-api
# or
yarn add linkedin-jobs-apiTo search for jobs, import the package and call linkedIn.query(queryOptions). This method returns a Promise that resolves to an array of Job objects.
const linkedIn = require('linkedin-jobs-api');
const queryOptions = {
keyword: 'software engineer',
location: 'India',
dateSincePosted: 'past Week',
jobType: 'full time',
remoteFilter: 'remote',
salary: '100000',
experienceLevel: 'entry level',
limit: '10',
page: "0",
has_verification: false,
under_10_applicants: false,
};
linkedIn.query(queryOptions).then(response => {
console.log(response); // An array of Job objects
});The query() method accepts a queryOptions object. Below are the available parameters and their expected values:
| Parameter | Type | Default | Description |
|---|---|---|---|
keyword | string | "" | The text to search (e.g., Software Developer) |
location | string | "" | The name of the city (e.g., Los Angeles) |
dateSincePosted | string | "" | Max range of jobs: past month, past week, 24hr |
jobType | string | "" | Position type: full time, part time, contract, temporary, volunteer, internship |
remoteFilter | string | "" | Telecommuting filter: on site, remote, hybrid |
salary | string | "" | Minimum Salary: 40000, 60000, 80000, 100000, 120000 |
experienceLevel | string | "" | internship, entry level, associate, senior, director, executive |
limit | string | "" | Number of jobs returned (e.g., '1', '10', '100') |
sortBy | string | "" | Sort order: recent, relevant |
page | string | ` |
The primary way to use this API is by calling the query() method. You pass a queryObject containing your search criteria, and the function returns a Promise that resolves to an array of job objects. The API handles pagination, rate limiting (with exponential backoff), and internal caching automatically.
const { query } = require('linkedin-jobs-api');
const jobs = await query({
keyword: 'Software Engineer',
location: 'New York',
limit: 10,
remoteFilter: 'remote'
});
console.log(jobs);The API uses an internal JobCache with a 1-hour TTL (Time To Live) to prevent redundant network requests for the same query. You can interact with the cache using the following exported utilities:
clearCache(): Clears all currently cached job results.getCacheSize(): Returns the number of items currently in the cache.JobCache: The class definition used for the internal cache.const { clearCache, getCacheSize } = require('linkedin-jobs-api');
console.log(getCacheSize());
clearCache();Each job returned by the query() method follows this schema:
{
"position": "Job Title",
"company": "Company Name",
"location": "City, State/Country",
"date": "ISO Date String",
"salary": "Salary info or 'Not specified'",
"jobUrl": "URL to the job posting",
"companyLogo": "URL to the company logo",
"agoTime": "Relative time string (e.g., '2 days ago')"
}The query() method accepts an object with the following properties to filter LinkedIn job results:
| Parameter | Type | Description |
|---|---|---|
keyword | string | Search term (e.g., 'Developer'). Spaces are converted to +. |
location | string | Geographic location (e.g., 'London'). |
dateSincePosted | string | Time range: 'past month', 'past week', or '24hr'. |
jobType | string | Type of employment: 'full time', 'part time', 'contract', 'temporary', 'volunteer', or 'internship'. |
remoteFilter | string | Work setting: 'on-site', 'remote', or 'hybrid'. |
salary | number | Minimum salary threshold (e.g., 40000, 60000, 80000, 100000, 120000). |
experienceLevel | string | Seniority: 'internship', 'entry level', 'associate', 'senior', 'director', or 'executive'. |
sortBy | string | Sort order: 'recent' or 'relevant'. |
limit | number | Maximum number of jobs to return. |
page | number | The page index to start from (0-indexed). |
has_verification | boolean | Whether to filter for verified jobs. |
under_10_applicants | boolean | Whether to filter for jobs with fewer than 10 applicants. |
host | string | The LinkedIn host (defaults to www.linkedin.com). |