Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/search/?q=query URL format no longer supported (should be /search?q=query) #3134

Closed
scbhooshan opened this issue Aug 2, 2023 · 21 comments
Closed
Labels

Comments

@scbhooshan
Copy link

What did you search for?

bangalore

https://nominatim.openstreetmap.org/search/?q=banga&format=json&addressdetails=1&limit=3&countrycodes=in%2Cus&accept-language=en

What result did you get?

<title>404 Not Found</title>

What result did you expect?

When the result in the right place and just named wrongly:

[
{
"place_id": 297963002,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
"osm_type": "relation",
"osm_id": 1960177,
"lat": "22.9964948",
"lon": "87.6855882",
"class": "boundary",
"type": "administrative",
"place_rank": 8,
"importance": 0.6474964049356986,
"addresstype": "state",
"name": "West Bengal",
"display_name": "West Bengal, India",
"address": {
"state": "West Bengal",
"ISO3166-2-lvl4": "IN-WB",
"country": "India",
"country_code": "in"
},
"boundingbox": [
"21.5473014",
"27.2212039",
"85.8200883",
"89.8725414"
]
}
]
// 20230802132021
// https://nominatim.openstreetmap.org/search?q=banga&format=json&addressdetails=1&limit=3&countrycodes=in%2Cus&accept-language=en

[
{
"place_id": 297963002,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
"osm_type": "relation",
"osm_id": 1960177,
"lat": "22.9964948",
"lon": "87.6855882",
"class": "boundary",
"type": "administrative",
"place_rank": 8,
"importance": 0.6474964049356986,
"addresstype": "state",
"name": "West Bengal",
"display_name": "West Bengal, India",
"address": {
"state": "West Bengal",
"ISO3166-2-lvl4": "IN-WB",
"country": "India",
"country_code": "in"
},
"boundingbox": [
"21.5473014",
"27.2212039",
"85.8200883",
"89.8725414"
]
}
]

When the result missing completely:

Further details

@mtmail
Copy link
Collaborator

mtmail commented Aug 2, 2023

Where do you see a HTTP 400 error? If a result is not found the API usually returns HTTP 200.

@lonvia
Copy link
Member

lonvia commented Aug 2, 2023

The new implementation is stricter when it comes to the URL. /search/? is no longer permissible, you need to use `/search?'. Do we really need backward compatibility here? The syntax was always wrong. I'd rather see that people fix their code.

@lonvia
Copy link
Member

lonvia commented Aug 2, 2023

I see that we have the old slash syntax still in the docs: https://nominatim.org/release-docs/develop/api/Search/#json-with-svg-polygon That definitely needs to go away.

@scbhooshan
Copy link
Author

scbhooshan commented Aug 2, 2023 via email

@scbhooshan
Copy link
Author

scbhooshan commented Aug 2, 2023 via email

@lonvia
Copy link
Member

lonvia commented Aug 2, 2023

Lovely. Opened an issue there but this project looks to be mostly dead.

@mtmail mtmail changed the title search api returns 404 error /search/?q=query URL format no longer supported (should be /search?q=query) Aug 2, 2023
@lonvia lonvia pinned this issue Aug 2, 2023
@szeidler
Copy link

szeidler commented Aug 2, 2023

Also ran into the issue today. What is quite interesting is, that in our local environments the URL with the trailing slash still seem to work, on our servers it gives the 404. But it's indeed an easy fix to change the base url.

@lonvia
Copy link
Member

lonvia commented Aug 2, 2023

The new implementation is only live on one of our servers right now. Depending on the location of your server you get the new or old behaviour. I see how this can be annoying when the test environment happily keeps working. Sorry about that. I'll see to it that we quickly disable the URL pattern on all servers.

I've decided against monkey-patching to support the old style URL because eventually it would only move the problem two years down the road for everybody.

danielmwilson added a commit to danielmwilson/ol-geocoder that referenced this issue Aug 2, 2023
Remove trailing '/' from nominatim URL as this URL format is no longer supported:
 /search/?q=query URL format no longer supported (should be /search?q=query) #3134 
osm-search/Nominatim#3134
markussoeth added a commit to markussoeth/tt_address that referenced this issue Aug 3, 2023
Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Please use URLs as given in the documentation.

Examples how to change the URL:

You use: https://nominatim.openstreetmap.org/search/?q=Berlin
Change to: https://nominatim.openstreetmap.org/search?q=Berlin


See github issue #3134 for more details.

osm-search/Nominatim#3134
tyrasd added a commit to openstreetmap/iD that referenced this issue Aug 3, 2023
markaspot added a commit to markaspot/markaspot that referenced this issue Aug 3, 2023
markaspot added a commit to markaspot/markaspot that referenced this issue Aug 3, 2023
@deryckchan
Copy link

I've encountered the same issue today, and after some debugging I landed on the "API no longer accessible via this URL" error page that links to this thread, thank you. As @lonvia pointed out above, the "incorrect" search/ syntax was used in documentation examples, so I think this breaking change has widespread impact.

@rbyjoswald
Copy link

rbyjoswald commented Aug 4, 2023

As @lonvia pointed out above, the "incorrect" search/ syntax was used in documentation examples, so I think this breaking change has widespread impact.

Encountered the same today. Any chance for a rollback with another grace-period (say 15-30 days?!)?

@lorello
Copy link

lorello commented Aug 4, 2023

we are in the same conditions: haundred of websites to patch because we are using the wrong but well documented way to call your API. @Ionvia A backward compatible solution would be very appreciated, even for just a couple of weeks.

@richterb
Copy link

richterb commented Aug 4, 2023

Same here, a month-long grace period would be enough to properly update all our code to the new proper URL and would be greatly appreciated. The summer period doesn't help with updates and deployments either.

@mtmail
Copy link
Collaborator

mtmail commented Aug 5, 2023

The new implementation is only live on one of our servers right now.

That server was temporarily taken down by OpenStreetMap operations team 24h ago so the new implementions isn't live any more.

@lonvia
Copy link
Member

lonvia commented Aug 6, 2023

A grace period only makes sense, if there are means to reach your users. We don't have these means. That is the downside to providing an API without API keys or other login restrictions. Yes, we could add a grace period of 30 days but it just means that I'll have the same discussion again in 30 days with a different set of people.

The 404 with the helpful message is being sent on all servers now to make it as easy for you find and fix the problem. I'm really sorry for the inconvenience.

@alexdezi
Copy link

Is there any way at all to have the compatibility with the /? Some third party solutions basically stopped worked, because the use the well documented (but wrong) way of calling the API.

@mtmail
Copy link
Collaborator

mtmail commented Aug 20, 2023

@alexdezi Can you list or link those third party solutions which are not working for you?

@alexdezi
Copy link

I am for example currently working with a Wordpress theme that has integrated that API query using the /. Funny enough it's a few sites with the same purpose, on some I managed to get the location query done on time, and on some it suddenly stopped working. After a lot of debugging I realized that the query is implemented incorrectly despite the documentations showing it like that.

kxtells pushed a commit to kxtells/ol-geocoder that referenced this issue Aug 25, 2023
Remove trailing '/' from nominatim URL as this URL format is no longer supported:
 /search/?q=query URL format no longer supported (should be /search?q=query) #3134
osm-search/Nominatim#3134
infabo added a commit to infabo/tt_address that referenced this issue Aug 29, 2023
Using the URL /search/ with trailing slashe is no longer supported

see osm-search/Nominatim#3134
georgringer pushed a commit to FriendsOfTYPO3/tt_address that referenced this issue Aug 29, 2023
Using the URL /search/ with trailing slashe is no longer supported

see osm-search/Nominatim#3134
@lonvia lonvia added the wontfix label Aug 31, 2023
@lonvia lonvia closed this as completed Aug 31, 2023
jipexu added a commit to npds/npds_dune that referenced this issue Aug 31, 2023
enrimk added a commit to enrimk/design-comuni-wordpress-theme that referenced this issue Sep 7, 2023
Fixes italia#339, italia#340
Fix trovato da @abmcr, @fnori77, @marcogangemideda

Fa seguito a un [cambiamento nella API di openstreetmap](osm-search/Nominatim#3134).
@MuhammadNaeem42
Copy link

MuhammadNaeem42 commented Sep 10, 2023

please anyone guide me how i change old URL to New URL i am running OSRM in docker

image

i follow this steps to run OSRM in docker
https://hub.docker.com/r/osrm/osrm-backend/

@mtmail
Copy link
Collaborator

mtmail commented Sep 10, 2023

@MuhammadNaeem42 You need to update the leaflet-control-geocoder dependency. See Project-OSRM/osrm-frontend#370 For follow-up questions contact the osrm-frontend repository maintainers.

nobkd added a commit to nobkd/replace-maps that referenced this issue Oct 3, 2023
georgringer pushed a commit to FriendsOfTYPO3/tt_address that referenced this issue Oct 10, 2023
Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Please use URLs as given in the documentation.

Examples how to change the URL:

You use: https://nominatim.openstreetmap.org/search/?q=Berlin
Change to: https://nominatim.openstreetmap.org/search?q=Berlin


See github issue #3134 for more details.

osm-search/Nominatim#3134
zetareticoli pushed a commit to italia/design-comuni-wordpress-theme that referenced this issue Oct 16, 2023
Fixes #339, #340
Fix trovato da @abmcr, @fnori77, @marcogangemideda

Fa seguito a un [cambiamento nella API di openstreetmap](osm-search/Nominatim#3134).
captn3m0 added a commit to hackercouch/hackercouch that referenced this issue Oct 26, 2023
See osm-search/Nominatim#3134 for discussion.

This also now adds additional params which should make searches faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests