You are here: System » PixabayPlugin

PixabayPlugin

2025-01-14 - 17:35 | Version 1 |
Pixabay stock images and videos

logo.png

Description

This plugin let's you access over 1 mililion stock images, videos and illuatrations of pixabay. Pixabay is a vibrant community of creatives, sharing copyright free images and videos. All contents are released under the Pixabay License, which makes them safe to use without asking for permission or giving credit to the artist - even for commercial purposes.

If you use this plugin and the Pixabay API, a link to Pixabay is required and you may use their logo for this purpose. By default, you can make up to 5,000 requests per hour towards pixabay.com. Requests are associated with an API key, and not with your IP address. In addition this plugin caches query results to pixabay.com for a certain period of time, a day by default.

Returned images are cached on this server and not hotlinked their source location on pixabay.com. This is not only required due to the API usage guidelines but also comes with a certain performance advantage compared to other image services such as unsplash.com.

Usage

Images and videos are made available to Foswiki using the %PIXABAY{...}% macro. The macro may return a list of images or videos, not only one. You may page through this list using the skip and limit parameters.

Parameter Description DefaultSorted ascending
"..." or q search term. if omitted, all images are returned. This value may not exceed 100 characters. example: "yellow flower"  
id retrieve individual images by iD. the id normally is a numeric value which may also be specified as a search term.  
category filter results by category. accepted values: fashion, nature, backgrounds, science, education, people, feelings, religion, health, places, animals, industry, food, computer, sports, transportation, travel, buildings, business, music  
size accepted values for images: web, preview, large, orig, fullHD; accepted values for videos: tiny, small, medium, large  
header string to be prefixed to results  
separator format string between each fetched resource  
footer string to be appended to results  
class css class to add to the result  
min_width minimum image width 0
min_height minimum image height 0
random integer specifying a range within which a skip value is piced randomly; the higher the parameter the more random results will be returned 0
skip page through the list of images/videos found by the search term 0
limit number if images/videos to return 1
orientation (only images) whether an image is wider than it is tall, or taller than it is wide. accepted values: all, horizontal, vertical all
lang language code of the language to be searched in. accepted values: cs, da, de, en, es, fr, id, it, hu, nl, no, pl, pt, ro, sk, fi, sv, tr, vi, th, bg, ru, el, ja, ko, zh en
format format string to render the fetched resource. for images: <img src='$url' width='$width' height='$height' alt='$id' $class />
for videos: <video width='$width' height='$height' $controls $autoplay $muted $loop $class alt='$id'>Your browser does not support the video tag.</video>
height explicit height of the image/video height of the resource as returned by pixabay
safesearch a flag indicating that only images/videos suitable for all ages should be returned. off
editors_choice select images that have received an Editor's Choice award off
controls (only videos) flag to display video controls (pause, play, forward, backward) off
autoplay (only videos) flag to start playing the video as soon as it has been loaded on
mute (only videos) flag to mute or unmute audio of a video on
loop (only videos) flag to loop a video or only play it once on
type kind of resource to query. possible values: photo, illuatrations, vector, video, film, animation, allimages, allvideos photo
order how the results should be ordered. accepted values: popular, latest popular
width explicit width of the image/video width of the resource as returned by pixabay

Examples

Default settings

%PIXABAY{"neon"}%

Specific image

%PIXABAY{id="2014616"%

Random film with people

%PIXABAY{"people" type="film" random="10"}%

Photos by Masashi Wakui

%PIXABAY{"user:MasashiWakui" random="10" limit="5"}%

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab → "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button. Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the search results.

You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Before you may use this plugin you'll need to register an account at https://pixabay.com and fetch your API key from here https://pixabay.com/api/docs.

Dependencies

NameVersionDescription
WebService::Pixabay>=2Required
Foswiki::Contrib::CacheContrib>=0Required

Change History

14 Jan 2025 improved caching of mirrored assets; added explicit rest handler to purge cache entries
23 Aug 2022 decode url before mirroring it
21 Oct 2020 reworked caching to use CacheContrib
19 Nov 2019 initial release
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine