import { scrapeJobs } from "jobspy-js";const result = await scrapeJobs({ site_name: ["indeed", "linkedin"], search_term: "software engineer", location: "San Francisco, CA", results_wanted: 20,});console.log(`Found ${result.jobs.length} jobs`);for (const job of result.jobs) { console.log(`${job.title} at ${job.company_name} — ${job.job_url}`);}
Run it:
node index.ts
You’ll see output like:
Found 38 jobsSoftware Engineer at Stripe — https://www.linkedin.com/jobs/view/123...Senior Software Engineer at Airbnb — https://www.indeed.com/viewjob?jk=...Staff Software Engineer at Google — https://www.linkedin.com/jobs/view/456...
The scrapeJobs() function returns a JobResponse object with a jobs array. Each job has these key fields:
interface JobPost { title: string; // Job title company_name?: string; // Company name job_url: string; // Link to the job posting location?: Location; // { city, state, country } description?: string; // Job description (format: markdown/html/plain) compensation?: Compensation; // Salary info job_type?: JobType[]; // fulltime, parttime, contract, etc. date_posted?: string; // When the job was posted is_remote?: boolean; // Remote work availability // ...and more}
import { fetchLinkedInJob, fetchJobDetails } from "jobspy-js";// LinkedIn job by IDconst linkedInJob = await fetchLinkedInJob("4127292817");console.log(linkedInJob.description);// Or use fetchJobDetails for any siteconst indeedJob = await fetchJobDetails("indeed", "fdde406379455a1e");console.log(indeedJob.description);