/v3-yelp-api

NPM React-Native compatible package for Yelp V3 Api

Primary LanguageJavaScript

v3 Yelp Api

A simple npm wrapper for Yelp v3 Api which is compatible with React Native

Dependencies

axios

qs

Install

npm

npm i v3-yelp-api -S

Usage

import YelpApi from 'v3-yelp-api';

const credentials = {
    appId:"App Id from Yelp Developer Console",
    appSecret: "App Secret from Yelp Developer Console"
}

const yelp = New YelpApi(credentials)

Search

let params = {
    query: 'food',
    location: '51.5007,0.1246',
    price: '2',
    limit: 10
}

yelp.search(params)
 .then(data => data)
 .catch(err => err)

Phone Search

let params = { phone: '+442073722882' }

yelp.phoneSearch(params)
 .then(data => data)
 .catch(err => err)

Business / Reviews

let bestRestaurantEver = 'tamada-london'

yelp.business(bestRestaurantEver)
 .then(data => data)
 .catch(err => err)

yelp.reviews(bestRestaurantEver)
 .then(data => data)
 .catch(err => err)

Transactional Search

let params = { location: 'london' }
let transactionType = 'delivery'

yelp.transactionSearch(params)(transactionType)
 .then(data => data)
 .catch(err => err)