API Documentation

Last updated: December 4th, 2018

General information

API calls Syntax

Base-URL for our API is https://api.bitporno.com/v2 (note the v2 for version 2 behind the /)
All requests to the API shall be HTTP/1.1 GET

Caution

Most requests require a API Login & API Key, you can find both in the User Panel at the "User Settings" Tab.

Please make sure to use the API with https only.

Response is json, structure is as follows:

{
    "status": <status-code>,
    "msg": "<informational message. might vary, use the status code in your code!>",
    "result": <result of the request. varies depending on the request>
}
                                    

API status responses

Status # Response
200 Everything is OK. Request succeeded
400 Bad request (e.g. wrong parameters)
403 Permission denied (wrong api login/key, action on a file which does not belong to you, ...)
404 File not found
451 Unavailable For Legal Reasons
50x Server errors. You should not see this, but be prepared.

API message and results

Key # Text
msg This message gives more detailed information in case there is an error. You can use this for displaying it to the user, but please don't use it for checking if the request succeeded. That's what the status code is for.
result holds the response of the request if succeeded. Might hold an array of data or just a boolean true/false, depending on the request

Account

Account information

Request
https://api.bitporno.com/v2/account/info?login=<api_username>&key=<api_password>
Name Description Example Required
login API-Login 5147a8f8e924bc82 yes
key API-Key / API-Password Fa89_X13-37a8CKR yes
Example Response
200 (OK)
Content-Type: application/json
{
  "status": 200,
  "msg": "OK",
  "result": {
    "user_id": "1",
    "user_email": "test234@mail.com",
    "user_regdate": "1206633247",
    "premium_active": "0"
  }
}

Videos

Check information of one Video

Request
https://api.bitporno.com/v2/file/info?login=<api_username>&key=<api_password>&file=<files>
Name Description Example Required
file File-ID(s), single file or comma-separated (max. 50) FXR1I5PIK1,FXQXRRATXY yes
login API-Login 5147a8f8e924bc82 yes
key API-Key / API-Password Fa89_X13-37a8CKR yes
Example Response
200 (OK)
Content-Type: application/json
{
  "status": 200,
  "msg": "OK",
  "result": {
    "FXR1I5PIK1": {
      "id": "FXR1I5PIK1",
      "status": 200,
      "name": "Jess_Anders.mp4",
      "description": ""
    },
    "FXQXRRATXY": {
      "id": "FXQXRRATXY",
      "status": 200,
      "name": "video_156.mp4",
      "description": ""
    }
  }
}

Upload

Upload an file

Request
https://api.bitporno.com/v2/file/bp?login=<api_username>&key=<api_password>&folder=<folder_id>&sha1=<sha1>&httponly=<httponly>
Name Description Example Required
login API-Login 5147a8f8e924bc82 no
key API-Key / API-Password Fa89_X13-37a8CKR no
sha1 Expected sha1.
If sha1 of uploaded file doesn't match this value, upload fails
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 no
folder Folder-ID to upload to 1234 no
httponlyIf if this is set to true, output only http links false no
Example Response
200 (OK)
Content-Type: application/json
{
    "status": 200,
    "msg": "OK",
    "result": {
        "url": "https://13abc37.example.com/ul/fCgaPthr_ys",
        "valid_until": "2015-01-09 00:02:50"
    }
}

Remote Uploads

Add an remote upload job

Request
https://api.bitporno.com/v2/remotedl/add?login=<api_username>&key=<api_password>&url=<http_url>&folder=<folder_id>
Name Description Example Required
login API-Login 5147a8f8e924bc82 yes
key API-Key / API-Password Fa89_X13-37a8CKR yes
url Remote URL http://google.com/favicon.ico yes
folder Folder-ID to upload to 1234 no
Example Response
200 (OK)
Content-Type: application/json
{
  "status": 200,
  "msg": "OK",
  "result": {
    "id": 9847
  }
}

Check status of an remote upload job

Request
https://api.bitporno.com/v2/remotedl/status?login=<api_username>&key=<api_password>&id=<remote_upload_id>&limit=<limit_output>
Name Description Example Required
login API-Login 5147a8f8e924bc82 yes
key API-Key / API-Password Fa89_X13-37a8CKR yes
id Remote Upload ID 1234 no
limit Maximum number of results (Default: 5, Maximum: 100) 5 no
Example Response
200 (OK)
Content-Type: application/json
{
  "status": 200,
  "msg": "OK",
  "result": {
    "8553": {
      "id": 8553,
      "remoteurl": "http://ftp.nluug.nl/pub/graphics/blender/demo/movies/Sintel.2010.1080p.mkv",
      "status": "finished",
      "bytes_loaded": "1172428172",
      "bytes_total": "1172428172",
      "progess": 100,
      "folderid": 0,
      "added": null,
      "last_update": null,
      "extid": "FXSMG73YCZ",
      "url": "https://www.bitporno.com/v/FXSMG73YCZ"
    }
  }
}

Encoding System

Check encoding status of an file

Request
https://api.bitporno.com/v2/file/converts?login=<api_username>&key=<api_password>&file=<files>&output=<format>
Name Description Example Required
login API-Login 5147a8f8e924bc82 yes
key API-Key / API-Password Fa89_X13-37a8CKR yes
file ID of an file FXSNPOKMT4 yes
output By default, all formats are displayed, you can specifiy 360p, 480p, 720p or 1080p to limit the result output. 480p no
Example Response
200 (OK)
Content-Type: application/json
{
  "status": 200,
  "msg": "OK",
  "result": {
    "FXSNPOKMT4": {
      "encoding_summary": "success",
      "is_playable": 1,
      "link": "https://www.bitporno.com/v/VXSNPOKMT3",
      "linkextid": "VXSNPOKMT3",
      "encoding_status": [
        {
          "codec_id": "85",
          "job_id": "97516672",
          "converted": "1",
          "locked": "0",
          "created_timestamp": "1543752473",
          "updated_timestamp": "1543756167",
          "skipped": "0",
          "progress": "100",
          "retires": "2",
          "label": "360p"
        },
        {
          "codec_id": "86",
          "job_id": "97516674",
          "converted": "1",
          "locked": "0",
          "created_timestamp": "1543752473",
          "updated_timestamp": "1543752936",
          "skipped": "0",
          "progress": "100",
          "retires": "4",
          "label": "480p"
        },
        {
          "codec_id": "87",
          "job_id": "97516676",
          "converted": "1",
          "locked": "0",
          "created_timestamp": "1543752473",
          "updated_timestamp": "1543752698",
          "skipped": "1",
          "progress": "0",
          "retires": "1",
          "label": "720p"
        },
        {
          "codec_id": "88",
          "job_id": "97516678",
          "converted": "1",
          "locked": "0",
          "created_timestamp": "1543752473",
          "updated_timestamp": "1543752704",
          "skipped": "1",
          "progress": "0",
          "retires": "1",
          "label": "1080p"
        }
      ]
    }
  }
}

Get splash image

Shows the video splash image (thumbnail). Optionally, you can choose another image.

Request
https://api.bitporno.com/v2/file/getsplash?login=<api_username>&key=<api_password>&file=<files>&splash=<splash_no>
Name Description Example Required
login API-Login 5147a8f8e924bc82 yes
key API-Key / API-Password Fa89_X13-37a8CKR yes
file ID of an file FXSNPOKMT4 yes
splash By default, ID 0 will choosen, that is, the big thumbnail picture are returned. You can choose another image up to ID 5 to choose an image from tileset. 1 no
Example Response
200 (OK)
Content-Type: application/json
{
  "status": 200,
  "msg": "OK",
  "result": "https://foot.playercdn.net/thumb/0/181101/118FXR1IB1ZAZWGNG6LV5.jpg"
}