Skip to content

Search By String

This function will take a search string, attempt to geocode it as an address and query our retail locations database.

Path

https://api.b-fonline.com/api/v2/retail_locations_by_search

Method

POST

Required Parameters

  • search_string (string to be geocoded)
  • radius (radius of search in miles, 200 miles max)
  • type ('onpremise', 'offpremise', or 'both')
  • site_id (get this from B-F IT)

Optional Parameters

Think of these optional parameters as filters on the returned data set. Using geocode_bias_country and geocode_bias_region together may lead to unexpected results.

  • brand_id (find this id from the brands API call)
  • minor_brand_id (find this id from the brands API call)
  • promotion_id (filter to locations involved in a specific promotion)
  • geocode_bias_country (string, ISO-3166 Alpha 2 country code)
  • geocode_bias_region (string, ISO-3166 Alpha 2 country code)
  • geocode_bias_language (string, two character language code, found here)

Responses

  • 200 OK
    [
      {...},
      {
        "LocationID": "2049634",
        "latitude": 38.24729919,
        "longitude": -85.76850128,
        "company": "West Grocery & Liquor Store",
        "address": "1001 W Broadway",
        "city": "Louisville",
        "state": "KY",
        "postal_code": "40203",
        "country": "USA",
        "phone": "5025696088",
        "distance_mi": 0.5,
        "distance_km": 0.9,
        "store_type": "offpremise",
        "brands": [
          {
            "brand_name": "Jack Daniels",
            "brand_id": 1,
            "brand_minor": [
              {
                "brand_minor_description": "Old Number 7",
                "brand_minor_ID": "381"
              }
            ]
          },
          {
            "brand_name": "Old Forester",
            "brand_id": 17,
            "brand_minor": [
              {
                "brand_minor_description": "Classic 86 Proof",
                "brand_minor_ID": "572"
              },
              {
                "brand_minor_description": "Signature 100 Proof",
                "brand_minor_ID": "571"
              }
            ]
          }
        ]
      },
      {...}
    ]
    
  • 422 (Unprocessable Entity)
    • Error message in JSON response
  • 500
    • Something has gone horribly wrong, please let us know.

Code Examples

curl -X POST \
  https://api.b-fonline.com/api/v2/retail_locations_by_search \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
    "search_string": "40202",
    "radius": 1,
    "brand_id": 1,
    "type": "offpremise",
    "site_id": 1
  }'