Bases: deeperlib.api.simapi.SimpleApi
A subclass implemented for yelp/business/search api—-https://www.yelp.com/developers/documentation/v3/business_search
Initialize the object. Set id and secret to obtain JWT Token. Create session with the token.
Set other parameters and top_k for future api call.
Parameters: |
- client_id – client_id
- client_secret – client_secret
- top_k – top-k constraint
- delay – time interval between a failed api call and the next api call
- search_term – the field for query string
- kwargs – other parameters
|
-
callAPI
(params)[source]
Call api until it returns messages successfully.
Parameters: | params – all the parameters needed by an api |
Returns: | businesses in returned documents |
-
callMulAPI
(queries)[source]
Call api with multiple threads. Therefore, we can issue several queries and get all of the top k
documents at the same time.
Parameters: | queries – queries list |
Returns: | messages returned from api |
-
getDelay
()[source]
-
getID
()[source]
-
getKwargs
()[source]
-
getSearchTerm
()[source]
-
getSession
()[source]
-
getToken
()[source]
-
getTopk
()[source]
-
getURL
()[source]
-
setDelay
(delay)[source]
-
setID
(client_id, client_secret)[source]
-
setKwargs
(kwargs)[source]
-
setSearchTerm
(search_term)[source]
-
setSession
(session)[source]
-
setToken
()[source]
-
setTopk
(top_k)[source]
-
setURL
(url)[source]