Can I call batch geocoder request with XmlHttpRequest?


I'm trying to make a batch geocoding call to API using XmlHttpRequest, and I'm getting no results

According to HERE.COM documentation, I can make a batch geocoding call to{YOUR_APP_ID}&pp_code={YOUR_APP_CODE}&mailto=<your_email_address>&outdelim=|&outcols=displayLatitude,displayLongitude,locationLabel,  houseNumber,street,district,city,postalCode,county,state,country&outputcombined=false

and then, in POST body

0001|Invalidenstra├če 116 10115 Berlin|DEU
0002|Am Kronberger Hang 8 65824 Schwalbach|DEU
0003|425 W Randolph St Chicago IL 60606|USA

I'm trying to get some response using XmlHttpRequest from JavaScript, using this code:

geocode = function()    {
    var xhttp = new XMLHttpRequest();

    var osmURL=""

    xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {

    xhttp.onload = function() {
        if (this.readyState == 4 && this.status == 200) {

    var postToSend = 
        "recId|searchText|country" + "\r\n" +
        "0001|Invalidenstra├če 116 10115 Berlin|DEU" + "\r\n" + 
        "0002|Am Kronberger Hang 8 65824 Schwalbach|DEU" + "\r\n" +
        "0003|425 W Randolph St Chicago IL 60606|USA";"POST", osmURL, true);

I expect the output to be something similar to:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:SearchBatch xmlns:ns2="">

but no results are returned, even no status. I've done individual calls without problems, so the URL must be reachable.

Have you tried something like this?

Thanks in advance, Joan.

EDIT: Investigating a bit more, I'm getting a "XMLHttpRequest: Network Error 0x80070005, Access is denied" error, and something related to CORS. How can I present valid credentials so Access is allowed? Thanks.

asked on Stack Overflow Jan 22, 2019 by Joan Segura • edited Jan 22, 2019 by Joan Segura

1 Answer


Maybe the encoding of the 'outdelim'-parameter is the culprit; change pipe '|' to '%7C'. This also applies to 'indelim'.

See also The Batch Geocoder API returns only failed status

answered on Stack Overflow Jan 24, 2019 by ckHERE

User contributions licensed under CC BY-SA 3.0