# Pexels

> Search Pexels' library of free stock photos and videos, and pull direct download links for use in your workflows.

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

## Actions

### Get a photo

Look up one photo by its Pexels ID, including every download size and the photographer's details.

**Inputs**

- Photo ID (`photo_id`, text, required): The photo's Pexels ID, as returned by Search photos or List curated photos.

**Outputs**

- `alt` (text): A short description of the photo, usable as alt text
- `avg_color` (text): The photo's average colour as a hex code, handy as a placeholder background while the image loads
- `height` (number): Height of the original photo in pixels
- `large_url` (text): Direct link to a large (roughly 940px wide) version
- `medium_url` (text): Direct link to a medium (roughly 350px tall) version
- `original_url` (text): Direct link to the full-resolution image file
- `photo_id` (number): The photo's Pexels ID. Use with Get a photo.
- `photographer` (text): Name of the photographer, for the attribution Pexels asks for
- `photographer_url` (text): Link to the photographer's Pexels profile
- `tiny_url` (text): Direct link to a thumbnail-sized version
- `url` (text): Link to the photo's page on Pexels
- `width` (number): Width of the original photo in pixels

**Example output**

```json
{
  "alt": "Brown Rocks During Golden Hour",
  "avg_color": "#978E82",
  "height": 3024,
  "large_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?w=940",
  "medium_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?h=350",
  "original_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg",
  "photo_id": 2014422,
  "photographer": "Joey Farina",
  "photographer_url": "https://www.pexels.com/@joey",
  "tiny_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?h=200",
  "url": "https://www.pexels.com/photo/brown-rocks-during-golden-hour-2014422/",
  "width": 3024
}
```

### List curated photos

List the photos Pexels' editors are currently featuring on the home page, newest first.

**Inputs**

- Page (`page`, number): Which page of results to return. Defaults to the first page. At least 1. Default: `1`.
- Results per page (`per_page`, number): How many results to return (1-80). From 1 to 80. Default: `15`.

**Outputs**

- `page` (number): The page of results this is
- `per_page` (number): How many results this page holds
- `photos` (list): The curated photos
- `total_results` (number): How many results match in total

**Example output**

```json
{
  "page": 1,
  "per_page": 15,
  "photos": [
    {
      "alt": "Brown Rocks During Golden Hour",
      "avg_color": "#978E82",
      "height": 3024,
      "large_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?w=940",
      "medium_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?h=350",
      "original_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg",
      "photo_id": 2014422,
      "photographer": "Joey Farina",
      "photographer_url": "https://www.pexels.com/@joey",
      "tiny_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?h=200",
      "url": "https://www.pexels.com/photo/brown-rocks-during-golden-hour-2014422/",
      "width": 3024
    }
  ],
  "total_results": 8000
}
```

### List popular videos

List the videos currently most popular on Pexels, optionally limited to a range of clip lengths.

**Inputs**

- Shortest clip (seconds) (`min_duration`, number): Optional. Leave out videos shorter than this. At least 0.
- Longest clip (seconds) (`max_duration`, number): Optional. Leave out videos longer than this. At least 0.
- Page (`page`, number): Which page of results to return. Defaults to the first page. At least 1. Default: `1`.
- Results per page (`per_page`, number): How many results to return (1-80). From 1 to 80. Default: `15`.

**Outputs**

- `page` (number): The page of results this is
- `per_page` (number): How many results this page holds
- `total_results` (number): How many results match in total
- `videos` (list): The popular videos

**Example output**

```json
{
  "page": 1,
  "per_page": 15,
  "total_results": 4000,
  "videos": [
    {
      "download_url": "https://player.vimeo.com/external/342571552.hd.mp4",
      "duration": 22,
      "file_type": "video/mp4",
      "height": 1920,
      "quality": "hd",
      "thumbnail_url": "https://images.pexels.com/videos/2499611/free-video-2499611.jpg",
      "url": "https://www.pexels.com/video/2499611/",
      "video_id": 2499611,
      "videographer": "Joey Farina",
      "videographer_url": "https://www.pexels.com/@joey",
      "width": 1080
    }
  ]
}
```

### Search photos

Search Pexels' library of free stock photos by keyword, with optional filters for orientation, minimum size, and colour.

**Inputs**

- Search term (`query`, text, required): What to look for, for example 'mountain sunrise' or 'office desk'.
- Orientation (`orientation`, text): Optional. Only return photos in this shape. One of: `landscape`, `portrait`, `square`.
- Minimum size (`size`, text): Optional. Only return photos at least this large. One of: `large` (Large (24MP and up)), `medium` (Medium (12MP and up)), `small` (Small (4MP and up)).
- Colour (`color`, text): Optional. Only return photos in this colour -- either a name such as 'red' or 'turquoise', or a hex code such as '#ff7f50'.
- Search language (`locale`, text): Optional. The language the search term is written in, for example 'en-US' or 'pt-BR'.
- Page (`page`, number): Which page of results to return. Defaults to the first page. At least 1. Default: `1`.
- Results per page (`per_page`, number): How many results to return (1-80). From 1 to 80. Default: `15`.

**Outputs**

- `page` (number): The page of results this is
- `per_page` (number): How many results this page holds
- `photos` (list): The matching photos
- `total_results` (number): How many results match in total

**Example output**

```json
{
  "page": 1,
  "per_page": 15,
  "photos": [
    {
      "alt": "Brown Rocks During Golden Hour",
      "avg_color": "#978E82",
      "height": 3024,
      "large_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?w=940",
      "medium_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?h=350",
      "original_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg",
      "photo_id": 2014422,
      "photographer": "Joey Farina",
      "photographer_url": "https://www.pexels.com/@joey",
      "tiny_url": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?h=200",
      "url": "https://www.pexels.com/photo/brown-rocks-during-golden-hour-2014422/",
      "width": 3024
    }
  ],
  "total_results": 8000
}
```

### Search videos

Search Pexels' library of free stock videos by keyword, with optional filters for orientation and minimum resolution.

**Inputs**

- Search term (`query`, text, required): What to look for, for example 'city timelapse' or 'ocean waves'.
- Orientation (`orientation`, text): Optional. Only return videos in this shape. One of: `landscape`, `portrait`, `square`.
- Minimum resolution (`size`, text): Optional. Only return videos at least this large. One of: `large` (Large (4K and up)), `medium` (Medium (Full HD and up)), `small` (Small (HD and up)).
- Search language (`locale`, text): Optional. The language the search term is written in, for example 'en-US' or 'pt-BR'.
- Page (`page`, number): Which page of results to return. Defaults to the first page. At least 1. Default: `1`.
- Results per page (`per_page`, number): How many results to return (1-80). From 1 to 80. Default: `15`.

**Outputs**

- `page` (number): The page of results this is
- `per_page` (number): How many results this page holds
- `total_results` (number): How many results match in total
- `videos` (list): The matching videos

**Example output**

```json
{
  "page": 1,
  "per_page": 15,
  "total_results": 1200,
  "videos": [
    {
      "download_url": "https://player.vimeo.com/external/342571552.hd.mp4",
      "duration": 22,
      "file_type": "video/mp4",
      "height": 1920,
      "quality": "hd",
      "thumbnail_url": "https://images.pexels.com/videos/2499611/free-video-2499611.jpg",
      "url": "https://www.pexels.com/video/2499611/",
      "video_id": 2499611,
      "videographer": "Joey Farina",
      "videographer_url": "https://www.pexels.com/@joey",
      "width": 1080
    }
  ]
}
```
