The GeoTree is available as an application programming interface (API) for use within your own applications. Below is a QueryBuilder that will help you construct a URL to access the API.
The root of the API is this URL: http://api.foundationcenter.org/geoTree/searchByName.php? Parameters and values should be appended to the root of the URL. Parameters are separated from values with an equal sign (=), and parameter/value pairs are separated with an ampersand (&) -- try the QueryBuilder below to see an example.
The GeoTree API accepts 4 parameters, including:
- searchText - the value for this parameter will be the geographic area you are searching for, e.g., 'Brooklyn', 'Sudan', or 'San Bernardino'.
- searchAll - valid values for this parameter are "Y" and "N". Use "Y" in include all partial name matches, and "N" to only include exact name matches.
- format - valid values for this parameter are "JSON" and "XML".
Here is an example of an API call that will return GeoTree information about "Sudan", showing only exact matches, and in the JSON format:
GeoTree API QueryBuilder
Use the QueryBuilder below to construct a GeoTree API query. Click "Generate API call & response" to generate a well-formed API query for use in your application. Appearing below the query will be an example of the results that are returned when that query is submitted.