> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Pexels Photos API

> Pexels stock photos with title, description, width, height and orientation. Search by keyword.

`POST /v1/data/pexels/photos/run`

**Pricing:** $0.0035 per photo ($3.50 per 1,000).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**query** `string` *required*

Search Query.

**maxResults** `integer` (default: 100)

How many photos to return in total. Defaults to 100; use 0 for all.

**orientation** `string`

Orientation to use.

Allowed values: `landscape` (Landscape), `portrait` (Portrait), `square` (Square).

**color** `string`

Color.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/pexels/photos/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "query": "eiffel tower",
    "maxResults": 10
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/pexels/photos/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "query": "eiffel tower",
    "maxResults": 10
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/pexels/photos/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "query": "eiffel tower",
  "maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one photo, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `photoUrl` | Photo URL | url |
| `photoId` | Photo ID | text |
| `title` | Title | text |
| `description` | Description | text |
| `width` | Width | number |
| `height` | Height | number |
| `orientation` | Orientation | text |
| `tags` | Tags | array |
| `colors` | Colors | array |
| `license` | License | text |
| `posted` | Posted | text |
| `authorName` | Author Name | text |
| `authorUsername` | Author Username | text |
| `authorId` | Author ID | text |
| `authorProfileUrl` | Author Profile URL | url |
| `authorLocation` | Author Location | text |
| `authorInstagram` | Author Instagram | text |
| `authorTwitter` | Author Twitter | text |
| `imageUrl` | Image URL | url |
| `imageLargeUrl` | Image Large URL | url |
| `imageMediumUrl` | Image Medium URL | url |
| `imageSmallUrl` | Image Small URL | url |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "pexels/photos",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "authorUsername": "matreding",
      "photoUrl": "https://www.pexels.com/photo/clouds-around-eiffel-tower-11299566/",
      "authorId": "2848684",
      "posted": "2022-03-03T12:00:28.299Z",
      "photoId": "11299566",
      "imageLargeUrl": "https://images.pexels.com/photos/11299566/pexels-photo-11299566.jpeg?auto=compress&cs=tinysrgb&w=1440",
      "authorLocation": "Montréal, QC, Canada",
      "authorName": "Mathias Reding",
      "authorTwitter": null,
      "authorProfileUrl": "https://www.pexels.com/@matreding/",
      "description": "Scenic view of the Eiffel Tower amidst Paris cityscape on a clear day.",
      "orientation": "portrait",
      "tags": [
        "aerial view",
        "architecture"
      ],
      "colors": [
        "#000000",
        "#696969"
      ],
      "imageUrl": "https://images.pexels.com/photos/11299566/pexels-photo-11299566.jpeg?cs=srgb&dl=pexels-matreding-11299566.jpg&fm=jpg",
      "license": "Pexels",
      "imageSmallUrl": "https://images.pexels.com/photos/11299566/pexels-photo-11299566.jpeg?auto=compress&cs=tinysrgb&h=130",
      "height": 6017,
      "title": "Clouds around Eiffel Tower",
      "width": 4012,
      "imageMediumUrl": "https://images.pexels.com/photos/11299566/pexels-photo-11299566.jpeg?auto=compress&cs=tinysrgb&w=750",
      "authorInstagram": "matreding"
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.