{"id":30218432,"url":"https://github.com/yelp/yelp-ruby","last_synced_at":"2025-08-14T06:35:41.876Z","repository":{"id":16141374,"uuid":"18886870","full_name":"Yelp/yelp-ruby","owner":"Yelp","description":"A Ruby gem for communicating with the Yelp REST API","archived":false,"fork":false,"pushed_at":"2023-03-24T10:27:37.000Z","size":191,"stargazers_count":102,"open_issues_count":5,"forks_count":55,"subscribers_count":18,"default_branch":"develop","last_synced_at":"2025-06-17T20:18:57.875Z","etag":null,"topics":["api-client","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yelp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-17T17:17:23.000Z","updated_at":"2025-05-19T15:28:18.000Z","dependencies_parsed_at":"2024-06-18T16:54:08.752Z","dependency_job_id":"88009346-9edb-4e87-855f-0db8867b5c2b","html_url":"https://github.com/Yelp/yelp-ruby","commit_stats":{"total_commits":195,"total_committers":17,"mean_commits":"11.470588235294118","dds":0.3384615384615385,"last_synced_commit":"cca275c39dbb01b59fcb40902aa00a482352a35d"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/Yelp/yelp-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2Fyelp-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2Fyelp-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2Fyelp-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2Fyelp-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yelp","download_url":"https://codeload.github.com/Yelp/yelp-ruby/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2Fyelp-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270377874,"owners_count":24573416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","ruby"],"created_at":"2025-08-14T06:35:25.884Z","updated_at":"2025-08-14T06:35:41.799Z","avatar_url":"https://github.com/Yelp.png","language":"Ruby","readme":"# yelp-ruby\n\n[![Gem Version](https://badge.fury.io/rb/yelp.svg)](http://badge.fury.io/rb/yelp) [![Build Status](https://travis-ci.org/Yelp/yelp-ruby.svg)](https://travis-ci.org/Yelp/yelp-ruby) [![Code Climate](https://codeclimate.com/github/Yelp/yelp-ruby.svg)](https://codeclimate.com/github/Yelp/yelp-ruby)\n\nThis is a Ruby Gem for the Yelp API. It'll simplify the process of consuming data from the Yelp API for developers using Ruby. The library encompasses both Search and Business API functions.\n\nPlease remember to read and follow the [Terms of Use](http://www.yelp.com/developers/getting_started/api_terms) and [display requirements](https://www.yelp.com/developers/display_requirements) before creating your applications.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'yelp', require: 'yelp'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install yelp\n\n## Usage\n\n### Basic usage\n\nThe gem uses a client model to query against the API. You create and configure a client with your API keys and make requests through that.\n\n```\nrequire 'yelp'\n\nclient = Yelp::Client.new({ consumer_key: YOUR_CONSUMER_KEY,\n                            consumer_secret: YOUR_CONSUMER_SECRET,\n                            token: YOUR_TOKEN,\n                            token_secret: YOUR_TOKEN_SECRET\n                          })\n```\n\nAlternatively, you can also globally configure the client using a configure\nblock, and access a client singleton using `Yelp.client`.  If you intend to\nuse the gem with Rails, the client should be configured in an initializer.\n\n```\nrequire 'yelp'\n\nYelp.client.configure do |config|\n  config.consumer_key = YOUR_CONSUMER_KEY\n  config.consumer_secret = YOUR_CONSUMER_SECRET\n  config.token = YOUR_TOKEN\n  config.token_secret = YOUR_TOKEN_SECRET\nend\n\nYelp.client.search('San Francisco', { term: 'food' })\n```\n\nAfter creating the client you're able to make requests to either the Search API or Business API. Note: all four keys are required for making requests against the Yelp API. If you need any keys sign up and get access from [http://www.yelp.com/developers](http://www.yelp.com/developers).\n\n### [Search API](http://www.yelp.com/developers/documentation/v2/search_api)\n\nOnce you have a client you can use ``#search`` to make a request to the Search API.\n\n```\nclient.search('San Francisco')\n```\n\nYou can also pass in general params and locale options to the method as hashes\n\n```\nparams = { term: 'food',\n           limit: 3,\n           category_filter: 'discgolf'\n         }\n\nlocale = { lang: 'fr' }\n\nclient.search('San Francisco', params, locale)\n```\n\nKey names and options for params and locale match the documented names on the [Yelp Search API](http://www.yelp.com/developers/documentation/v2/search_api)\n\nAdditionally there are two more search methods for searching by a [bounding box](http://www.yelp.com/developers/documentation/v2/search_api#searchGBB) or for [geographical coordinates](http://www.yelp.com/developers/documentation/v2/search_api#searchGC):\n\n```\n# bounding box\nbounding_box = { sw_latitude: 37.7577, sw_longitude: -122.4376, ne_latitude: 37.785381, ne_longitude: -122.391681 }\nclient.search_by_bounding_box(bounding_box, params, locale)\n\n# coordinates\ncoordinates = { latitude: 37.7577, longitude: -122.4376 }\nclient.search_by_coordinates(coordinates, params, locale)\n```\n\n### [Business API](http://www.yelp.com/developers/documentation/v2/business)\n\nTo use the Business API after you have a client you just need to call ``#business`` with a business id\n\n```\nclient.business('yelp-san-francisco')\n```\n\nYou can pass in locale information as well\n\n```\nlocale = { lang: 'fr' }\n\nclient.business('yelp-san-francisco', locale)\n```\n\n### [Phone Search API](http://www.yelp.com/developers/documentation/v2/phone_search)\n\nTo use the Phone Search API after you have a client you just need to call ``#phone_search`` with a phone number\n\n```\nclient.phone_search('+15555555555')\n```\n\nYou can pass in country code information as well\n\n```\noptions = { cc: 'US', category: 'fashion' }\n\nclient.phone_search('5555555555', options)\n```\n\n## Responses\n\nResponses from the API are all parsed and converted into Ruby objects. You're able to access information using dot-notation\n\n```\n## search\nresponse = client.search('San Francisco')\n\nresponse.businesses\n# [\u003cBusiness 1\u003e, \u003cBusiness 2\u003e, ...]\n\nresponse.businesses[0].name\n# \"Kim Makoi, DC\"\n\nresponse.businesses[0].rating\n# 5.0\n\n\n## business\nresponse = client.business('yelp-san-francisco')\n\nresponse.business.name\n# Yelp\n\nresponse.business.categories\n# [[\"Local Flavor\", \"localflavor\"], [\"Mass Media\", \"massmedia\"]]\n```\n\nFor specific response values check out the docs for the [Search API](http://www.yelp.com/developers/documentation/v2/search_api#rValue) and the [Business API](http://www.yelp.com/developers/documentation/v2/business#rValue). You can also look at the responses and models inside of `lib/yelp/responses` and `lib/yelp/responses/models` to see the methods available.\n\n## Contributing\n\n1. Fork it ( http://github.com/yelp/yelp-ruby/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\nOur rspec test suite expects environment variables to be populated with your Yelp API Access Tokens.\n\nYou can generate and find your Access Tokens at [https://www.yelp.com/developers/manage_api_keys](https://www.yelp.com/developers/manage_api_keys).\n\n### Git Workflow\n\nWe are using the [git flow](http://nvie.com/posts/a-successful-git-branching-model/)\nworkflow. Atlassian has a [solid overview](https://www.atlassian.com/git/workflows#!workflow-gitflow).\nEssentially, new development is merged into the develop branch from feature\nbranches, then merged from develop to a release branch, then to master from\nthe release branch. Master should always contain the most recently released\nversion of the gem.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyelp%2Fyelp-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyelp%2Fyelp-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyelp%2Fyelp-ruby/lists"}