I am trying to find out if I can restrict Google Places auto complete to include only Large/Major US Cities and not smaller cities/towns.
For example, we would not allow the user to enter "Montogomery, TX" but instead the user can choose the closest large city "Houston, TX".
"Montgomery, TX" should not appear in the auto complete list but "Houston, TX" should.
Thanks,
Shardul
I discovered that Google Places API does not support the feature I am looking for. We had to work out an alternative based on the Google API.
Related
Im still figuring how to use google map api's, I want to get all locations in my country (nigeria) and then put it in a dropdown, an example is something like jiji.ng, when trying to search they have a drop down with info of places, states etc in Nigeria, when the user searches it filters the locations, i tried typing in 'United State of America' & it showed me nothing because it is limited to Nigeria only, that is exactly what i want, check out jiji.ng pls, just to be sure.
Google map is not really needed in doing this, You can download the list of places from Geonames then you can use it within your app (To my understanding, its free maybe only some licences)
I'm curious to know how Market Samurai, Long Tail Pro and other software handle retrieving the top 10 Google search results and not running into limits. It appears that these software packages use the users own Google account. Google Custom Search limits users to 100 queries per day (the free limit) but people tend to do keyword research on hundreds or even thousands of keywords per day and don't pay any additional amounts to Google.
Are they paying extra for this service, are they using a different API (perhaps the Adwords API?) or are they scraping the Google search results page (violation of TOS)? Really would like to know! Thanks.
i have done this in one of my project (in java).
this is very simple, in java there is one library call JSoup by using this library you can send get request to google, for example:
https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=<your url encoded search term>
this will return you an HTML code of google search result with your own term.
using Jsoup u can find specific HTML tag with specific class or id. this concept helps you to extract url link, title and description from google search result.
for working example check here, in that example you can extract google serach result links with custom search term.
i hope this will help you.
I would like to use the Google custom search API for searching only in discussions like using the query string &tbm=dsc.
Unfortunately there is no tbm parameter given in the API documentation.
Is it not possible to limit the search results to discussions only?
No, there is currently not a way to do the discussion search with CSE/GSS. The only special search is image which is documented in the API reference. You could use Labels and Refinements to limit your search to specific sites and/or patterns.
Limiting search results for Google Custom Search to only discussion websites is not possible. Just in case, remember that Google Custom Search is for searching over one website or a collection of websites. If your collection is all discussion sites, well, that doesn't seem to be the purpose of Google Custom Search. However, there may be some useful workarounds/solutions.
Workaround 0
Find or generate a collection of discussion sites you're interest in and create a custom search based on that. This would accomplish (almost) the same results you are after.
Workaround 1
You might be able to perform a redirection with refinement labels. This example redirects to a Google Scholar search. You might be able to accomplish the same result using &tbm=dsc.
<CustomSearchEngine>
<Title>Universities</Title>
<Context>
<Facet>
<FacetItem title="Papers">
<Label name="papers" mode="FILTER"/>
<Redirect url="http://scholar.google.com/scholar?q=$q"/>
</FacetItem>
</Facet>
</Context>
</CustomSearchEngine>
Basically, my problem is the same as here: Google Places API: Searching for names containing spaces
If you use %20, it works for the one name containing it, but ignores the rest.
I have a need to find restaurants near by, but only restaurants I've got additional information on, so I've got a list of 10 restaurants, I want to show the closest restaurants of the 10, it appears as though google places may not support this (spaces in names of restaurants), is there another API I should be looking at?
Are you storing these restaurants in your own database?
If you are, you need to do proximity search. MySql & Postgres has GIS plugins that support this given a lat/long.
Performing a Places Search Request with multiple keywords or names is not officially supported by the Places API therefore is not guaranteed to return accurate results.
Google Places API: Searching for names containing spaces
I want to sort results fetched via google places api based on increasing distance from "location" (a pair of lat, lng). There is no documentation on their official page. http://code.google.com/apis/maps/documentation/places/#PlaceSearchRequests
It just says:
Each element of the results array contains a single result from the
specified area (location and radius), ordered by prominence. The
ordering of results can be influenced by check-in activity within your
application - Places with many recent check-ins may figure more
prominently in your application's results. The result may also contain
attribution information which must be displayed to the user.
However they didnt mention anything about their prominence meter algorithm.
The Google Places API does not currently support this feature.
There is a feature request for this in the Places API issue tracker here:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=3322
Please click the 'star' icon to be notified of future changes, and to let us know you are interested in seeing it resolved.
Cheers
Chris
This has been added to the API, please use the 'rankby=distance' instead of 'radius' in your Place Search Request as described in the documentation here: https://developers.google.com/maps/documentation/places/#PlaceSearchRequests