Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/safaiyeh/yelp-api
https://github.com/safaiyeh/yelp-api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/safaiyeh/yelp-api
- Owner: safaiyeh
- License: mit
- Created: 2015-08-06T21:04:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-08T07:27:28.000Z (over 9 years ago)
- Last Synced: 2024-05-01T14:47:46.505Z (7 months ago)
- Language: Java
- Size: 137 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yelp Search API | Java
A java wrapper for [Yelp's RESTful API](https://www.yelp.com/developers/documentation/v2/search_api).##Usage
Use your Api Keys for OAuth, register at [Yelp for Developers](https://www.yelp.com/developers/manage_api_keys).
```java
YelpApi yelpApi = new YelpApi(CONSUMER_KEY, CONSUMER_SECRET, TOKEN, TOKEN_SECRET);
```Use a HashMap for search paramenters outlined [here](https://www.yelp.com/developers/documentation/v2/search_api);
```java
HashMap parameters = new HashMap<>();
parameters.put("term", "food");
parameters.put("limit", "5");
parameters.put("offset", "10");
parameters.put("sort", "0"); // 0 = Best Matched, 1 = Distance, 2 = Highest Rated
parameters.put("category_filter", "active"); //List of supported filters: https://www.yelp.com/developers/documentation/v2/all_category_list
parameters.put("radius_filter", "5000"); //Max 40,000 meters
parameters.put("deals_filter", "false"); //Exclusively show places with deals.
```Either search with a location String or coordinates
```java
yelpApi.searchLocation("San Jose, CA", parameters);
yelpApi.searchCoordinates(latitude, longitude, parameters);
```