Advertisement

Nearby Cities

Returns a list of cities near another city. All calls for a Nearby Cities are in this format:
http://api.greatschools.org/cities/nearby/[components]?[parameters]

Components

Components of the url describe what type of data you would like. They are separated by forward slashes.
NameDescriptionSample Values
state*Two letter state abbreviationak
CA
city*Name of city, with spaces replaced with hyphens. If the city name has hyphens, replace those with underscores. Any other special characters should be URL-encodedSan Francisco becomes "San-Francisco"
Cardiff-By-The-Sea becomes "Cardiff_By_The_Sea"
*required

Parameters

The "key" parameter is what you use to send us your API key.
NameDescriptionSample Values
key*Your API keymyAPIkey
radiusRadius in miles to confine search to. Defaults to 15 and can be in the range 1-100.10
sortHow to sort the results. Defaults to "distance". Other options are "name" to sort by city name in alphabetical order, and "rating" to sort by GS city rating, highest first.Valid values: "distance", "name", "rating"
*required
Examples of usage:
http://api.greatschools.org/cities/nearby/CA/San-Francisco?key=[yourAPIKey]
Returns cities within 15 miles of San Francisco.
http://api.greatschools.org/cities/nearby/CA/San-Francisco?key=[yourAPIKey]&radius=5&sort=rating
Returns cities within 5 miles of San Francisco, ordered by highest GS city rating first.

Sample Request

http://api.greatschools.org/cities/nearby/CA/Bakersfield?key=[yourAPIKey]&radius=16
Returns cities within 16 miles of Bakersfield, CA.

Sample Response

Have Questions?

To ask questions or to report bugs please email api-support@greatschools.org. Please do not abuse our API. Review the Terms of Use.