Accessor: services/YelpSearch

services/YelpSearch

Perform a Yelp search for local buisnesses using the Yelp API https://www.yelp.com/developers/documentation/v3/business_search

The full Yelp API allows many parameters for searching for buisness. This accessor demonstrates a simple query for a particular type of buisness near specific geographic coordinates.

This accessor requires an authentication token provided by Yelp for using their API. See https://www.yelp.com/developers/documentation/v3/authentication. This key must be stored in a text file at $KEYSTORE/yelp.txt

Version:
  • $$Id: YelpSearch.js 1725 2017-05-19 22:59:11Z cxh $$
Author:
  • Matt Weber
Source:
Inputs:
Name Type Description
searchTerm string The variety of local buisness to search for (eg. "Restaurants").
latitude number First part of coordinates for local buisness search. Defaults to UC Berkeley's coordinates.
longitude number Second part of coordinates for local buisness search. Defaults to UC Berkeley's coordinates.
trigger An input to trigger the search.
Outputs:
Name Type Description
ready boolean WARNING: Triggers may not work correctly before this output has been produced. This accessor produces true on this output when it has successfully loaded its API key and is ready for queries. If this accessor is acquring its API key asynchronously, this may occur after initialization has completed.
response Yelp's raw JSON response to the query.
Parameters:
Name Type Description
getAPIKeySynchronously boolan Not all hosts support synchronous or asynchronous file reading. specify the right mode for this accessor's host here.
timeout int The amount of time (in milliseconds) to wait for a response before triggering a null response and an error. This defaults to 5000.

Methods

(static) setup()

Set up the accessor by defining the inputs and outputs.

Source: