Overview

The LiquorFind Embed API lets you place an interactive map, or list of locations on your site with a simple HTTP request. It can be easily embedded in your web page or blog by setting the LiquorFind Embed API URL as the src attribute of an iframe

Every visitor to your site sees results tailored just for them. LiquorFind uses HTML5 Geolocation to display the closest location results first and show the distance to the nearest location.

Forming the URL

The URL for the LiquorFind Embed API request is as follows:

https://liquorfind.com/api/v1/{Source}/{Mode}?{Parameters}

  • {Source} is one of city, state or proximity.
  • {Mode} is the display mode and is one of map or list. {Mode} is not required, and if not included in the URL, will show both a map and a list of locations.
  • {Parameters} include required and optional URL parameters and is one of type, origin and items_per_page. The first parameter needs to begin with a ? and multiple parameters are separated by &

Embed {Source}

There are three embed sources available. The {Source} type is specified in the request URL and is used to determine the source origin and whether to show locations in a specific City, State/Province or inside a specific Proximity.

City Source

The city source will show all locations inside a specific city.

The following URL parameters are required:

  • origin defines the city in which to display locations. The origin needs to be a valid city name. The string should be URL-escaped, so an address such as "New York" should be converted to new+york. (The LiquorFind Embed API supports both + and %20 when escaping spaces.)
  • type defines the type of location to display. Available options are: store, winery, or brewery.

The following URL parameter is optional:

  • items_per_page specifies how many items to display. Available options are: 25, 50, 100, 200 or 500. If not specified, a max of 500 locations will be shown.

Example LiquorFind Embed URL:

https://liquorfind.com/api/v1/city/map?type=winery&origin=kelowna&items_per_page=200

State Source

The state source will show all locations inside that specific State or Province.

The following URL parameters are required:

  • origin defines the State or Province in which to display locations. The sate needs to be a valid two digit State/Province code.
  • type defines the type of location to display. Available options are: store, winery, or brewery.

The following URL parameter is optional:

  • items_per_page specifies how many items to display. Available options are: 25, 50, 100, 200 or 500. If not specified, a max of 500 locations will be shown.

Example LiquorFind Embed URL:

https://liquorfind.com/api/v1/state/map?type=brewery&origin=bc&items_per_page=200

Proximity Source

The proximity source will show all locations from a specific point and allows for a custom distance radius. It will list all locations within that proximity radius

The following URL parameters are required:

  • origin[origin] defines the starting point from which to display locations. The origin[origin] needs to be a valid address. The string should be URL-escaped, so an address such as "City Hall, New York, NY" should be converted to City+Hall,New+York,NY. (The LiquorFind Embed API supports both + and %20 when escaping spaces.)
  • origin[distance] defines the distance from the origin. All locations between the origin[origin] and origin[distance] will be shown.
  • origin[unit] defines what unit of measurement to use for the distance. Available values are 6371 for Kilometers or 3959 for Miles. Default value is KM.

The following URL parameter is optional:

  • items_per_page specifies how many items to display. Available options are: 25, 50, 100, 200 or 500. If not specified, a max of 500 locations will be shown.

Example LiquorFind Embed URL:

https://liquorfind.com/api/v1/proximity/map?type=brewery&origin[origin]=main%20st%20vancouver%20bc&origin[distance]=10&items_per_page=25

Embed {Mode}

There are three embed sources available. The {Source} type is specified in the request URL and is used to determine the source origin and whether to show locations in a specific City, State/Province or inside a specific Proximity.

{Mode} is the display mode in which to show results. This is not required, and if not included in the URL, will show both a map and a list of locations.

The following options are available:

  • map will display an embedded map of locations.
  • list will display a styled list of locations including business name, logo, rating, address, type and distance.

Embedding The Widget

To use the LiquorFind Embed API on your web page, set the URL you've built as the value of an iframe's src attribute. Control the map's size with the iframe's height and width attributes:

<iframe
  width="600"
  height="600"
  frameborder="0" style="border:0;"
  src="https://liquorfind.com/api/v1/state/map?type=brewery&origin=bc&items_per_page=200" allowfullscreen>
</iframe>
  • Add allowfullscreen to your iframe properties to allow the map to go full screen.
  • Set the width property to width="100%" to make the embed 100% width and make it responsive.
  • Use the frameborder="0" and style="border:0;" properties to remove the standard iframe border from around the map.