Pexels API

If your company wants to get access to our API, you can request access here. We're excited to hear about your idea! Get more information on the API overview page or keep reading to find out how our API is working and how you can integrate it.


  • Whenever you are doing an API request make sure to show a prominent link to Pexels. You can use a text link (e.g. "Photos provided by Pexels") or a link with our logo (Download our logo in white or black).
  • Always credit our photographers when possible (e.g. "Photo by John Doe on Pexels" with a link to the photo page on Pexels).
  • Do not copy core functionality of Pexels.
  • Do not abuse the API. The API is rate-limited to 200 requests per hour and 20,000 requests per month. (For higher limits contact us)


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

Search photos
query Get photos related to this query. (required)
per_page Defines the number of results per page. (optional, default: 15, max: 80)
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: "",
  next_page: ""
  photos: [{
    width: 1000,
    height: 1000,
    url: "",
    photographer: "Name",
    src: {
      original: "https://*.jpg",
      large: "https://*.jpg",
      large2x: "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.

Curated photos

We add at least one new photo per hour to our curated list so that you get a changing selection of trending photos. For more information about the request parameters and response structure have a look at the search method above.

Get a photo

If you have the id of a photo, you can retrieve the data of it.

Random photo

If you want to get a random photo, you can use the "Curated photos" endpoint and set per_page to 1 and page to a random number between 1 and 1000 to get a beautiful random photo. You can do the same with popular searches if you want to get a random photo with a specific topic.

Search videos

Popular videos

Image formats

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.
large2x This image has a maximum width of 1880px and a maximum height of 1300px. 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.

Request statistics

To see how many requests you have left in this current period, you can look at the HTTP response header called "X-Ratelimit-Remaining" that comes with every response you receive.

Try it out

curl -H "Authorization: YOUR_API_KEY" ""

Unofficial API wrappers


We don't have an uptime or availability guarantee. Some features may change in the future.


If you have any question or feedback write us to [email protected].

API overview page Request access
Choose your language: English Português Español Deutsch Bahasa Indonesia Polski 日本語 Nederlands Čeština Dansk Ελληνικά Magyar 한국어 Norsk Svenska ภาษาไทย Türkçe Tiếng Việt