2023-08-19 17:36:44 -07:00
|
|
|
# JobSpy Scraper
|
2023-07-10 20:14:38 -07:00
|
|
|
|
|
|
|
## Features
|
|
|
|
|
2023-08-19 16:44:16 -07:00
|
|
|
- Scrapes job postings from **LinkedIn**, **Indeed**, **ZipRecruiter**
|
|
|
|
- Returns jobs with title, location, company, and other data
|
|
|
|
- JWT authorization
|
|
|
|
|
2023-08-19 18:41:46 -07:00
|
|
|
![jobspy](https://github.com/cullenwatson/jobspy/assets/78247585/25e66a30-f151-4a68-90b7-dc5874260ee1)
|
2023-08-19 18:22:57 -07:00
|
|
|
|
2023-07-10 20:14:38 -07:00
|
|
|
## Endpoints
|
2023-08-19 18:41:46 -07:00
|
|
|
![image](https://github.com/cullenwatson/jobspy/assets/78247585/22c8840d-41e5-4b56-998b-3979787ad76c)
|
|
|
|
|
2023-08-19 16:44:16 -07:00
|
|
|
|
|
|
|
### Jobs Endpoint
|
|
|
|
|
|
|
|
**Endpoint**: `/api/v1/jobs/`
|
|
|
|
|
|
|
|
#### Parameters:
|
|
|
|
- **site_type**: str (Required) - Options: `linkedin`, `zip_recruiter`, `indeed`
|
|
|
|
- **search_term**: str (Required)
|
|
|
|
- **location**: int
|
|
|
|
- **distance**: int
|
|
|
|
- **job_type**: str - Options: `fulltime`, `parttime`, `internship`, `contract`
|
|
|
|
- **is_remote**: bool
|
|
|
|
- **results_wanted**: int
|
|
|
|
- **easy_apply**: bool (Only for LinkedIn)
|
|
|
|
|
2023-08-23 16:05:17 -07:00
|
|
|
### Example
|
|
|
|
![image](https://github.com/cullenwatson/jobspy/assets/78247585/0e52db2d-ed6b-44e5-8ece-16de707f33ec)
|
|
|
|
|
|
|
|
|
2023-08-23 15:52:36 -07:00
|
|
|
## Response
|
|
|
|
|
|
|
|
### Schema
|
|
|
|
|
|
|
|
#### JobResponse
|
2023-08-23 16:08:48 -07:00
|
|
|
- **success**: bool - Indicates if the request was successful
|
|
|
|
- **error**: str - Any error messages, null if no error
|
|
|
|
- **jobs**: list[JobPost] - A list of job postings
|
|
|
|
- **total_results**: int - Total number of results found
|
|
|
|
- **returned_results**: int - Number of results returned in this request
|
2023-08-23 15:52:36 -07:00
|
|
|
|
|
|
|
#### JobPost
|
2023-08-23 16:08:48 -07:00
|
|
|
- **title**: str
|
2023-08-23 16:07:55 -07:00
|
|
|
- **company_name**: str
|
|
|
|
- **job_url**: str
|
|
|
|
- **location**: object - (country, city, state, postal_code, address)
|
|
|
|
- **description**: str
|
|
|
|
- **job_type**: str - Options: `fulltime`, `parttime`, `internship`, `contract`
|
|
|
|
- **compensation**: object - Contains: `interval`, `min_amount`, `max_amount`, `currency`
|
|
|
|
- **date_posted**: str
|
2023-08-23 15:52:36 -07:00
|
|
|
|
|
|
|
### Example
|
|
|
|
![image](https://github.com/cullenwatson/jobspy/assets/78247585/73cb4423-8a53-456a-9da5-9ce7c56d5282)
|
|
|
|
|
2023-07-10 20:14:38 -07:00
|
|
|
## Installation
|
2023-08-19 18:15:41 -07:00
|
|
|
_Python >= 3.10 required_
|
2023-08-17 13:46:03 -07:00
|
|
|
1. Clone this repository
|
|
|
|
2. Install the dependencies with `pip install -r requirements.txt`
|
2023-08-19 16:44:16 -07:00
|
|
|
4. Run the server with `uvicorn main:app --reload`
|
2023-07-10 20:14:38 -07:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2023-08-19 18:15:41 -07:00
|
|
|
Visit [http://localhost:8000/docs](http://localhost:8000/docs) to see the interactive API documentation.
|
2023-08-19 16:44:16 -07:00
|
|
|
|
|
|
|
## FAQ
|
|
|
|
|
2023-08-19 18:37:49 -07:00
|
|
|
### I'm having issues with my queries. What should I do?
|
2023-08-19 16:44:16 -07:00
|
|
|
|
2023-08-19 18:37:49 -07:00
|
|
|
Broadening your filters can often help. Additionally, try reducing the number of `results_wanted`.
|
|
|
|
If issues still persist, feel free to submit an issue.
|
2023-08-19 16:44:16 -07:00
|
|
|
|
2023-08-19 18:37:49 -07:00
|
|
|
### How to enable auth?
|
2023-08-19 16:44:16 -07:00
|
|
|
|
2023-08-19 18:37:49 -07:00
|
|
|
Change `AUTH_REQUIRED` in `/settings.py` to `True`
|
2023-07-10 20:14:38 -07:00
|
|
|
|
2023-08-19 18:45:53 -07:00
|
|
|
The auth uses [supabase](https://supabase.com). Create a project with a `users` table and disable RLS.
|
|
|
|
|
2023-08-19 18:47:05 -07:00
|
|
|
<img src="https://github.com/cullenwatson/jobspy/assets/78247585/03af18e1-5386-49ad-a2cf-d34232d9d747" width="500">
|
2023-08-19 18:45:53 -07:00
|
|
|
|
2023-08-19 18:37:49 -07:00
|
|
|
|
|
|
|
Add these three environment variables:
|
|
|
|
|
|
|
|
- `SUPABASE_URL`: go to project settings -> API -> Project URL
|
|
|
|
- `SUPABASE_KEY`: go to project settings -> API -> service_role secret
|
|
|
|
- `JWT_SECRET_KEY` - type `openssl rand -hex 32` in terminal to create a 32 byte secret key
|