Tuesday, July 3, 2012

Add flexible search and Google reviews to your local apps with the Google Places API

We launched the Google Places API at Google I/O last year to enable developers to search more than 95 million places, such as businesses and landmarks, around the world. We have continued to enhance the API since then, adding a number of features requested by developers such as keyword search, rank by distance, and support for Events. At Google I/O this year we continued to respond to your feedback, with the launch of Google Reviews, Text Search, Opening Hours, and Paging.

Google Reviews
By far the most popular request from developers since the day we launched has been access to the Google Reviews offered on Google+ Local. We’re therefore delighted to announce that the top 5 Google Reviews for a Place are now included in the response to a Place Details request. Each review is accompanied by additional information such as the scores given by the author, author details, and the date that the review was submitted.

Text Search
Today we are introducing Text Search, a whole new way of searching that broadens the scope of the Places API to any device that can accept text input, be it from a keyboard or from voice recognition.

Text Search brings the flexible capabilities of the Google Maps search field to your application. Rather than requiring the user’s location to search around, Text Search interprets free text queries that can include both what the user is searching for, and where they are searching for it. For example, you can submit a search for “Pizza in New York”, or “Sushi near Sydney”. You can also bias queries to a particular area, so that even queries with no address component can be correctly interpreted.

Opening Hours
Another popular request from developers has been access to the opening hours for businesses. The Place API now returns the 7 day opening hours for a Place in the Place Details results where available. Place Search results also now include a property that indicates if a Place for which opening hours are available is currently open.

Paging
Today we are also introducing support for paging, which increases the number of search results that can be retrieved to 60. Applications can now request two additional sets of 20 results after the initial request has been made.

You can try these new features with the below demo. Enter a search query to see 20 matching results, with more loaded when you scroll to the end of the list. Click on a result to see the reviews for that place under the map, and the opening hours for today in the InfoWindow on the map.



To accompany these launches we’re also pleased to announce a new dedicated home page for the Places API at developers.google.com/places. In addition to the Places API web service, all of the above new features are also available in the places library of the JavaScript Maps API v3.

If you want to know more about how your application can benefit from the power of the Google Places API join our developer community on Stack Overflow. We look forward to seeing the innovative new apps that these great new Places API features inspire you to develop.