Archived
1
0
This repository has been archived on 2025-04-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
schools/main/great_schools.py
2022-04-03 16:24:05 -04:00

21 lines
509 B
Python

#!/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