Too many coordinate results in the response json file

First of all, thank you dear openrouteservice team for the great API provisions. Just a perfect alternative to Google!

Among other things, I use the Dashboard | ORS API for my routing project.

When I request the following coordinates of that address pattern:

Musterstrasse 10 d 01234 Musterstadt

I get all the “Musterstrassen” including their coordinates with a house number 10 in the address such as Musterstrasse 10 a, Musterstrasse 10 b, Musterstrasse 10 c, etc. in the responsed json file, which I didn’t ask for.

I know the possibility of the determine the desired coordinates of the target address by using a “for loop” including an “if statement” regarding a html form data and the json data comparison,


let search = new Array();
for (let i = 0; i < json_content.features.length; i++){
let housenumber_api = json_content.features[i].properties.housenumber;
if (housenumber_htmlform == housenumber_api){
search.push(json_content.features[i].geometry.coordinates);
}

but I would like to know if I can pass a parameter in the API request that only outputs the coordinates of the one address wich I’m looking for.

Thank you in advance for your help.

Hi @schilhan,

you could set the size parameter to 1 to just return the single most relevant result.
However that might not always be the location you are actually looking for (depending on the input, but with Musterstrasse 10 d 01234 Musterstadt it mimght be pretty accurate)

Best regards