Avantalytics External API Documentation v3.26FusionMaps Geolocation - DISCONTINUED (Jump to Section)Last Change: June 29, 2018 |
Avantalytics provides customers who purchase services access to certain API methods for the purposes of better integrating the data with the customer's in-house and/or third party systems. This documentation describes the available API calls and necessary parameters and return values. Currently all API output is only available via JSON format as described below. See below for details.
All access to the external API can be reached only through the following address: https://www.avantalytics.com/REST/. For all URLs listed below it is assumed that they are relative to this address. Please note, it is case sensitive.
All API calls below require you to use your unique customer access token in order to receive meaningful responses.
This should have been given to you, by us, during the initial API access discussions or during account signup. If you do not have one yet,
please contact Avantalytics support (support@avantalytics.com) to discuss the options.
{
"curr_time": 1540226339,
"success": 1,
"error": 0,
"msg": "The operation was successful.",
"permission": 1,
"finished": 1,
"start_time": 1540226337,
"authenticated": 1,
"msec": 1573,
"result": [...]
...
}
The examples above are meant to provide you with the minimal request/response for several popular languages. In all cases you should arrive with a json serialized string which you should deserialize into and object or array for consumption.
This API is designed to extend the functionality of FusionMaps XT library.
The FusionMaps XT library as offered by FusionCharts, while wonderful in so many ways, is limited in its lack of dynamic,
fine-grained, geolocation capabilities. This API provides a remedy for this limitation
and creates extensive capabilities for visualizing all facets of geolocation in your FusionMaps.
.
These API calls demonstrate how you can integrate custom GPS coordinate point generation as well as zip code point
generation, area covering, city covering and more for any of FusionMaps maps in the United States (including the state maps)
and a growing list of other FusionMaps from around the world.
For a complete list of FusionMaps which we support Geolocation for click here.
.
Click on any of the API calls below to learn more.
API CALL
GET
Zip Code To XML Marker Generation
This API call is made available to enhance our customers and partners ability to maximize the functionality of FusionMaps.
As we use Fusionmaps ourselves and were dissapointed with the lack of dynamic point creation based on zip codes or GPS coordinates
we decided to make it ourselves. A lot of census data and some crazy math and some coding, we're offering it out to our customers. Of course,
for this to be useful, you'd need Fusionmaps - check it out here.
We like it because its Flash OR Javascript capable, so its (Apple) flexible and reasonably priced. Currently, this is only
available for points within the US. We may expand it globally if we receive need request.
URI | Notes | Method |
REST Access:zipmappoint/{accountid}/{customer apikey}/{mapname}/{zip}/ |
All parameters are required.{accountid} - integer. {customer apikey} - string, 40 characters. {mapname} - 2 character state code, or 'USA'(default). {zip} - string, 5 digits. |
GET |
The response fields listed are in addition to the standard response fields. Currently the most often used map FusionMap format is XML
so we're supporting that. The response below will include a field which when JSON decoded will have one or more map markers
corresponding to the requested zip. This is directly injectable into your map XML data as is documented by FusionMaps.
We plan to enhance this in the next three months to include passing data marker attributes for the XML injection to prevent the need to
do so afterward. This would include point size and color according to FusionMaps documentation. Until this time, if you require a great level of customization
of your data points - use the XY API below to get just the coordinates and construct your own custom XML.
Below is an example output for successful request/response using our home zip code 22201 (Arlington, VA). Please notice
that the response shows the XML in the field "xml"
and because it is a field in a JSON response, the XML has been
escaped and therefore cannot be used directly - you will need to unescape it. The URL we used looks like this:
https://www.avantalytics.com/REST/zipmappoint/xxxx/0000000000000000000000000000000000000000/USA/22201/
where xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
Currently, this REST interface only supports HTTP GET requests and each request/response is limited to a single ZIP code. In practice you would probably have several to perhaps hundreds of points you'd like to place on a FusionMap. While you can make repeated requests and concatenate the XML response to construct a set of markers, this can reduce the speed of display when you make more than a few requests in realtime. In this case instead of fetching each point in realtime, you would want to pre-fetch and cache each request to increase the responsiveness of your application.{ "success": true, "error": false, "html": "The operation was successful.", "msg": "The operation was successful.", "permission": true, "authenticated": true,
}
API CALL
GET
Zip Code To X/Y Map Coordinate Translation
This API call is for those who wish to dynamically map points, but want to have more control over the
look of their points on a FusionMap. It is nearly identical in invocation to the XML Marker API call except
its response provides no XML, but instead simple X/Y coordinates for a given zip code suitable for mapping
on your choice of FusionMap.
URI | Notes | Method |
REST Access:zipmappointxy/{accountid}/{customer apikey}/{mapname}/{zip}/ |
All parameters are required.{accountid} - integer. {customer apikey} - string, 40 characters. {mapname} - 2 character state code, or 'USA'(default). {zip} - string, 5 digits. |
GET |
The response fields listed are shown in addition to the standard response fields.
Below is an example output for successful request/response using our home zip code 22201 (Arlington, VA) suitable
for display on the FusionMaps USA map. The URL we used looks like this:
https://www.avantalytics.com/REST/zipmappointxy/xxxx/0000000000000000000000000000000000000000/USA/22201/
where xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
string
s.
{
"success": true,
"error": false,
"html": "The operation was successful.",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
{
"x": "601",
"y": "186",
"name": "22201"
}
]
}
}
coordinates
which is itself
an object with a property coordinates
which is an array of (x,y) coordinates. This is because it allows
for the returning of more than one coordinate potentially while preserving the parent object format.
https://www.avantalytics.com/REST/zipmappointxy/xxxx/0000000000000000000000000000000000000000/VA/22201/
xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
{
"success": true,
"error": false,
"html": "The operation was successful.",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
{
"x": "685",
"y": "121",
"name": "22201"
}
]
}
}
https://www.avantalytics.com/REST/zipmappointxy/xxxx/0000000000000000000000000000000000000000/VA/00000/
xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
{
"success": false,
"error": true,
"html": "The operation was unsuccessful.",
"msg": "Bad Zip 0000",
"permission": true,
"authenticated": false,
"coordinates": []
}
Please note this particular case where the zip code supplied is VALID, but in reality it is not located within the state
requested. In this case, the operation will report success, however you will not be given any result in the array
The URL we used looks like this - here we requested to map zip code 01243 (Somerville,MA) on the map of Virginia:
https://www.avantalytics.com/REST/zipmappointxy/xxxx/0000000000000000000000000000000000000000/VA/02143/
where xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
{
"success": true,
"error": false,
"html": "The operation was successful.",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
]
}
}
API CALL
GET
Zip Code X/Y Map Coordinate "Pointilation"
This API call is a special feature unique to Avantalytics. We use a method derived from an art-form
known as
"pointilism" which involves the filling in of an area (a canvas or a FusionMaps map, for example) by
creating a number of "points" (in this case x/y coordinate points) such that the given area on the canvas
is appears "covered" or "filled in" by the points.
We find this more useful than a simple circle or polygon to cover highly complex polygonal areas on a
given map. This usually occurs when using maps of smaller regions (states) where you want a higher level of
precision covering an area. Zip codes just so happen to be these types of areas, and hence this function.
You provide a zip code much as with the calls above and you receive the distinct (X/Y) coordinates required to
adequately cover the zip code on the map requested!
Note: This is best utilized for small numbers of areas - using this with many points may cause your browser rendering to become sluggish
URI | Notes | Method |
REST Access:zippointilatexy/{accountid}/{customer apikey}/{mapname}/{zip}/ |
All parameters are required.{accountid} - integer. {customer apikey} - string, 40 characters. {mapname} - 2 character state code, or 'USA'(default). {zip} - string, 5 digits. |
GET |
The response fields listed are shown in addition to the standard response fields.
Below is an example output for successful request/response using a famous zip code: 90210, suitable
for display on the FusionMaps USA map. The URL we used looks like this:
https://www.avantalytics.com/REST/zippointilatexy/xxxx/0000000000000000000000000000000000000000/USA/90210/
where xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
string
s.
{
"success": true,
"error": false,
"html": "The operation was successful.",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
{
"x": "93",
"y": "259",
"name": ""
},
{
"x": "92",
"y": "259",
"name": ""
},
{
"x": "92",
"y": "258",
"name": ""
},
{
"x": "93",
"y": "258",
"name": ""
},
{
"x": "94",
"y": "258",
"name": ""
}
]
}
}
coordinates
which is itself
an object with a property coordinates
which is an array of (x,y) coordinates. This is because it allows
for the returning of more than one coordinate potentially while preserving the parent object format.
API CALL
GET
City,State X/Y Map Coordinate "Pointilation"
This API call uses a special feature unique to Avantalytics. We use a method derived from an art-form
known as
"pointilism" which involves the filling in of an area (a canvas or a FusionMaps map, for example) by
creating a number of "points" (in this case x/y coordinate points) such that the given area on the canvas
is appears "covered" or "filled in" by the points.
We find this useful more useful than a simple circle or polygon to cover highly complex polygonal areas on a
given map. This usually occurs when using maps of smaller regions (states) where you want a higher level of
precision covering an area. Cities just so happen to be these types of areas, and hence this function.
You provide a city, state much as with the calls above and you receive the distinct (X/Y) coordinates required to
adequately cover the city on the map requested!
Note: This is best utilized for small numbers of areas - using this with many points may cause your browser rendering to become sluggish
URI | Notes | Method |
REST Access:citypointilatexy/{accountid}/{customer apikey}/{mapname}/{state}/{city}/ |
All parameters are required.{accountid} - integer. {customer apikey} - string, 40 characters. {mapname} - 2 character state code, or 'USA'(default). {city} - string, name of the city. {state} - string, 2 character state code. |
GET |
The response fields listed are shown in addition to the standard response fields.
Below is an example output for successful request/response using Arlington, TX and is suitable
for display on the FusionMaps USA map. The URL we used looks like this:
https://www.avantalytics.com/REST/citypointilatexy/xxxx/0000000000000000000000000000000000000000/USA/TX/Arlington/
where xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
string
s.
{
"success": true,
"error": false,
"html": "The operation was successful.<\/p>",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
{
"x": "359",
"y": "281",
"name": ""
},
{
"x": "357",
"y": "281",
"name": ""
},
{
"x": "358",
"y": "281",
"name": ""
},
{
"x": "358",
"y": "280",
"name": ""
},
{
"x": "357",
"y": "280",
"name": ""
},
{
"x": "359",
"y": "280",
"name": ""
},
{
"x": "359",
"y": "279",
"name": ""
},
{
"x": "358",
"y": "279",
"name": ""
},
{
"x": "358",
"y": "278",
"name": ""
},
{
"x": "359",
"y": "278",
"name": ""
}
]
}
}
coordinates
which is itself
an object with a property coordinates
which is an array of (x,y) coordinates. This is because it allows
for the returning of more than one coordinate potentially while preserving the parent object format.
API CALL
GET
GPS Coordinate (Lat/Lon) To X/Y Coordinate Translation
This API call provides the capability of mapping GPS coordinates on a map. This is useful when you have raw location-based
data which you'd like to map directly without doing any further translation. Please note that while the latitude and longitude
values accepted include accuracies of well over 5 decimals, each point must be mapped to an X/Y coordinate that will require
rounding and limit the ability to use the extended decimal somewhat.
URI | Notes | Method |
REST Access:gpsmappointxy/{accountid}/{customer apikey}/{mapname}/{latitude}/{longitude}/ |
All parameters are required.{accountid} - integer. {customer apikey} - string, 40 characters. {mapname} - 2 character state code, or 'USA'(default). {latitude} - float. {longitude} - float. |
GET |
The response fields listed are in addition to the standard response fields. and the response is identical to the
zip code API call returning X/Y coordinates.
Below is an example output for successful request/response using our home zip code 22201 (Arlington, VA).
The URL we used looks like this:
https://www.avantalytics.com/REST/gpsmappointxy/xxxx/0000000000000000000000000000000000000000/USA/25.79/-80.32/
where xxxx
is a valid account id and 0000000000000000000000000000000000000000
is the account's
40 character unique key.
{
"success": true,
"error": false,
"html": "The operation was successful.",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
{
"x": "352",
"y": "1791"
}
]
}
}
Currently, this REST interface only supports single zip/gps/point GET requests
and therefore all each GET style request/response is limited to a single ZIP / GPS Coordinate.
In practice you would probably have several to perhaps hundreds of points you'd like to place on a FusionMap. While you can
make repeated requests to construct a set of markers, this can reduce the speed of display
when you make more than a few requests in realtime due to multiple network roundtrips.
In this case instead of fetching each point in realtime via GET, you would want to pre-fetch and cache each request
to increase the responsiveness of your application.
API CALL
POST
Multiple Zip Code To X/Y Map Coordinate Translation
This API call is for those who wish to dynamically map points, want to have more control over the
look of their points on a FusionMap and wish to map many points at once in the most efficent manner. Doing
so requires the use of POST requests. The response format for all responses is identical to the GET requests
described above, except you will see the coordinates field will now contain multiple pieces of data corresponding
to your post request parameters.
While the response format is identical, please note that the request URL is shorter
This is reflective of the fact that you will pass your accountid and customer key, map name and zip request data in the post request itself as a JSON string.
URI | Notes | Method |
REST Access:zipmappointxy/ |
The POST version accepts one parameter |
POST |
The response fields listed are shown in addition to the standard response fields.
Below is an example output for a successful POST request/response using the three zip codes:
our home zip code 22201 (Arlington, VA), 90210 - Beverly Hills, CA, and 10001 - New York, NY.
string
s.
{
"success": true,
"error": false,
"html": "The operation was successful.",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
{ "x": "601", "y": "186", "name": "22201" },
{ "x": "93", "y": "259", "name": "90210" },
{ "x": "643", "y": "158", "name": "10001" }
]
}
}
coordinates
which is itself
and object with a property coordinates
which is an array of objects containing the (x,y) coordinates. This is because it allows
for the returning of more than one coordinate potentially while preserving the parent object format.
Below are code fragments to explain how to make a POST request in a variety of popular server programming languages in order to integrate the use of this API into your code.
API CALL
POST
Multiple GPS To X/Y Map Coordinate Translation
This API call is for those who wish to dynamically map points, want to have more control over the
look of their points on a FusionMap and wish to map many points at once in the most efficent manner. Doing
so requires the use of POST requests. The response format for all responses is identical to the GET requests
described above, except you will see the coordinates field will now contain multiple pieces of data corresponding
to your post request parameters.
While the response format is identical, please note that the request URL is shorter
This is reflective of the fact that you will pass your accountid and customer key, map name and GPS request data in the post request itself as a JSON string.
URI | Notes | Method |
REST Access:gpsmappointxy/ |
The POST version accepts one parameter |
POST |
The response fields listed are shown in addition to the standard response fields.
Below is an example output for a successful POST request/response using the three GPS coordinates:
our home zip code 22201 (Arlington, VA), 90210 - Beverly Hills, CA, and 10001 - New York, NY.
string
s.
{
"success": true,
"error": false,
"html": "The operation was successful.",
"msg": "The operation was successful.",
"permission": true,
"authenticated": true,
"coordinates": {
"coordinates": [
{
"x": "93",
"y": "259",
"name": ""
},
{
"x": "92",
"y": "259",
"name": ""
},
{
"x": "92",
"y": "258",
"name": ""
},
{
"x": "93",
"y": "258",
"name": ""
},
{
"x": "94",
"y": "258",
"name": ""
}
]
}
}
coordinates
which is itself
and object with a property coordinates
which is an array of objects containing the (x,y) coordinates. This is because it allows
for the returning of more than one coordinate potentially while preserving the parent object format.
Should you have any trouble or questions regarding this or any other API call, please contact Avantalytics Support.