forked from bundesAPI/jobsuche-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi_example.py
26 lines (23 loc) · 863 Bytes
/
api_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import requests
def search(what, where):
"""search for jobs. params can be found here: https://jobsuche.api.bund.dev/"""
params = (
('angebotsart', '1'),
('page', '1'),
('pav', 'false'),
('size', '100'),
('umkreis', '25'),
('was', what),
('wo', where),
)
headers = {
'User-Agent': 'Jobsuche/2.9.2 (de.arbeitsagentur.jobboerse; build:1077; iOS 15.1.0) Alamofire/5.4.4',
'Host': 'rest.arbeitsagentur.de',
'X-API-Key': 'jobboerse-jobsuche',
'Connection': 'keep-alive',
}
response = requests.get('https://rest.arbeitsagentur.de/jobboerse/jobsuche-service/pc/v4/app/jobs',
headers=headers, params=params, verify=False)
return response.json()
result = search("bahn", "berlin")
print(result['stellenangebote'][0]["refnr"])