What is the PornCovers API

The PornCovers API has been created to allow our partners to easily add content to their site, by integrating our content into their design.

The API allows full-freedom in how you use the content you retrieve, and is a great way to add that extra something to your site.

To use the API you must apply for an API Developer user name and key. When applying please provide as many details possible about your intended use of the API.

Thank you for trying out the PornCovers API.

How to use the API

The API accepts REST requests and returns results as a simple XML file.

To receive an XML file with search results, send a request to a url formatted like this:

http://www.porncovers.com/api/search/:user_name:/:query_hash:/:search_phrase:

Let's say, for example, that your username is dick, your secret key is BJz2LYhjOB4grzD8fhrt49rviSW3yvKT and you are searching for "jenna jameson".

The query_hash for this search is the md5 hash of your user name and the search phrase.

Note that all sample code in this page is written in PHP and uses the SimpleXML functions.

Here is an example of constructing a url for a cover search:

  1. <?php
  2. $user_name = 'dick';
  3. $secret_key = 'BJz2LYhjOB4grzD8fhrt49rviSW3yvKT';
  4. $search_phrase = 'jenna jameson';
  5. $query_hash = md5($secret_key.$search_phrase);
  6. // $query_hash = c6a8e04a0cf9c1582a77d4e3bde9a705
  7. $xml_request_url = 'http://www.porncovers.com/api/search/'.$user_name.'/'.$query_hash.'/'.urlencode($search_phrase);
  8. ?>

To retrieve the xml results file, simply send a query to the url we constructed in the previous step:

  1. $xml = new SimpleXMLElement($xml_request_url, null, true);

The results you will receive in XML will take this form:

  1. <rsp stat="ok" version="1.0">
  2.   <title>
  3.     <name>Jenna Jameson Is The Masseuse Custom DVD</name>
  4.     <id>283</id>
  5.     <category>Movies</category>
  6.     <subcategory>Adult</subcategory>
  7.     <image>http://www.porncovers.com/image_system/images/d/6/d60f459e490c0d0884322431f1a8d1d3.jpg</image>
  8.     <covers>
  9.       <cover>
  10.         <type>Front</type>
  11.         <width>3400</width>
  12.         <height>2289</height>
  13.         <filesize>1583423</filesize>
  14.         <uploaded_at>2007-02-14 20:02:35</uploaded_at>
  15.         <average_rating>4</average_rating>
  16.         <url>http://www.porncovers.com/show/283/jenna_jameson_is_the_masseuse_custom_dvd/front</url>
  17.         <thumbnail>http://www.porncovers.com/image_system/covers_th/d/6/d64ae1ec9463efa87c13caf4cfc15698.jpg</thumbnail>
  18.       </cover>
  19.         <cover>
  20.         <type>CD</type>
  21.         <width>1694</width>
  22.         <height>1747</height>
  23.         <filesize>1036556</filesize>
  24.         <uploaded_at>2007-02-14 20:02:35</uploaded_at>
  25.         <average_rating>5</average_rating>
  26.         <url>http://www.porncovers.com/show/283/jenna_jameson_is_the_masseuse_custom_dvd/cd</url>
  27.         <thumbnail>http://www.porncovers.com/image_system/covers_th/9/f/9f2252907a8e0c5430f72b7d30b48703.jpg</thumbnail>
  28.       </cover>
  29.     </covers>
  30.   </title>
  31. </rsp>

Now all you have to do is go over the results file and format your output.

  1. foreach ($xml as $title) {
  2.   echo 'Title: '.$title->name;
  3.   echo 'Category: '.$title->category.': '.$title->subcategory;
  4.   echo 'Image: '.$title->image;
  5.   foreach ($title->covers->cover as $cover) {
  6.     echo 'Cover type:'.$cover->type;
  7.     echo 'Resolution:'.$cover->width.' '.$cover->height;
  8.     echo 'Filesize:'.$cover->filesize;
  9.     echo 'Upload date:'.$cover->uploaded_at;
  10.     echo 'Average rating:'.$cover->average_rating;
  11.     echo 'Download page:'.$cover->url;
  12.     echo 'Thumbnail:'.$cover->thumbnail;
  13.   }
  14. }
  15. ?>

Limiting results by category

You can limit the results returned to just one category of titles - by adding the category name to the end of the request url.

For example, a search for jenna jameson covers:

http://www.porncovers.com/api/search/dick/15ebb4f2/jenna+jameson

Becomes a search for Beatles movie covers:

http://www.porncovers.com/api/search/dick/15ebb4f2/jenna+jameson/movies

Complete working example

The following example connects to the site, retrieves all results for "jenna jameson" and displays them.

  1. <?php
  2. $user_name = 'dick';
  3. $secret_key = 'BJz2LYhjOB4grzD8fhrt49rviSW3yvKTs';
  4. $search_phrase = 'jenna jameson';
  5. $query_hash = md5($secret_key.$search_phrase);
  6. $xml_request_url = 'http://www.porncovers.com/api/search/'.$user_name.'/'.$query_hash.'/'.urlencode($search_phrase);
  7. $xml = new SimpleXMLElement($xml_request_url, null, true);
  8. if (isset($xml->err)) {
  9.   echo $xml->err['msg'];
  10. } else {
  11.   foreach ($xml as $title) {
  12.     echo 'Title: '.$title->name;
  13.     echo 'Category: '.$title->category.': '.$title->subcategory;
  14.     echo 'Image: '.$title->image;
  15.     echo 'Image: '.$title->image;
  16.     foreach ($title->covers->cover as $cover) {
  17.       echo 'Cover type:'.$cover->type;
  18.       echo 'Resolution:'.$cover->width.' '.$cover->height;
  19.       echo 'Filesize:'.$cover->filesize;
  20.       echo 'Upload date:'.$cover->uploaded_at;
  21.       echo 'Average rating:'.$cover->average_rating;
  22.       echo 'Download page:'.$cover->url;
  23.       echo 'Thumbnail:'.$cover->thumbnail;
  24.     }
  25.   }
  26. }
  27. ?>

And that's it… Simple as that.


PornCovers API

Developers, check out our new API that lets you integrate cover art and content from PornCovers into your website, blogs and widgets.

Upload Contest

Do you have Adult CD/DVD covers that we don't? Upload your xxx cover art now and auto enroll in our monthly upload contest. Visit our homepage for more details.

About PornCovers

PornCovers is a community driven website offering free high quality adult cover art for non commercial use. All the porn CD and DVD covers are uploaded, approved and ranked by our users. Join PornCovers Now!