Locations .: Get Details

API Reference / v15

Get Location Details

This endpoint returns details about a visible location. Requesting an invisible location will return HTTP 404.

Request Endpoint

GET /v15/locations/:id

No Authorization Required

cURL Example

curl https://sandbox.thelevelup.com/v15/locations/19 \
  -H Accept:application/json \
  -H Content-Type:application/json

Example Response

HTTP/1.1 200 OK

{
  "location": {
    "categories": [
      50
    ],
    "extended_address": "",
    "facebook_url": "http://www.facebook.com/pages/PizzaPalace",
    "foodler_url": "http://deeplink.me/www.foodler.com/pizza-palace/1234",
    "hours": null,
    "id": 17,
    "latitude": 42.351639,
    "locality": "Boston",
    "longitude": -71.121797,
    "menu_url": null,
    "merchant_id": 18,
    "merchant_description_html": "This is a place that has pizza!",
    "merchant_name": "Pizza Palace",
    "merchant_tip_preference": "no preference",
    "name": null,
    "newsletter_url": null,
    "open_hours": {
      "Monday": [
        {
          "opens_at": "11:00:00",
          "closes_at": "15:00:00"
        }
      ]
    },
    "open_state": "open",
    "opentable_url": null,
    "phone": null,
    "postal_code": "02215",
    "region": "MA",
    "street_address": "1024 Pizza Road",
    "twitter_url": null,
    "updated_at": "2014-11-30T10:28:23-05:00",
    "yelp_url": "http://www.yelp.com/biz/pizza-palace",
    "shown": true
  }
}

Errors

No live location matches the given ID.

HTTP/1.1 404 Not Found

(No response body.)

Open Hours

The open_hours key describes when the location is open for business in a machine-readable JSON format. The response will be of the form:

{
  "open_hours": {
    "Monday": [
      {
        "opens_at": "11:00:00",
        "closes_at": "15:00:00"
      },
      {
        "opens_at": "17:00:00",
        "closes_at": "23:00:00"
      }
    ],
    "Tuesday": [
      {
        "opens_at": "11:00:00",
        "closes_at": "15:00:00"
      },
      {
        "opens_at": "17:00:00",
        "closes_at": "23:00:00"
      }
    ],
    //...,
    "Sunday": [
      {
        "opens_at": "11:00:00",
        "closes_at": "15:00:00"
      },
      {
        "opens_at": "17:00:00",
        "closes_at": "23:00:00"
      }
    ]
  }
}

A couple of things to note:

  • Midnight is designated as "00:00:00". Consequently, a location that is open 24 hours will have the same opens_at and closes_at time.

  • If a location is open past midnight, its hours will be split between two days. For example, a location open from 5 PM Friday until 2 AM Saturday will be represented with these hours:

  {
    "Friday": [
      {
        "opens_at": "17:00:00",
        "closes_at": "00:00:00"
      }
    ],
    "Saturday": [
      {
        "opens_at": "00:00:00",
        "closes_at": "02:00:00"
      }
    ]
  }
  • If the open_hours don’t include an entry for a particular day of the week, then the location is closed on that day. For example, the following hours indicate that the location is only open on Monday.
  {
    "open_hours": {
      "Monday": [
        {
            "opens_at": "11:00:00",
            "closes_at": "15:00:00"
        },
        {
            "opens_at": "17:00:00",
            "closes_at": "23:00:00"
        }
      ]
    }
  }
  • If the response for open_hours is an empty hash {}, then LevelUp does not have open hours data for that location. We will default the open_state of the location to "open" in this case.