This is for version 1.0.


Changelog

1.0: Initial Release for the new API.


Access Keys

To request an access key please come to our IRC channel (#ultrapre.talk @ irc.rizon.net - SSL = 9999) and query wm (fish supported) or you can email us at api A/T william.si (preffered).


Request Format

You query the API via a simple HTTPS GET or POST-Request to https://api.pre.im/v1.0/<method>. You can use the GET-Request if the Method requires no Parameters. All Methods with Parameters must be queried with POST-Requests.

As a post body you have to submit the search parameters as a JSON-encoded string.

You also have to submit your Accesskey as an additional HTTP-Header. So a generic request will have to look like this to be successful:

POST /v1.0/<method> HTTP/1.1
Host: api.pre.im
Accept: <format>
Accesskey: <Accesskey>
Content-Length: ###
Content-Type: application/json

<opts>

Here are the descriptions for each parameter:

Variable Expected Value Required Example
method string Yes dupe
format string Yes application/json
opts JSON-encoded string Not for all requests { "section": "mp3", "limit": 10 }
Accesskey string[32] Yes 1337deadbeefdeadbeefdeadbeef1337

The opts parameter has the following options:

Variable Description Expected Value Required for
group Filter the results for the given group string group
search Search for the given value string dupe, edupe, nfo, rdupe
section Search in the given section string none
limit The number of results integer none

Example:

POST /v1.0/dupe HTTP/1.1
Host: api.pre.im
Accept: application/json
Accesskey: 1337deadbeefdeadbeefdeadbeef1337
Content-Length: 68
Content-Type: application/json

{ "group": "test", "search": "xvid", "section": "mp3", "limit": 15 }


Requests

The API offers a lot of different requests. Here you will find a detailed description of each method.

Description

The dupe Method returns a Set of latest Releases that match your search term with nuke and unnuke information. If you miss the pre Command, use the limit option.

Parameters

Parameter Description Value Required
group Search for Releases from the given Group string
search The String to search for string
section Search for Releases in the given Section string
limit Show x Releases integer[10]

Description

The edupe Method does exactly the same as the dupe Method except it search also for deleted Releases. This may be slow. If you miss the epre Command, use the limit option.

Parameters

Parameter Description Value Required
group Search for Releases from the given Group string
search The String to search for string
section Search for Releases in the given Section string
limit Show x Releases integer[10]

Description

The group Method gives you information about the first, last and amount of Releases for the given Group.

Parameters

Parameter Description Value Required
group Show the Stats for the given Group string

Description

The lastnuke Method returns a set of Releases that have been nuked recently.

Parameters

Parameter Description Value Required
group Show the last Nukes for the given Group string
section Search for last Nukes in the given Section string
limit Show the x-th last Nukes integer[10]

Description

This method returns the last Releases that have been pred.

Parameters

Parameter Description Value Required
section Search for last Pres in the given Section string
limit Show the x-th last Pres integer[10]

Description

The lastunnuke Method returns a Set of Releases that have been unnuked recently.

Parameters

Parameter Description Value Required
group Show the last Unnukes for the given Group string
section Search for last Unnukes in the given Section string
limit Show the x-th last Unnukes integer[10]

Description

The NFO Method returns an URL to the PreDB NFO Viewer, depending on your api key it will be possible to download the NFO there.

Parameters

Parameter Description Value Required
search The Release to get the NFO for string

Description

The rdupe Method returns a Set of oldest Releases that match your search term with nuke and unnuke information. If you miss the rpre Command, use the limit option.

Parameters

Parameter Description Value Required
group Search for Releases from the given Group string
search The String to search for string
section Search for Releases in the given Section string
limit Show x Releases integer[10]

Description

The sections Method gives a list of all our sections in our Database.

Parameters

None

Description

The stats Method gives you some information over our Database.

Parameters

None

Response Format

The API will answer your Request with several different HTTP Status Codes and your requsted Data Format.

Response-Formats

Release

{
  "time": Pretime as an Integer,
  "section": Section as a String,
  "release": Releasename as a String,
  "genre": Genre as a String,
  "files": Amount of Files as an Integer,
  "size": Size of Release as a Float,
  "nukes": Array of Nuke-Objects or NULL
}

Nuke/Unnuke/Modnuke

{
  "isnuke": Nuketype as a Boolean,
  "ismodnuke": Modnuketype as a Boolean,
  "time": Nuketime as an Integer,
  "reason": Reason as a String,
  "network": Nukenetwork as a String
}

To receive your Data JSON-encoded just send the application/json or text/json Accept-Header.

MessagePack returns the exact same datastructures as JSON but encoded in MessagePack.

To receive your Data MessagePack-encoded just send the application/x-msgpack Accept-Header.

HTTP Status Codes

Code Meaning
200 Your Request was successful. The Body contains your Results.
204 Your Request was successful. There is no data to be listed (no results found).
400 Your Request was malformed.
401 Your maximum Queries has been exceeded. Contact wm for increasing your Limits.
403 Your Key isn't valid. The Body will contain more Information.
Other An internal Error occured. You did nothing wrong ;)

Useful Tools

Here we list some interesting Tools that might be useful when building Apps for our API.