osmapp icon indicating copy to clipboard operation
osmapp copied to clipboard

Search Query URL Parameters (useful for search bangs)

Open basings opened this issue 3 years ago • 8 comments

How can I suggest a new bang to add osmapp to search engines? Which url do I need to use such that it sends the right request? I'd suggest the bang osmapp.

e.g. for duckduckgo https://duckduckgo.com/bangs

Thank you!

basings avatar Dec 17 '22 08:12 basings

I would love to say how, but first we would have to develop it. Right now there is no way how to link externaly to a prefilled search box. It could be easy to implement it, i may try it if i find time.

btw, under the hood we are using https://photon.komoot.io/ free OSM geocoder. You could probably link the bang to https://photon.komoot.io/api/?q=berlin, but i guess that is not what you want :)

zbycz avatar Dec 17 '22 09:12 zbycz

I will add this when I work on the search again

Flohhhhh avatar Jun 08 '23 23:06 Flohhhhh

This should also work for categories. For example

https://osmapp.org?q=amenity/internet_cafe

and it should be possible to combine it with coordinates.

Basically we just have to insert the value from the query parameter into the search box and trigger the search, right?

I also might be able to look into this. Let me know if anybody is working on this.

EDIT: I tried a bit, but did not succeed ... I was able to pre-fill the search box.

But we also should open the search popup. Also a second parameter would be nice which works like the old "I am feeling lucky" button of google and "clicks" the first result? This would be helpful for category queries.

amenk avatar Sep 14 '24 10:09 amenk

@amenk - yes, that is exactly what I also had in mind.

But apart from SearchBox needed some refactorings, the synchronization of Autocomplete input with URL is quite tricky 😃 though - I have managed to do it for the new Directions inputs (#515), so would like to migrated it for search as well.

zbycz avatar Sep 20 '24 07:09 zbycz

@zbycz yes; I also figured, that this is quite tricky and will leave it up to you, to port the direction inputs to the search as well.

amenk avatar Sep 20 '24 08:09 amenk