YelpEx v0.2.1 YelpEx.Client View Source

Client to interact with Yelp’s Fusion API.

Link to this section Summary

Functions

Same as search/1 but raises HTTPoison.Error if an error occurs

Issues a GET request to the /businesses/search endpoint

Same as search_phone/1 but raises HTTPoison.Error if an error occurs

Issues a GET request to the /businesses/search/phone endpoint

Link to this section Functions

Link to this function search!(options) View Source
search!(Keyword.t()) :: %{}

Same as search/1 but raises HTTPoison.Error if an error occurs.

Link to this function search(options) View Source
search(Keyword.t()) :: {:ok, %{}} | {:error, HTTPoison.Error.t()}

Issues a GET request to the /businesses/search endpoint.

GET https://api.yelp.com/v3/businesses/search

This endpoint performs a search of businesses based on the options submitted.

Options:

Note: A location option is mandatory. Either by passing the location or both the latitude and the longitude.

Examples:

iex> options = [params: [location: "Philadelphia, PA 19106"]]
iex> YelpEx.Client.search(options)
{:ok, {<RESPONSE>}}

iex> options = [params: [longitude: -75.145101, latitude: 39.54364]]
iex> YelpEx.Client.search!(options)
{<RESPONSE>}
Link to this function search_phone!(options) View Source
search_phone!(Keyword.t()) :: %{}

Same as search_phone/1 but raises HTTPoison.Error if an error occurs.

Link to this function search_phone(options) View Source
search_phone(Keyword.t()) :: {:ok, %{}} | {:error, HTTPoison.Error.t()}

Issues a GET request to the /businesses/search/phone endpoint.

GET https://api.yelp.com/v3/businesses/search/phone

This endpoint performs a search of businesses based on a phone number.

Options:

  • :params This endpoint takes one param, phone. The phone number of the business you want to search for as a string. It must start with + and include the country code. See Yelp docs for more.
  • For all other options see: HTTPoison.request/5

Examples:

iex> options = [params: [phone: "+14159083801"]]

iex> YelpEx.Client.search_phone(options)
{:ok, {<RESPONSE>}}

iex> YelpEx.Client.search_phone!(options)
{<RESPONSE>}