premium.to API
Every method needs the parameters userid and apikey. Both can be found in the menu “Account”.
Every response has the content type “application/json”.
The only exception is the method download.php which can also return the content type “application/octet-stream”.
Methods
Method | URL |
GET | http://api.premium.to/api/2/getfile.php |
Params | Values |
userid apikey link | string string string |
The paramater link must be a supported file host url. For example: http://uploaded.net/file/abc
Status | Response |
200 | The content of the requested file. The content type is “application/octet-stream” |
302 | Redirect to another server |
200 | {"code":400,"message":"Invalid parameters"} |
200 | {"code":401,"message":"Invalid API authentication"} |
200 | {"code":402,"message":"Filehost is not supported"} |
200 | {"code":403,"message":"Not enough traffic"} |
200 | {"code":404,"message":"File not found"} |
200 | {"code":429,"message":"Too many open connections"} |
200 | {"code":500,"message":"Currently no available premium acccount for this filehost"} |
Method | URL |
GET | http://api.premium.to/api/2/traffic.php |
Params | Values |
userid apikey | string string |
Status | Response |
200 | An example response is: {"code":200,"traffic": 1234, "specialtraffic": 1234} |
200 | {"code":401,"message":"Invalid API authentication"} |
3. Get the enabled file hosts
A used can enable or disable file hosts in the menu “DLM”.
Method | URL |
GET | http://api.premium.to/api/2/hosts.php |
Params | Values |
userid apikey | string string |
Status | Response |
200 | An example response is: {"code":200,"hosts":["uploaded.net", "filer.net", "oboom.com", "1fichier.com", "rapidgator.net", "datei.to", "alfafile.net"]} |
200 | {"code":401,"message":"Invalid API authentication"} |
4. Send traffic to another user
Method | URL |
GET | http://api.premium.to/api/2/sendtraffic.php |
Params | Values |
userid apikey receiverid megabyte | string string string integer |
The paramater receiverid must be the API userid of the user who should receive the traffic.
Status | Response |
200 | {"code":200,"message": "Traffic was transferred"} |
200 | {"code":400,"message":"Invalid parameters"}} |
200 | {"code":401,"message":"Invalid API authentication"} |
200 | {"code":403,"message":"Not enough traffic"} |
200 | {"code":404,"message": "Receiver does not exist"} |
5. Create a voucher code
Method | URL |
GET | http://api.premium.to/api/2/createvoucher.php |
Params | Values |
userid apikey gigabyte | string string integer |
Status | Response |
200 | An example response is: {"code":200,"voucher":"abcdefg"} |
200 | {"code":400,"message":"Invalid parameters"} |
200 | {"code":401,"message":"Invalid API authentication"} |
200 | {"code":403,"message":"Not enough traffic"} |
6. Delete a voucher code
Method | URL |
GET | http://api.premium.to/api/2/deletevoucher.php |
Params | Values |
userid apikey voucher | string string string |
Status | Response |
200 | {"code":200,"message":"Voucher was deleted"} |
200 | {"code":400,"message":"Invalid parameters"} |
200 | {"code":401,"message":"Invalid API authentication"} |
200 | {"code":404,"message":"Voucher not found"} |
7. Clear all used voucher codes
Method | URL |
GET | http://api.premium.to/api/2/clearvouchers.php |
Params | Values |
userid apikey | string string |
Status | Response |
200 | {"code":200,"message":"Voucher cleared"} |
200 | {"code":401,"message":"Invalid API authentication"} |
8. Show all voucher codes
Method | URL |
GET | http://api.premium.to/api/2/listvouchers.php |
Params | Values |
userid apikey | string string |
Status | Response |
200 | An example response is: {"code":200,"vouchers": [ { "voucher": "abcdef", "traffic": 1, "status": "Not used" }, { "voucher": "gfhijkl", "traffic": 2, "status": "Used"}]} |
200 | {"code":401,"message":"Invalid API authentication"} |