The search uses the Twitter advanced search syntax, so any query should work.
You can copy the "q" from the URL Twitter's advanced search give you,
https://twitter.com/search-advanced?lang=en
For example search for "foo" or "bar" near "Toronto", the q= is,
foo%20bar%20near%3A"Toronto"%20within%3A15mi