1. Description

This document is intended to serve software developers as an implementation guide for integration with Content API.

Content API – component which provides historical data of downloading and sharing content using the BitTorrent protocol. Historical data is based on data from DHT network and in rare cases can be inaccurate.

2. Connectivity

2.1. Connection type

Connection to Content API is available over the HTTPS protocol based on REST. Every request that your application sends to the Content API needs to contain API key as GET parameter key. Please request API key from your manager.

2.2. Content Summary Statistics

You can get Content Summary Report:

where
  • host - hostname, will be provided.

  • day - day, format "yyyy-MM-dd".

  • imdb - IMDB ID, optional. Response contains all contents if IMDB ID is not specified. You can pass several imdb like 'imdb=tt2345759&imdb=tt1631867'

  • countryCode - ISO 3166-1 alpha-2 country code, optional. Response contains all countries if countryCode is not specified.

  • short - short report, true/false. Optional, by default - false.

  • key - API Key.

Response format - Json, example:

{
  "day": "2017-02-06",
  "totalPeers": 10085580,
  "contents": [
    {
      "imdb": "tt1567432",
      "name": "Teen Wolf",
      "totalPeers": 22268,
      "countries": [
        {
          "code": "BR",
          "peers": 3296
        },
        {
          "code": "US",
          "peers": 2234
        },
        {
          "code": "RU",
          "peers": 1481
        }
      ]
    },
    {
      "imdb": "tt3300542",
      "name": "London Has Fallen",
      "totalPeers": 20064,
      "countries": [
        {
          "code": "RU",
          "peers": 5141
        },
        {
          "code": "FR",
          "peers": 1135
        },
        {
          "code": "UA",
          "peers": 1044
        }
      ]
    }
  ]
}

Short report is the same report without "countries" in response Json.

Response JSON fields
Field Description

day

Date of report

totalPeers

Sum of totalPeers of all contents

contents

Array of contents

contents.imdb

imdbId of movie

contents.name

Title of movie

contents.totalPeers

Total unique ip sharing/downloading content

contents.countries

Statistics by country

contents.countries.code

Country ISO code

contents.countries.peers

Number of unique ip in country

Report for previous day usually is ready at 8 A.M. UTC+0.

2.3. Content Downloads Statistics

Downloads is number of new unique pairs ip-content per day. You can get Content Downloads Report:

where
  • host - hostname, will be provided.

  • day - day, format "yyyy-MM-dd".

  • imdb - IMDB ID, optional. Response contains all contents if IMDB ID is not specified. You can pass several imdb like 'imdb=tt2345759&imdb=tt1631867'

  • countryCode - ISO 3166-1 alpha-2 country code, optional. Response contains all countries if countryCode is not specified.

  • short - short report, true/false. Optional, by default - false.

  • key - API Key.

Response format - Json, example:

{
  "day": "2017-06-06",
  "totalDownloads": 5464699,
  "contents": [
    {
      "imdb": "tt3315342",
      "name": "Logan",
      "totalPeers": 59557,
      "countries": [
        {
          "code": "CN",
          "peers": 933
        },
        {
          "code": "AU",
          "peers": 525
        }
      ]
    },
    {
      "imdb": "tt4425200",
      "name": "John Wick: Chapter Two",
      "totalPeers": 59147,
      "countries": [
        {
          "code": "BY",
          "peers": 1393
        },
        {
          "code": "US",
          "peers": 2899
        }
      ]
    }
  ]
}

Short report is the same report without "countries" in response Json.

Response JSON fields
Field Description

day

Date of report

totalDownloads

Sum of totalDownloads of all contents

contents

Array of contents

contents.imdb

imdbId of movie

contents.name

Title of movie

contents.totalDownloads

Total downloads per day

contents.countries

Statistics by country

contents.countries.code

Country ISO code

contents.countries.downloads

Number of downloads in country

Report for previous day usually is ready at 10 A.M. UTC+0.

2.4. HTTP response codes

  • 200 - OK

  • 500 - Internal server error