google-place-text-search
A simple Ruby gem to search for places using the Google Places Text Search API. Search by query string, optionally biased by location and radius.
Tags: google-places-api, places-api, text-search, geolocation, httparty, rails, deprecated
Installation
Add this line to your Gemfile:
gem 'google-place-text-search'Then run:
bundle installUsage
searcher = GooglePlaceTextSearch.new
results = searcher.get_response(
"YOUR_GOOGLE_API_KEY",
5000, # radius in meters
"48.8584,2.2945", # location as "lat,lng"
"restaurants near Eiffel Tower"
)
results["results"].each do |place|
puts place["name"]
puts place["formatted_address"]
puts place["rating"]
endParameters
| Parameter | Type | Description |
|---|---|---|
api_key |
String | Your Google Places API key |
radius |
Integer | Search radius in meters |
location |
String | Center point as "lat,lng"
|
query |
String | Text query to search for |
Returns the parsed JSON response from the Google Places API, including a results array with place details.
Dependencies
Contributing
Since this gem is deprecated, open issues are mostly focused on smoothing the migration
path to google-api-customization rather than new features — see the
open issues list. Some are
tagged good first issue
if you'd like to help.