Programmers API

Table of Content



About this

The API is intended to give developers the opportunity to user our data. It will providing you with XML formed search results and a way to download images which you can use in your software.

Note: If your software previously accessed our website through the website's build in search function, you should change that, adapt the new API and encourage your users to upgrade. The old search is still available for backwards compatibility but it will only deliver the outdated data up to 09/14/2010. It also will be gone as soon as the traffic on it drops significantly.


What you need to use the API

To use our data in your applications you will have to:

  • Contact api@htbackdrops.com and get a free key that will enable you to access the API.
    Please include a valid username to htbackdrops.com, the name of your application and - if available - a website URL.
  • Respect our servers and do as little queries as you can.
  • Let your users know where the data comes from. We want this community to grow and what better target audiance is there than the people who use a product? :)

Once you acquired an API key you can access the API through the URLs provided below by replacing <YOUR_API_KEY> with your actual key.

Feel free to use "TESTKEY" for testing purposes. Downloads are limited to thumbnail size with this key.

Chip in with the server fees

How much do you want to spend?




Usage

How To Find Images

You can perform a search by utilizing the following URL:

http://htbackdrops.com/api/<YOUR_API_KEY>/searchXML
and get XML formed search results (example).

You can use POST or GET method to perform a search using the arguments listed below. You even can provide a json encoded array containing any of the arguments.
To do so just use the argument json_input.
E.g. "searchXML?json_input={"keywords":"madonna"}"

Update 11/01/2010: Thanks to the good guys at MusicBrainz we are now able to deliver better search results to you. Our server uses their webservice to retrieve additional spellings (aliases) and tags for music artists. We got new information for about 96% of all music artists in our database.

The update of this information currently is semi-automatic. That means that it has to be triggered by an administrator to catch as many miss-matches as possible. This causes a small delay in the matching to MusicBrainz information for newly added images. It has no effect on title, keywords and caption field matching thou.

Have a look at the search arguments fields and the newly added inc, which will let you decide what information to search in and what to return. You also can use mbid if you already know an artists ID at MusicBrainz.

This update should not affect your existing software as the search results default to almost the same output as before. If you run into any problems or got other feedback feel free to contact us.


How To Download Images

The search will return a set of matched images including an image ID (pid) which you can use to download the image in various sizes by using:
http://htbackdrops.com/api/<YOUR_API_KEY>/download/<PICTURE_ID>/thumbnail (max. width and height of 125px)
http://htbackdrops.com/api/<YOUR_API_KEY>/download/<PICTURE_ID>/intermediate (max. width and height of 800px)
http://htbackdrops.com/api/<YOUR_API_KEY>/download/<PICTURE_ID>/fullsize (original full-size image)



Arguments to use for a search

Keyword Limiters
ArgumentTypeOptionExample
keywords
Keywords to search for
String
seperate keywords with spaces
you can prepend any keyword with + or -
+: The keyword must be in the result.
-: The keyword mustn't be in the result.
"keywords=madonna pink"
Every result will contain atleast one of the keywords.

"keywords=madonna -pink"
Every result will contain "madonna" but not "pink".

"keywords=madonna +pink"
Every result will contain "pink" and maybe madonna.

"keywords=-madonna +pink"
Every result will contain "pink" but not "madonna".

"keywords=+madonna +pink"
Every result will contain "pink" and "madonna".
This can also be achived by using the default_operator variable (see below) e.g. "keywords=madonna pink&default_operator=and"
default_operator
Operator to connect keywords with
String Allowed: and, or
Default: or
"default_operator=and"
fields
Fields to search in
String
seperate multiple fields with ","
Allowed: all, title, keywords, caption

Allowed MusicBrainz: mb_name, mb_alias, mb_tag
Default: title,caption,keywords
"fields=title,mb_name,mb_alias"
mbid
ID for MusicBrainz
String "mbid=79239441-bfd5-4981-a70c-55c3f15c1287"
This will select all images for artist Madonna.
Output Limiters
ArgumentTypeOptionExample
inc
What information to return in the results
String
seperate multiples with ","
Allowed: keywords, caption, rating

Allowed MusicBrainz: mb_name, mb_aliases, mb_tags
Default: keywords, caption, rating
"inc=rating,mb_aliases"
limit
Limit to this many results
Integer Default: 500 "limit=20"
offset
Offset of results to start from
Integer Default: 0 "offset=20"
encoding
Set the output encoding
String Allowed: UTF-8, iso-8859-1
Default: UTF-8
"encoding=iso-8859-1"
cid
Category ID to search in
Integer
seperate multiple IDs with ","
See category list "cid=5" or "cid=5,6"
This is an upstream selection option for album IDs. "cid=1" has the same effect as "aid=1,5,26".
aid
Album ID to search in
Integer
seperate multiple IDs with ","
See category list "aid=1" or "aid=1,5,26"
File Attribute Limiters
ArgumentTypeOptionExample
new_since
Only return newer files
Unix timestamp "new_since=1284008400"
will return only files added after 09/09/2010. We advice you to use the servertime timestamp returned with every search.
modified_since
Only return modified files
Unix timestamp "modified_since=1284008400"
will return only files modified after 09/09/2010. This works just like new_since but the timestamp in the database is updated more frequently e.g. on upload approval and name changes. We advice you to use the servertime timestamp returned with every search.
max_filesize
Limits filesize of results.
Integer
Has to be in bytes.
"max_filsize=102400"
for a max filsize of 100kb
dmax_w
Limits maximum picture width to x pixel
Integer "dmax_h=1920"
dmax_h
Limits maximum picture height to x pixel
Integer "dmax_h=1080"
dmin_w
Limits minimum picture width to x pixel
Integer "dmin_h=1920"
dmin_h
Limits minimum picture height to x pixel
Integer "dmin_h=1080"
dratio
Limits picture pixel ratio to x:y
String "dratio=16:9"


Category / Album List

Category / Album List
ArgumentTitle
cid=2Games
    aid=2    Game Backdrops (16:9)
    aid=29    Game Boxes
    aid=30    Other
cid=3Generic / Other
    aid=28    Applications
    aid=32    Comic
    aid=7    Games - Generic
    aid=14    Home Theaters
    aid=12    Misc
    aid=8    Movies - Generic
    aid=9    Music - Generic
    aid=13    Photo Backdrops
    aid=10    Settings - Generic
    aid=27    Splash Screens
    aid=23    Stand-Up Comedians
    aid=11    TV - Generic
    cid=4    Generic / Other - Weather
        aid=17        Cloudy/Snow-Rain Mix
        aid=18        Hail
        aid=21        Haze/Rain
        aid=19        Icy/Clouds Rain-Snow
        aid=20        Icy/Haze Rain
        aid=22        Icy/Rain
        aid=3        Other
        aid=15        Rain/Lightning
        aid=33        Sunny
        aid=16        Windy/Rain
cid=5Music Artist
    aid=5    Music Artist Thumbnails (1:1)
    aid=1    Music Artist Backdrops (16:9)
    aid=26    Other


Workflow suggestion for Music Artist search

To get the best results when searching for images associated to an music artist we advice you to stick to the following workflow:



Contribute

If you are willing to contribute classes or code snippets in any programming language, that will make it easier for others to get startet, we would love to put them here. Just contact us at api@htbackdrops.com.

Snippets & Examples

LanguageContributorDescriptionLicence 
C# (Visual Studio 2010 Project)thermacoreSimple Visual Studio Project to get you started. It will search for a keyword, download a random image from the result and show it as the applications background.Free to useDownload



Applications that use our API

NameHomepage
Plexhttp://www.plexapp.com
XBMChttp://xbmc.org/
MediaPortal Fanart Handlerhttp://code.google.com/p/fanart-handler/
Artist Slideshow Addon (XBMC)http://forum.xbmc.org/showthread.php?t=102703
J. River Media Centerhttp://www.jriver.com/
MusicBeehttp://getmusicbee.com
Gnome Music Player Client (GMPC)http://gmpclient.org/
mvCentral (MediaPortal)http://code.google.com/p/mvcentral/
Spotify for XBMChttps://github.com/akezeke/spotyxbmc2
MLServerhttp://www.cinemaronline.com
HomeMediahttp://www.banamalon.net
MusicBrowser (WMC)http://www.musicbrowser.tv
Music Metadata Scraper (Meedios)http://www.meedios.com/forum/viewtopic.php?f=14&t=5018
RTI driverhttp://www.mydevice.com.au
Youtube.fm plugin for MediaPortalhttp://code.google.com/p/youtube-fm-for-mediaportal/
Advanced Launcher add-on (XBMC)http://code.google.com/p/xbmc-advanced-launcher/
DVBViewerhttp://www.dvbviewer.tv/forum/topic/42493-myscrobbler-lastfm-plugin-for-dvbviewer/
UMP (Ultimate Media Player)http://www.popcornforum.de/showthread.php?tid=14759
Controllrhttp://muzisoftware.com
torshifyhttp://torsh.net/blog
XBMC inpanehttp://xbmc.inpane.com
MusicBox4 for NextPVRhttp://www.gbpvr.com/nwiki/pmwiki.php?n=Plugin.MusicBox4
tversity togohttp://www.ashterisk.wordpress.com
Odyssea Media Centerhttp://www.developpez.net/forums/f1388/applications/projets/projets-heberges/odyssea-media-center/
RideRunner Pluginhttp://www.johnwpb.com
Meedioshttp://meedios.com
Wubbo for W8http://www.basputin.nl/wubbo
myMedia WP7http://www.gordonhome.info/?page_id=11
www.7thson.chhttp://www.7thson.ch
Bur Mixed Selectionhttp://bms.buraglio.it
Dashifyhttp://www.maxiblue.nl
mcShoutCast for WMChttp://www.mcetools.com/
Grooveshark for XBMC http://code.google.com/p/grooveshark-for-xbmc/
Audio-Matichttp://www.audio-matic.com
EtherMan's Plex pluginhttps://github.com/Ether009/Musicbrainz_HTBackdrops
Music Jukeboxhttp://www.networkedmediatank.com/showthread.php?tid=24832
My NetFlix for MediaPortalhttp://forum.team-mediaportal.com/my-netflix-539/
Collectionshttp://www.vinylresurgence.com
Grim's Media Managerhttp://www.twofold.co.za
MediaFairy import plugin http://www.meedios.com/forum/viewtopic.php?f=3&t=3912
myloradio.nethttp://myloradio.net
Nexouille (Meedios)http://tardigrade.ovh.org/nexouille/
Music Collectionhttp://www.gsoft4u.com