Documentation


GET /v1/image

Primary endpoint of the Random Image API.

Examples

Query Parameters

Parameter Description
height

Height of the desired image, in pixels.

width

Width of the desired image, in pixels.

format

Response format, allows overriding a the Accept or Content-Type header of a request:

image
Redirects to the image in question. No attribution information is displayed.
text
Returns the full path to the image, hosted by a given provider. No attribution information is displayed.
json
Designed for consumption by 3rd parties, and includes a link to the image as well as licensing and attribution information.

provider

Select an image provider:

LoremPixel
A default provider, returning images from before Unsplash launched an API. Note: Does not support categories.
LoremFlickr
A default provider, returning images from Flickr. Supports categories.
unsplash
The previous default, however the API it relied on has been shut down. This will be removed eventually, LoremPixel is the best replacement.
custom-v1:
[ABSOLUTE-URL]
EXPERIMENTAL! Allows parsing a custom Image Pool, adhering to v1 of this JSON schema.

category

Category of the image to be returned. Categories are provider-specific, the default is "buildings".




GET /{width}/{height}

Short-hand endpoint for grabbing an image with a given width and height.

Examples

Parameters

Parameter Description
width

Width of the desired image, in pixels.

height

Height of the desired image, in pixels.