Pixabay API Documentation

Welcome to the Pixabay API documentation. Our API is a RESTful interface for searching and retrieving Pixabay public domain images.

powered by
This API is available free of charge to anyone wishing to integrate Pixabay images on their own site or application. Whenever you display API results, you must make it clear to users that they are viewing images from Pixabay. A link back to Pixabay is required and you may avail of our logo at your discretion.

The API can be accessed at http://pixabay.com/api/. Hash keys are case-sensitive and character encoding is in UTF-8. Returned data is a unicode JSON format string and the API is limited to return a maximum of 300 results per query. Example requests and responses are given below.

Hash keys may be ordered or returned in any random order and new hash keys may be added to the data that you are returned at any time. We will do our best to notify our users before removing hash keys from results or adding required fields to inputs, but we may occasionally do these things without notice. The Pixabay API has no warranty.

Caching of identical requests for 24+ hours is imperative. Only dynamic pages, i.e. keywords used by your site's visitors, should send real time queries to our API. Thus, you deliver real time content only at your visitor's request and you improve both, your and our server's performance. Hotlinking is not allowed. If you intend to use these images, please download them to your server. Systematic and/or automatic mass downloads of Pixabay's images is prohibited.

Request parameters

username (required) str Login | Sign up
key (required) str Please login to see your API key here
response_group str Select the information returned: image details or URLs of high resolution images. High resolution image URLs and details cannot be obtained in a single request.
Accepted values: "image_details", "high_resolution"
Default: "image_details"
id str id, id_hash, or a comma separated list of values to retrieve details or high resolution URLs of specific images. In a comma separated list, ids and id_hashs cannot be used together.
Note: The number of id_hash queries for "response_group=image_details" is limited to 40 images per day and to 400 images in 30 days. The same limit aplies to id queries for "response_group=high_resolution". When over quota, the API tells you to slow down.
search_term str A URL encoded string to search for. If omitted, all images are returned in the selected order. This value may not exceed 100 characters in length.
Example: "yellow+flower"
lang str Language code of the language to be searched in.
Accepted values: id, cs, de, en, es, fr, it, nl, no, hu, ru, pl, pt, ro, fi, sv, tr, ja, ko, zh
Default: "en"
image_type str A media type to search within.
Accepted values: "all", "photo", "illustration", "vector"
Default: "all"
orientation str Whether an image is wider than it is tall, or taller than it is wide.
Accepted values: "all", "horizontal", "vertical"
Default: "all"
min_width int Minimum image width.
Default: "0"
min_height int Minimum image height.
Default: "0"
editors_choice bool Select images that have received an Editor's Choice award.
Accepted values: "true", "false"
Default: "false"
order str How the results should be ordered.
Accepted values: "popular", "latest"
Default: "popular"
page int Returned search results are paginated. Use this parameter to select the page number.
Default: 1
per_page int Determine the number of results per page.
Accepted values: 5 - 200
Default: 20

Example requests and responses


Example 1: Detailed image search

Search request for photos about "yellow flower" with "image_details" as response group. "search_term" needs to be URL encoded, thus space turns into plus. "USERNAME" and "APIKEY" has to replaced with your own username and API key.

http://pixabay.com/api/?username=USERNAME&key=APIKEY&search_term=yellow+flower&image_type=photo

Response excerpt for this request:

{
    "totalHits": 240,
    "hits": [
        {
            "id": "11574",
            "pageURL": "http://pixabay.com/en/sonnenblumen-sonnenblumenfeld-flora-11574/",
            "type": "photo",
            "model_release": false,
            "tags": "sunflower, sunflower field, flora",
            "previewURL": "http://pixabay.com/static/uploads/photo/2012/01/07/21/56/sunflower-11574_150.jpg",
            "previewWidth": 150,
            "previewHeight": 92,
            "webformatURL": "http://pixabay.com/get/3b4f5d71752e6ce9cbcf/1356479243/aca42219d23fd9fe0cc6f1cc_640.jpg",
            "webformatWidth": 640,
            "webformatHeight": 396,
            "imageWidth": 1280,
            "imageHeight": 792,
            "views": 10928,
            "downloads": 1649,
            "comments": 14,
            "likes": 70,
            "user": "WikiImages"
        },
        {
            "id": "256",
            "pageURL": "http://pixabay.com/en/example-image-256/",
            "type": "photo",
            ... etc.
        },
        ... 18 more hits for page number 1
    ]
}
  • Returned URLs for images greater than 150 px are valid for 24 hours. If you intend to use these images, please download them to your server.
  • id: A unique identifier for querying high resolution image URLs and/or reloading image details.
  • pageURL: Image details page on Pixabay, which provides a download link for the original image of the size imageWidth x imageHeight.
  • thumbURL: Static URL to a square thumbnail (68 x 68 px).
  • previewURL: Static URL to a scaled image with a maximum width/height of 150 px (previewWidth x previewHeight).
  • webformatURL: Temporary URL (valid for 24 hours) to a scaled image with a maximum width/height of 640 px (webformatWidth x webformatHeight).
  • views: Total number of image views.
  • downloads: Total number of downloads.
  • comments: Total number of comments.
  • likes: Total number of user votes.
  • user: Username of the photographer/artist. URL: http://pixabay.com/LANG/users/USERNAME/ (LANG = language code, USERNAME = user).


Example 2: High resolution image search

Use "response_group=high_resolution" for retrieving URLs of high resolution images. Detailed data about the images, such as tags and page URL on Pixabay, are not available in this response.
http://pixabay.com/api/?username=USERNAME&key=APIKEY&response_group=high_resolution&search_term=yellow+flower

Response excerpt for this request:

{
    totalHits: 240,
    hits: [
        {
            "id_hash": "779def4966ad3741-1356479553",
            "type": "photo",
            "model_release": false,
            "thumbURL": "http://pixabay.com/get/d665608aa966adad0e6e/1356479553/ef2c43ccb41a18d6_68.jpg",
            "previewURL": "http://pixabay.com/get/d665608aa966adad0e6e/1356479553/28d20b56447d87bf_150.jpg",
            "previewWidth": 150,
            "previewHeight": 112,
            "webformatURL": "http://pixabay.com/get/d665608aa966adad0e6e/1356479553/286a88431d7a9651_640.jpg",
            "webformatWidth": 640,
            "webformatHeight": 480,
            "largeImageURL": "http://pixabay.com/get/d665608aa966adad0e6e/1356479553/14f48b3f589431efa50561c7_1280.jpg",
            "fullHDURL": "http://pixabay.com/get/d665608aa966adad0e6e/1356479553/e1849b5c833c6dc8554eded5_1920.jpg",
            "imageURL": "http://pixabay.com/get/d665608aa966adad0e6e/1356479553/94f19b8545cf5355895bbcfa.jpg",
            "imageWidth": 3264,
            "imageHeight": 2448,
            "vectorURL": "http://pixabay.com/get/d665608aa966adad0e6e/1356479553/fd35g48942gfzs8d9zfs98df.svg"
            "user": "WikiImages"
        },
        {
            "id_hash": "aac6916a3a8275b0-1352463311",
            "type": "photo",
            ... etc.
        },
        ... 18 more hits for page number 1
    ]
}
  • Returned URLs of all images are valid for 24 hours. If you intend to use these images, please download them to your server.
  • id_hash: A unique identifier for refreshing expired image URLs and/or querying image details. The id_hash may also be used to build permanent URLs to image details pages on Pixabay.
  • largeImageURL: Scaled image with a maximum width/height of 1280px.
  • fullHDURL: Full HD scaled image with a maximum width/height of 1920px.
  • imageURL: URL to the full resolution image (imageWidth x imageHeight).
  • vectorURL: Optional key/value pair for scalable vector graphics. Omitted for non-vector type images.
  • Other response keys according to example 1.


Example 3: Retrieving data sets of selected images

Both, ids and id hashs, may be used to obtain data sets of specific images. Several image data sets may be retrieved in a single request by using a comma separated list of all ids or all id hashs.

a) Querying "image_details" for an id hash. This type of query is limited to 40 images per day and to 400 in 30 days. Response according to example 1. An id hash field is added to the response set.

http://pixabay.com/api/?username=USERNAME&key=APIKEY&id=f170a531bbd3bf89-1352482551

b) Retrieving (updated) high resolution image URLs for an id hash. Response according to example 2.

http://pixabay.com/api/?username=USERNAME&key=APIKEY&response_group=high_resolution&id=7f38c9ce3b9b1378-1357054439

c) Querying "image_details" for an id. Response according to example 1.

http://pixabay.com/api/?username=USERNAME&key=APIKEY&id=11574

d) Retrieving (updated) high resolution image URLs for two ids. This type of query is limited to 40 images per day and to 400 in 30 days. Response according to example 2. An id field is added to the response set.

http://pixabay.com/api/?username=USERNAME&key=APIKEY&response_group=high_resolution&id=11574,256


Example 4: Building permanent URLs based on id hashs

All id hashs may be used to create permanent URLs to image details pages on Pixabay. Non-authorized users are prompted a captcha before gaining access to the appropriate page. URL structure (LANG = language code): http://pixabay.com/LANG/goto/ID_HASH/



Example JavaScript/jQuery code to retrieve search results

var USERNAME = 'AnonymousUser';
var API_KEY = 'YOUR_API_KEY';
var SEARCH_TERM = 'red roses';
var URL = "http://pixabay.com/api/?username="+USERNAME+"&key="+API_KEY+"&search_term="+encodeURIComponent(SEARCH_TERM);
$.getJSON(url, function(data){
    if (parseInt(data.totalHits) > 0)
        $.each(data.hits, function(i, hit){ console.log(hit.pageURL); });
    else
        console.log('No hits'); }
});


For any questions or feature requests, please don't hesitate and use our contact form or send us an e-mail: [javascript protected email address]