# Unsplash

> Search Unsplash's free stock photo library and pull images into your workflows.

App · Images & Design · 3 actions. Web page: https://docs.lodol.com/docs/integrations/unsplash

## Actions

### Get a random photo

Fetch one random Unsplash photo, optionally matching a search term.

**Inputs**

- Search terms (`query`, text): Optional. Limit the random pick to photos matching these terms, for example 'mountains'.
- Orientation (`orientation`, text): Optional. Only pick a photo in this shape. One of: `landscape`, `portrait`, `squarish`.

**Outputs**

- `color` (text): Dominant color as a hex code, for example '#2c5f2d'
- `description` (text): Photo caption, falling back to its alt text
- `height` (number): Image height in pixels
- `id` (text): Unsplash photo ID
- `page_url` (text): Unsplash page for the photo, for use when crediting it
- `photographer_name` (text): Photographer's name -- Unsplash's licence requires crediting them
- `photographer_url` (text): Photographer's Unsplash profile URL, for the credit link
- `thumbnail_url` (text): Small preview image URL
- `url` (text): Full-size image URL
- `width` (number): Image width in pixels

**Example output**

```json
{
  "color": "#2c5f2d",
  "description": "A misty forest at dawn",
  "height": 2667,
  "id": "Dwu85P9SOIk",
  "page_url": "https://unsplash.com/photos/Dwu85P9SOIk",
  "photographer_name": "Jane Doe",
  "photographer_url": "https://unsplash.com/@janedoe",
  "thumbnail_url": "https://images.unsplash.com/photo-1417325384643?w=200",
  "url": "https://images.unsplash.com/photo-1417325384643?w=1080",
  "width": 4000
}
```

### Get photo

Fetch details for a single Unsplash photo.

**Inputs**

- Photo ID (`photo_id`, text, required): The Unsplash photo ID, as returned by Search photos.

**Outputs**

- `color` (text): Dominant color as a hex code, for example '#2c5f2d'
- `description` (text): Photo caption, falling back to its alt text
- `height` (number): Image height in pixels
- `id` (text): Unsplash photo ID
- `page_url` (text): Unsplash page for the photo, for use when crediting it
- `photographer_name` (text): Photographer's name -- Unsplash's licence requires crediting them
- `photographer_url` (text): Photographer's Unsplash profile URL, for the credit link
- `thumbnail_url` (text): Small preview image URL
- `url` (text): Full-size image URL
- `width` (number): Image width in pixels

**Example output**

```json
{
  "color": "#2c5f2d",
  "description": "A misty forest at dawn",
  "height": 2667,
  "id": "Dwu85P9SOIk",
  "page_url": "https://unsplash.com/photos/Dwu85P9SOIk",
  "photographer_name": "Jane Doe",
  "photographer_url": "https://unsplash.com/@janedoe",
  "thumbnail_url": "https://images.unsplash.com/photo-1417325384643?w=200",
  "url": "https://images.unsplash.com/photo-1417325384643?w=1080",
  "width": 4000
}
```

### Search photos

Search Unsplash's free stock photo library.

**Inputs**

- Search terms (`query`, text, required): What to search for, for example 'misty forest'.
- Results per page (`per_page`, number): How many photos to return (1-30). From 1 to 30. Default: `10`.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1. Default: `1`.
- Orientation (`orientation`, text): Optional. Only return photos in this shape. One of: `landscape`, `portrait`, `squarish`.

**Outputs**

- `photos` (list): Photos on the requested page
- `total` (number): Total photos matching the search

**Example output**

```json
{
  "photos": [
    {
      "color": "#2c5f2d",
      "description": "A misty forest at dawn",
      "height": 2667,
      "id": "Dwu85P9SOIk",
      "page_url": "https://unsplash.com/photos/Dwu85P9SOIk",
      "photographer_name": "Jane Doe",
      "photographer_url": "https://unsplash.com/@janedoe",
      "thumbnail_url": "https://images.unsplash.com/photo-1417325384643?w=200",
      "url": "https://images.unsplash.com/photo-1417325384643?w=1080",
      "width": 4000
    }
  ],
  "total": 1284
}
```
