Spaces:
Sleeping
Sleeping
Delete job_api.py
Browse files- job_api.py +0 -24
job_api.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import requests
|
| 3 |
-
|
| 4 |
-
ADZUNA_APP_ID = os.getenv("ADZUNA_APP_ID")
|
| 5 |
-
ADZUNA_APP_KEY = os.getenv("ADZUNA_APP_KEY")
|
| 6 |
-
|
| 7 |
-
def fetch_job_listings_adzuna(keywords, location="United States", results_limit=10):
|
| 8 |
-
url = f"https://api.adzuna.com/v1/api/jobs/us/search/1"
|
| 9 |
-
params = {
|
| 10 |
-
"app_id": ADZUNA_APP_ID,
|
| 11 |
-
"app_key": ADZUNA_APP_KEY,
|
| 12 |
-
"what": keywords,
|
| 13 |
-
"where": location,
|
| 14 |
-
"results_per_page": results_limit,
|
| 15 |
-
"content-type": "application/json",
|
| 16 |
-
}
|
| 17 |
-
try:
|
| 18 |
-
response = requests.get(url, params=params)
|
| 19 |
-
response.raise_for_status()
|
| 20 |
-
data = response.json()
|
| 21 |
-
return data.get("results", [])
|
| 22 |
-
except Exception as e:
|
| 23 |
-
print(f"Error fetching job listings: {e}")
|
| 24 |
-
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|