1.0.1 โ€ข Published 1 year ago

@atharvh01/linkedin-jobs-api v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

LinkedIn Jobs API

An unofficial API to fetch job listings from LinkedIn. This API allows you to search for jobs using keywords, location, and date filters.

Created by: Atharv Hatwar

npm version License: MIT

Features

  • ๐Ÿ” Search jobs by keywords
  • ๐Ÿ“ Filter by location
  • ๐Ÿ“… Filter by posting date
  • ๐Ÿงน Clean and formatted job data
  • ๐ŸŒ CORS enabled
  • โš ๏ธ Error handling
  • ๐Ÿ›ก๏ธ Rate limiting protection

Installation

npm install @atharvh01/linkedin-jobs-api

Quick Start

import express from 'express';
import { searchJobs } from '@atharvh01/linkedin-jobs-api';

const app = express();
const PORT = 3000;

app.get('/api/search', searchJobs);

app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

API Endpoints

Search Jobs

GET /api/search

Query Parameters

ParameterTypeRequiredDescription
keywordsstringYesSearch terms (e.g., "react developer")
locationstringYesJob location (e.g., "remote", "Pune")
dateSincePostedstringNoFilter by post date (past_24h, past_week, past_month)

Example Request

GET /api/search?keywords=react&location=remote&dateSincePosted=past_24h

Example Response

{
  "success": true,
  "count": 2,
  "jobs": [
    {
      "title": "Senior React Developer",
      "company": "Example Corp",
      "location": "Remote",
      "link": "https://www.linkedin.com/jobs/view/123456789",
      "postedDate": "2023-12-20T10:00:00.000Z",
      "description": "We are looking for a Senior React Developer..."
    }
  ]
}

Error Handling

The API returns appropriate error messages and status codes:

{
  "success": false,
  "error": {
    "message": "Keywords parameter is required",
    "status": 400
  }
}

Rate Limiting

To prevent abuse, the API implements rate limiting:

  • 100 requests per hour per IP
  • Customizable limits through configuration

Testing

# Run the test suite
npm test

# Test specific endpoints
npm run test:api

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Atharv Hatwar

Legal Notice

This package is for educational purposes only. Please review LinkedIn's terms of service before using this API in production.