Beginning to build the great schools API wrapper.
This commit is contained in:
21
main/great_schools.py
Normal file
21
main/great_schools.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
import requests
|
||||
|
||||
# Helper file to facilitate calls to the greatschools.org API
|
||||
|
||||
# Endpoint: nearby-schools
|
||||
def get_nearby_schools(key: str):
|
||||
url = 'https://gs-api.greatschools.org/nearby-schools'
|
||||
params = {
|
||||
'lat': "42.3",
|
||||
'lon': "-71.2",
|
||||
'school_type': "public",
|
||||
'distance': "50",
|
||||
'page': "45"
|
||||
}
|
||||
headers = {
|
||||
"x-api-key": key
|
||||
}
|
||||
r = requests.get(url=url, params=params, headers=headers)
|
||||
print(r.text)
|
||||
return
|
||||
Reference in New Issue
Block a user