A long-lived project that still receives updates
DEPRECATED: This gem uses the legacy Google Places API endpoint (/maps/api/place/textsearch/json) which was deprecated by Google in March 2025. Please migrate to google-api-customization (https://rubygems.org/gems/google-api-customization) which provides full Places API support including text search, nearby search, place details, photos, reviews, and autocomplete. The gem will emit a deprecation warning on each use. Original purpose: thin wrapper around the Google Places Text Search API to search for places by query string, location, and radius.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 3.12
~> 3.0

Runtime

>= 0.14
 Project Readme

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.

Installation

Add this line to your Gemfile:

gem 'google-place-text-search'

Then run:

bundle install

Usage

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"]
end

Parameters

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