Some API calls work only in the Browser

5 posts / 0 new
Last post
tegut
Some API calls work only in the Browser

When doing a API call I get different results through curl and in the browser. Lets's say I have the following request:

http://open.mapquestapi.com/nominatim/v1/search.php?key=VALID_API_KEY&ad...

In the browser I get the expected result, through curl just "[]" which means an empty result.

With the following request I get the same results in the browser and through curl.

http://open.mapquestapi.com/nominatim/v1/search.php?key=VALID_API_KEY&ad...

The parameters in the URL seem to be correct encoded.

 

Has anybody a clue what is going on?

 


MQBrianCoakley
I get the same result in the
I get the same result in the browser and curl for http://open.mapquestapi.com/nominatim/v1/search.php?key=KEY&addressdetai... Both return []. Are you still getting different results?  

tegut
That's strange I'm still

That's strange I'm still getting different results. I tried the Nominatim Server of openstrettmap.org as reference. This service (http://nominatim.openstreetmap.org/search?countrycodes=de&addressdetails...) gives me the same results with curl and directly in the browser, which are not empty.

By the way you shouldn't get an emtpy result in the browser or with curl. There should be something like this:

[{"place_id":"77125956","licence":"Data © OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"52754726","boundingbox":["50.559957","50.560681","9.6474049","9.6495984"],"lat":"50.5603104","lon":"9.6483697","display_name":"Maberzeller Straße, Horas, Fulda, Landkreis Fulda, Regierungsbezirk Kassel, Hessen, 36041, Deutschland, Europe","class":"highway","type":"primary","importance":0.41,"address":{"road":"Maberzeller Straße","suburb":"Horas","town":"Fulda","county":"Landkreis Fulda","state_district":"Regierungsbezirk Kassel","state":"Hessen","postcode":"36041","country":"Deutschland","country_code":"de","continent":"Europe"}}]

I can't think of something on my side that is causing trouble especially as I tested this on different machines in different networks.


MQBrianCoakley
I wonder if that's new data
I wonder if that's new data that is not in MapQuest's nominatim yet. But I'm still seeing the same results in the browser and curl.

tegut
I found the problem. When I

I found the problem. When I supply the Parameter accept-language=de in the URL I get always the same results.