API Call BUilder

directdownloadlink:

hosterlist:

accountstatus:

Premiumize.me api documentation

note:
* responses are formatted to be better readable, the actual json responses don't contain line breaks.
* everything is rest and json based.
* every response consits of a json object with the fiels "result","status" and "statusmessage".
result holds data, status is an error/success code, statusmessage is only information relevant for displaying or debugging.
* only address fields using their named key, not their position within the object (because other data may be inserted at a later time)
* error codes conform tho http status codes (404 -> not found, etc...)
* in case of success the status code 200 is always returned
* when implementing the api, only use status codes and not status messages. they are only informational and may change.
* right now the api will work also if you mix up the order of parameters, because they have named keys. but please don't.
* you can see the parameters and urls in the example calls
* Important: don't do a filecheck whether a file is online via our api! please use the filecheck apis provided by the hosters.
in future we plan to release a seperate link checking api but no date is scheduled yet for that.
now to the methods...
method: accountstatus
error codes to be expected: 401 (login failed)
possible values for the field "type": premium, trial, prepaid, free. (all statueses except free can download)
possible values for the field "expires": a timestamp within the future or null
possible values for the field "fairuse_left": this field is a float value that represents how much of the fair use limit has been
already consumed. 0 represents that nothing is left (0% available), 1 means that everything is still available. the field is
normalized so that no negative values or values greater 1 will be returend. you can use this factor for example to show a bar-chart
or pie chart of how much fair use limit is left.
note: the fields trafficleft_bates and trafficleft_gigabytes are deprecated. this is because in future different hosters may have
different limits and the number may not be accurate. please only use the field fairuse_left in your program.
example call and response:
https://api.premiumize.me/pm-api/v1.php?method=accountstatus&params[login]=john&params[pass]=secret
{
"result": {
"account_name": "john",
"type": "premium",
"expires": 1349617332,
"fairuse_left": 0.77168611980213,
"trafficleft_bytes": 235758593575, // DEPRECATED
"trafficleft_gigabytes": 219.56730035599 // DEPRECATED
},
"status": 200,
"statusmessage": "OK"
}
method: hosterlist
errors to be expected: 401 (login failed)
example call and response:
https://api.premiumize.me/pm-api/v1.php?method=hosterlist&params[login]=john&params[pass]=secret
{
"result": {
"hosters": {
"netload.in": {
"tlds": ["netload.in"],
"regexes": ["http:\/\/netload.in\/datei.*"]
},
"uploaded.to": {
"tlds": ["uploaded.to", "ul.to"],
"regexes": ["http:\/\/uploaded.to\/file\/.+", "http:\/\/ul.to\/.+"]
}
},
"regexlist": ["http:\/\/netload.in\/datei.*", "http:\/\/uploaded.to\/file\/.+", "http:\/\/ul.to\/.+"],
"tldlist": ["netload.in", "uploaded.to", "ul.to"],
"hosterlist": ["netload.in", "uploaded.to"]
},
"status": 200,
"statusmessage": "OK"
}
method: directdownloadlink
errors to be expected:
* 400 (no valid link)
* 401 (login failed)
* 402 (payment required - the download would be possible, but the account is not premium)
* 403 (forbidden)
* 404 (file not found - the file has been deleted by a 3rd party provider)
* 428 (hoster currently not available. )
* 502 (unkonwn technical error (most likely from a 3rd party provieder - retry after some minutes, we recomend 3 minutes))
* 503 (temporary technical error, maintenance - retry after some minutes, we recomend 3 minutes),
* 509 (fair use limit exhausted - retry after some minutes, we recommend 10 minutes)
notes:
* we recommend to cancel downoads in case of any 4xx errors and retry them in several minutes in case of any 5xx errors.
* the location field holds a http/https url that direclty responds with a data. however there may be a redirect
behind it at a later time. content disposition filenames may or may not be sent, depending on the 3rd party provider
* urls may get a bit longer and will certainly outpass the 255 byte mark, but should stay below the 2083 byte mark, so any
modern browser and application will work.
example call and response:
https://api.premiumize.me/pm-api/v1.php?method=directdownloadlink&params[login]=john&params[pass]=secret&params[link]=http://netload.in/dateiogabcdeN0v/randomfile.htm
{
"result": {
"location": "http:\/\/188.165.158.76\/dl\/netload.in\/111\/c4ca4238a0b923820dcc509a6f75849b\/eNoB-AAH_9-L8iyuzDnSxkxSxTv4-9Okv2-ssPnBLjg30qsCMs_3AJTTFUZjkW-VqRaafsDXWn3iKJbFfAQR6i-fg5erfgt534dfg-AVXZKVgbJFxVtnSUxm-FVwoOp74IYnMxzYBRy_gTUKw28xTWB2OU3mDcuyXVlQdJh2UZkImGTMQS4GG5vWYLgnqJkU1fQ142wRNryHZqgS1dIxnrQZFZl3Fw\/randomfile.htm"
},
"status": 200,
"statusmessage": "OK"
}
if you have any questions or comments, please contact our support center