The batch geocoding service allows multiple locations to be geocoded at the same time.
https://www.mapquestapi.com/geocoding/v1/batch
Response Formats | JSON, XML, CSV |
---|---|
Authentication | Yes (Requires Key) |
Rate Limited | Yes |
The API Key, which is needed to make requests to MapQuest services.
The location to geocode.
A limit of 100 locations exists for one call.
location=Denver,CO&location=Boulder,CO
When using batch geocoding or when ambiguous results are returned, any results within the provided bounding box will be moved to the top of the results list. Bounding box format is: upper left latitude, upper left longitude, lower right latitude, lower right longitude.
boundingBox=40.099998,-77.305603,39.099998,-75.305603
This option tells the service whether it should fail when given a latitude/longitude pair in a batch geocode call, or if it should ignore that and try and geocode what it can.
ignoreLatLngInput=true
This parameter tells the service whether it should return a URL to a static map thumbnail image for a location being geocoded.
thumbMaps=false
The max number of locations to return from the batch geocode
This option will only have an effect on the second location because it is ambiguous
maxResults=5
Specifies the format of the response. Must be one of the following, if supplied:
outFormat=xml
Specifies the delimiter used in the csv response
delimiter=|
A JavaScript function name. The JSON-formatted response will be wrapped in a call to the supplied callback function name to provide JSONP functionality. This functionality might be needed to do cross-site scripting. See the Wikipedia.org entry for JSON for more details.
callback=batchGeocodeResult
The provided location properties passed in the geocode request.
Returns the latitude/longitude for routing and is the nearest point on a road for the entrance.
Street address.
Neighborhood name.
City name.
County name.
State name.
Country name.
Postal code.
Type of location.
Is location a drag point? This option only applies when
making a dragroute
call.
A lat/lng pair that can be helpful when showing this address as a Point of Interest.
The precision of the geocoded location.
Refer to the Geocode Quality reference page for more information.
The five character quality code for the precision of the geocoded location.
Refer to the Geocode Quality reference page for more information.
String that identifies the closest road to the address for routing purposes.
Specifies the side of street.
This field contains information about the response.
The statuscode subfield is an integer return value. Refer to the status codes page for more details about our status codes and error messages.
The messages subfield is an array of error messages that describe the status
GET
https://www.mapquestapi.com/geocoding/v1/batch?key=KEY&location=Denver,CO&location=Boulder,CO
{
"info": {
"statuscode": 0,
"copyright": {
"text": "© 2023 MapQuest, Inc.",
"imageUrl": "https://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2023 MapQuest, Inc."
},
"messages": []
},
"options": {
"maxResults": -1,
"thumbMaps": true,
"ignoreLatLngInput": false
},
"results": [
{
"providedLocation": {
"location": "Denver,CO"
},
"locations": [
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "Denver",
"adminArea5Type": "City",
"adminArea4": "Denver County",
"adminArea4Type": "County",
"adminArea3": "CO",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "A5XAX",
"geocodeQuality": "CITY",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "282041090",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 39.738453,
"lng": -104.984853
},
"displayLatLng": {
"lat": 39.738453,
"lng": -104.984853
},
"mapUrl": "https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-1,39.738453,-104.984853,0,0,|¢er=39.738453,-104.984853&zoom=12&rand=1728616380"
},
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "",
"adminArea5Type": "City",
"adminArea4": "Denver County",
"adminArea4Type": "County",
"adminArea3": "CO",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "A4XAX",
"geocodeQuality": "COUNTY",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "282932003",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 39.738453,
"lng": -104.984853
},
"displayLatLng": {
"lat": 39.738453,
"lng": -104.984853
},
"mapUrl": "https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-2,39.738453,-104.984853,0,0,|¢er=39.738453,-104.984853&zoom=9&rand=395607621"
}
]
},
{
"providedLocation": {
"location": "Boulder,CO"
},
"locations": [
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "Boulder",
"adminArea5Type": "City",
"adminArea4": "Boulder County",
"adminArea4Type": "County",
"adminArea3": "CO",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "A5XAX",
"geocodeQuality": "CITY",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "282039983",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 40.015831,
"lng": -105.27927
},
"displayLatLng": {
"lat": 40.015831,
"lng": -105.27927
},
"mapUrl": "https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-1,40.015831,-105.27927,0,0,|¢er=40.015831,-105.27927&zoom=12&rand=1112039143"
},
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "",
"adminArea5Type": "City",
"adminArea4": "Boulder County",
"adminArea4Type": "County",
"adminArea3": "CO",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "A4XAX",
"geocodeQuality": "COUNTY",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "282931994",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 40.015831,
"lng": -105.27927
},
"displayLatLng": {
"lat": 40.015831,
"lng": -105.27927
},
"mapUrl": "https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-2,40.015831,-105.27927,0,0,|¢er=40.015831,-105.27927&zoom=9&rand=-705634201"
}
]
}
]
}
<?xml version='1.0' encoding='utf-8'?>
<response>
<info>
<statusCode>0</statusCode>
<messages />
<copyright>
<imageUrl>https://api.mqcdn.com/res/mqlogo.gif</imageUrl>
<imageAltText>© 2023 MapQuest, Inc.</imageAltText>
<text>© 2023 MapQuest, Inc.</text>
</copyright>
</info>
<results>
<result>
<providedLocation>
<location>Denver,CO</location>
</providedLocation>
<locations>
<location>
<street />
<adminArea6 type='Neighborhood' />
<adminArea5 type='City'>Denver</adminArea5>
<adminArea3 type='State'>CO</adminArea3>
<adminArea4 type='County'>Denver County</adminArea4>
<postalCode />
<adminArea1 type='Country'>US</adminArea1>
<geocodeQuality>CITY</geocodeQuality>
<geocodeQualityCode>A5XAX</geocodeQualityCode>
<dragPoint>false</dragPoint>
<sideOfStreet>N</sideOfStreet>
<displayLatLng>
<latLng>
<lat>39.738453</lat>
<lng>-104.984853</lng>
</latLng>
</displayLatLng>
<linkId>282041090</linkId>
<unknownInput />
<type>s</type>
<latLng>
<lat>39.738453</lat>
<lng>-104.984853</lng>
</latLng>
<mapUrl>
<![CDATA[https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-1,39.738453,-104.984853,0,0,|¢er=39.738453,-104.984853&zoom=12&rand=-1232159039]]>
</mapUrl>
</location>
<location>
<street />
<adminArea6 type='Neighborhood' />
<adminArea5 type='City' />
<adminArea3 type='State'>CO</adminArea3>
<adminArea4 type='County'>Denver County</adminArea4>
<postalCode />
<adminArea1 type='Country'>US</adminArea1>
<geocodeQuality>COUNTY</geocodeQuality>
<geocodeQualityCode>A4XAX</geocodeQualityCode>
<dragPoint>false</dragPoint>
<sideOfStreet>N</sideOfStreet>
<displayLatLng>
<latLng>
<lat>39.738453</lat>
<lng>-104.984853</lng>
</latLng>
</displayLatLng>
<linkId>282932003</linkId>
<unknownInput />
<type>s</type>
<latLng>
<lat>39.738453</lat>
<lng>-104.984853</lng>
</latLng>
<mapUrl>
<![CDATA[https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-2,39.738453,-104.984853,0,0,|¢er=39.738453,-104.984853&zoom=9&rand=630477889]]>
</mapUrl>
</location>
</locations>
</result>
<result>
<providedLocation>
<location>Boulder,CO</location>
</providedLocation>
<locations>
<location>
<street />
<adminArea6 type='Neighborhood' />
<adminArea5 type='City'>Boulder</adminArea5>
<adminArea3 type='State'>CO</adminArea3>
<adminArea4 type='County'>Boulder County</adminArea4>
<postalCode />
<adminArea1 type='Country'>US</adminArea1>
<geocodeQuality>CITY</geocodeQuality>
<geocodeQualityCode>A5XAX</geocodeQualityCode>
<dragPoint>false</dragPoint>
<sideOfStreet>N</sideOfStreet>
<displayLatLng>
<latLng>
<lat>40.015831</lat>
<lng>-105.27927</lng>
</latLng>
</displayLatLng>
<linkId>282039983</linkId>
<unknownInput />
<type>s</type>
<latLng>
<lat>40.015831</lat>
<lng>-105.27927</lng>
</latLng>
<mapUrl>
<![CDATA[https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-1,40.015831,-105.27927,0,0,|¢er=40.015831,-105.27927&zoom=12&rand=-1320394094]]>
</mapUrl>
</location>
<location>
<street />
<adminArea6 type='Neighborhood' />
<adminArea5 type='City' />
<adminArea3 type='State'>CO</adminArea3>
<adminArea4 type='County'>Boulder County</adminArea4>
<postalCode />
<adminArea1 type='Country'>US</adminArea1>
<geocodeQuality>COUNTY</geocodeQuality>
<geocodeQualityCode>A4XAX</geocodeQualityCode>
<dragPoint>false</dragPoint>
<sideOfStreet>N</sideOfStreet>
<displayLatLng>
<latLng>
<lat>40.015831</lat>
<lng>-105.27927</lng>
</latLng>
</displayLatLng>
<linkId>282931994</linkId>
<unknownInput />
<type>s</type>
<latLng>
<lat>40.015831</lat>
<lng>-105.27927</lng>
</latLng>
<mapUrl>
<![CDATA[https://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-2,40.015831,-105.27927,0,0,|¢er=40.015831,-105.27927&zoom=9&rand=-541962107]]>
</mapUrl>
</location>
</locations>
</result>
</results>
<options>
<maxResults>-1</maxResults>
<thumbMaps>true</thumbMaps>
<ignoreLatLngInput>false</ignoreLatLngInput>
<boundingBox />
</options>
</response>
"Country","State","County","City","PostalCode","Street","Lat","Lng","DragPoint","LinkId","Type","GeocodeQualityCode","GeocodeQuality","SideOfStreet","DisplayLat","DisplayLng"
"US","CO","Denver County","Denver","","","39.738453","-104.984853","false","282041090","s","A5XAX","CITY","N","39.738453","-104.984853"
"US","CO","Denver County","","","","39.738453","-104.984853","false","282932003","s","A4XAX","COUNTY","N","39.738453","-104.984853"
"US","CO","Boulder County","Boulder","","","40.015831","-105.27927","false","282039983","s","A5XAX","CITY","N","40.015831","-105.27927"
"US","CO","Boulder County","","","","40.015831","-105.27927","false","282931994","s","A4XAX","COUNTY","N","40.015831","-105.27927