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
![jobspy_backend_demo ](https://github.com/JobSpy-ai/backend/assets/78247585/d54d403a-2cac-48c9-97e6-69ffa3fb56f5 )
2023-07-10 20:14:38 -07:00
## Endpoints
2023-08-19 16:44:16 -07:00
![image ](https://github.com/JobSpy-ai/backend/assets/78247585/dd619564-d7cb-4a93-8937-33e0beb0fb6a )
### 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)
## .env for auth
The auth uses [supabase ](https://supabase.com ). Create a project with a `users` table and disable RLS.
< img src = "https://github.com/JobSpy-ai/backend/assets/78247585/d6ebf4f3-962f-4a91-b484-d610bd3f15fc" width = "500" >
2023-07-10 20:14:38 -07:00
2023-08-19 16:44:16 -07:00
Add these two 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
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
3. Add `.env` with variables from above
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
### I'm getting a 404 error when querying LinkedIn. What can I do?
LinkedIn's API is generally more strict. If you encounter a 404 error, try reducing the `results_wanted` parameter. There may not be enough results.
### I'm having issues with my queries. What should I do?
Broadening your filters can often help. For instance, if you're using very specific criteria, try making them more general to retrieve results more reliably. If it still persists, submit an issue.
2023-07-10 20:14:38 -07:00
2023-08-19 17:27:25 -07:00
### How to remove auth (no .env)?
Remove this part from `api/v1/__init__.py`
2023-08-19 17:27:59 -07:00
2023-08-19 17:27:25 -07:00
![image ](https://github.com/cullenwatson/jobspy/assets/78247585/383ca172-cc36-4f89-b26d-c25d9c67bea7 )