If your company wants to get access to our API write us an email to [email protected]. Please explain briefly how and where you want to integrate our photos. We're excited to hear about your idea!
After you received your API key you can start using this API. To get access you have to add a HTTP Authorization header to each of your requests:
Authorization: YOUR_API_KEY
http://api.pexels.com/v1/search?query=example+query&per_page=15&page=1
| query | Get photos related to this query. (required) |
|---|---|
| per_page | Defines the number of results per page. (optional, default: 15, max: 40) |
| page | Defines the number of the page. (optional, default: 1) |
If the request is successful, the response body will be a JSON with the following data:
{
page: 1,
per_page: 15,
total_results: 236,
url: "https://www.pexels.com/search/example%20query/",
next_page: "http://api.pexels.com/v1/search/?page=2&per_page=15&query=example+query"
photos: [{
width: 1000,
height: 1000,
url: "https://www.pexels.com/photo/12345",
photographer: "Name",
src: {
original: "https://*.jpg",
large: "https://*.jpg",
medium: "https://*.jpg",
small: "https://*.jpg",
portrait: "https://*.jpg",
landscape: "https://*.jpg",
tiny: "https://*.jpg"
}, (NEXT PHOTOS)]
}
}
The next_page/prev_page attributes are only present if it's not the last/first page.
http://api.pexels.com/v1/popular?per_page=15&page=1
For more information have a look at the search method above.
| original | The size of the original image is given with the attributes width and height. |
|---|---|
| large | This image has a maximum width of 940px and a maximum height of 650px. It has the aspect ratio of the original image. |
| medium | This image has a height of 350px and a flexible width. It has the aspect ratio of the original image. |
| small | This image has a height of 130px and a flexible width. It has the aspect ratio of the original image. |
| portrait | This image has a width of 800px and a height of 1200px. |
| landscape | This image has a width of 1200px and height of 627px. |
| tiny | This image has a width of 280px and height of 200px. |
curl -H "Authorization: YOUR_API_KEY" "http://api.pexels.com/v1/search?query=people"
We don't have an uptime or availability guarantee. And some features may change in the future.
If you have any question or feedback write us to [email protected].