Locations .: Get Image

API Reference / v15

Get a Location’s Image

This endpoint redirects the client (using an HTTP 302 response with a Location header) to an image URL for a LevelUp location.

The following dimensions (width x height) are available:

  • 280 x 128 (at 1x, 1.5x, and 2x)
  • 290 x 335 (at 1x)
  • 320 x 212 (at 1x, 1.5x, and 2x)
  • 400 x 235 (at 1x)
  • 460 x 180 (at 1x)
  • 414 x 106 (at 2x)
  • 1440 x 368 (at 1x)

Note that an Accept header with the value image/jpg is required for the request.

Request Endpoint

GET /v15/locations/:location_id/image?density=1&height=420&width=300

No Authorization Required

Request Parameters

Param Type Description
density Decimal The effective pixel density of the desired image, corresponding to the widespread “@1x”, “@1.5x”, “@2x” convention. Accepted values: 1, 1.5, 2.
height Integer The height of the desired image in pixels.
width Integer The width of the desired image in pixels.

The available image dimensions are: 280x128, 290x335, 320x212, 400x235, and 460x180.

cURL Example

curl -X GET -H Accept:application/json -H Content-Type:application/json https://api.thelevelup.com/v15/locations/3796/image?density=1&height=212&width=320

Example Response

HTTP/1.1 302 Found

Headers:

Location: https://s3.amazonaws.com/levelup/c9e16d4c66c49fa15a8b26d5eef5fb855377d178.jpg

(No response body.)

Errors

No location matches the given ID, or no image matches the given dimensions and density

HTTP/1.1 404 Not Found

(No response body.)