Skip to content

codeit-ninja/apibay

Repository files navigation

Thepiratebay API wrapper

TypeScript version Node.js version MIT

This is an unofficial wrapper for the apibay.org API, which is used by thepiratebay.org. I have added most, if not all, the features this API offers.

The API has some limitations. One of which is, there is no pagination trough search results. Perhaps they add that in the future. If so, I will add this feature in the module aswell.

Installation

npm install apibay.org

Usage

import TPBApi, { CATEGORIES } from 'apibay.org'

// Incase the API url changes, which could happen knowing thepiratebay, 
// you can manualy override the base url using this method
TPBApi.setBaseUrl('https://newapiurl.org')

TBPApi.search( {
    q: 'lord of the rings',
    cat: CATEGORIES.video.hd_movies // or 207
} )

// Returns top 100 based on category
TPBApi.top100(CATEGORIES.video.hd_tv_shows)

// Returns last 100 added torrents
TPBApi.recent()

// Returns torrent details
TPBApi.details(17175721)

// Returns all torrents uploaded by given user (This method supports paging!)
TPBApi.byUser('yify', 1)

About

Thepiratebay API wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published