{"id":17316948,"url":"https://github.com/serenader2014/rarbg-api","last_synced_at":"2025-04-14T14:12:06.315Z","repository":{"id":47856529,"uuid":"86133297","full_name":"serenader2014/rarbg-api","owner":"serenader2014","description":"A simple node.js wrapper for rarbg.to api","archived":false,"fork":false,"pushed_at":"2022-12-06T01:43:06.000Z","size":262,"stargazers_count":24,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T03:04:27.037Z","etag":null,"topics":["api","bittorrent","rarbg","torrent"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rarbg-api","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serenader2014.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-25T04:50:17.000Z","updated_at":"2025-01-17T13:52:03.000Z","dependencies_parsed_at":"2023-01-23T05:25:27.142Z","dependency_job_id":null,"html_url":"https://github.com/serenader2014/rarbg-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenader2014%2Frarbg-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenader2014%2Frarbg-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenader2014%2Frarbg-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenader2014%2Frarbg-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serenader2014","download_url":"https://codeload.github.com/serenader2014/rarbg-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894938,"owners_count":21179152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bittorrent","rarbg","torrent"],"created_at":"2024-10-15T13:14:55.097Z","updated_at":"2025-04-14T14:12:06.282Z","avatar_url":"https://github.com/serenader2014.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rarbg.to API\n\nThis is an unofficial nodejs api wrapper for rarbg.to website.\n\n[![Build Status](https://travis-ci.org/serenader2014/rarbg-api.svg?branch=master)](https://travis-ci.org/serenader2014/rarbg-api)\n[![npm module](https://badge.fury.io/js/rarbg-api.svg)](https://www.npmjs.org/package/rarbg-api)\n[![dependencies](https://david-dm.org/serenader2014/rarbg-api.svg)](https://david-dm.org/serenader2014/rarbg-api.svg)\n\n# Installation\n\nFirst download this package from npm registry\n\n```bash\nnpm i --save rarbg-api\n```\n\nand require it from your project:\n\n```javascript\nconst rarbgApi = require('rarbg-api')\n```\n\n# Environment Flags\n#### **NODE_ENV**\n- Can be set to `debug` to see debug messages and errors\n#### **LOCAL_ADDRESS**\n- Can be set to a network interface ip address in order to send requests from that source\n- See [http.request.options](https://nodejs.org/api/http.html#http_http_request_url_options_callback) for more details\n\n    \n\n# API\n\n### .list([options: Object]): Array\n\nList torrent.\n\n#### Parameters\n\n- **options**\n    + Object\n    + Optional\n    \n    See [additional options section](#additional-options)\n\n\n#### Returns\n\nThe api returns a promise which will resolve a list of torrent.\n\n### .search(keyword[, options, type]): Array\n\nSearch torrent using a keyword.\n\n#### Parameters\n\n- **keyword**\n    + String\n\n    Specify a keyword to search.\n\n- **options**\n    + Object\n    + Optional\n\n    See [additional options section](#additional-options)\n\n- **type**\n    + String\n    + Optional\n    \n    Specify a search mode to use. Available type is: `['imdb', 'tvdb', 'themoviedb', 'tvrage']`. If search type is provided, the search keyword is a specific id, for example, if you provide `imdb` search type, the keyword must be a `imdb` id. Eg: `search('tt0944947', null, 'imdb')`. \n\n#### Returns\n\nThe api returns a promise which will resolve the search result.\n\n# Additional options\n\nSome of the apis support category filtering and sorting, and other options. All available options are: \n\n```javascript\n  const defaultParams = {\n    category: null,\n    limit: 25,\n    sort: 'last',\n    min_seeders: null,\n    min_leechers: null,\n    format: 'json_extended',\n    ranked: null,\n  }\n```\n\n### category\n\nYou can specify a category to filter the torrent. Category information can be imported by `require('./index').CATEGORY`. This options support an array.\n\nEg: \n\n```javascript\nconst rarbgApi = require('./index')\n\nrarbgApi.list({\n  category: rarbgApi.CATEGORY.MOVIES\n}).then(data =\u003e console.log(data))\n```\n\nThe above example will list latest movie torrents.\n\n## 4K Support\n```javascript\nconst rarbgApi = require('./index')\n\nrarbgApi.list({\n  category: rarbgApi.CATEGORY['4K']\n}).then(data =\u003e console.log(data))\n```\n\nThe above example will list latest 4K movie torrents.\n\n\n### limit\n\nLimit the result torrent's size. Default size is 25, all supported options are: **25, 50, 100**\n\nEg:\n\n```javascript\nconst rarbgApi = require('./index')\n\nrarbgApi.list({\n  limit: 50\n}).then(data =\u003e console.log(data.length))\n```\n\n### sort\n\nSpecify the sorting. Default sorting is `last`. Available options are: **last, seeders, leechers**\n\nEg: \n\n```javascript\nconst rarbgApi = require('./index')\n\nrarbgApi.list({\n  sort: 'seeders'\n}).then(data =\u003e console.log(data))\n```\n\n### min_seeders, min_leechers\n\nFiltering the torrent by specify the torrent's minimal seeders or minimal leechers. It's value is a number. Default is `null`.\n\nEg:\n\n```javascript\nconst rarbgApi = require('./index')\nrarbgApi.list({\n  min_seeders: 100\n}).then(data =\u003e console.log(data))\n```\n\n### format\n\nSpecify which format will the api returns. Default is `json_extended`, which will include the detail infomations of each torrent. Other supported option is **json**.\n\nThe `json_extended` format is:\n\n```json\n{ \n    \"title\": \"Logan.2017.1080p.WEB-DL.DD5.1.H264-FGT\",\n    \"category\": \"Movies/x264/1080\",\n    \"download\": \"magnet:?xt=urn:btih:d2d6a72b60cdb2cc5e80d3277d89d5df18c3ecbc\u0026dn=Logan.2017.1080p.WEB-DL.DD5.1.H264-FGT\u0026tr=http%3A%2F%2Ftracker.trackerfix.com%3A80%2Fannounce\u0026tr=udp%3A%2F%2F9.rarbg.me%3A2710\u0026tr=udp%3A%2F%2F9.rarbg.to%3A2710\u0026tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce\",\n    \"seeders\": 848,\n    \"leechers\": 116,\n    \"size\": 5100226269,\n    \"pubdate\": \"2017-05-15 09:37:27 +0000\",\n    \"episode_info\": { \n        \"imdb\": \"tt3315342\",\n        \"tvrage\": null,\n        \"tvdb\": null,\n        \"themoviedb\": \"263115\" \n    }\n}\n```\n\n\nThe `json` format is:\n\n```json\n{\n    \"filename\": \"Real.Time.With.Bill.Maher.2017.06.09.1080p.WEB.h264-TBS[rartv]\",\n    \"category\": \"TV HD Episodes\",\n    \"download\": \"magnet:?xt=urn:btih:f6afb0028270ccca6d4535be4c42a0583a5a5737\u0026dn=Real.Time.With.Bill.Maher.2017.06.09.1080p.WEB.h264-TBS%5Brartv%5D\u0026tr=http%3A%2F%2Ftracker.trackerfix.com%3A80%2Fannounce\u0026tr=udp%3A%2F%2F9.rarbg.me%3A2710\u0026tr=udp%3A%2F%2F9.rarbg.to%3A2710\u0026tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce\"\n}\n```\n\n\n### ranked\n\nBy default the api will return only ranked torrents ( internal ) , scene releases + -rarbg releases + -rartv releases.\n\nIf you want other groups included in the results use the ranked parameter with a value of 0 to get them included.\n\n# Test\n\nClone this project, and install the dependencies `npm i`, `npm run build` and run `npm run test` to see the test result.\n\nNote that sometimes the test will fail because of the network problem. Currently all the tests timeout is 60000ms, if your network is poor, you may encounter test timeout error.\n\n# Limitation\n\nDue to the rarbg api's limitation, you may encounter error like:\n\n```json\n{\n  \"error\": \"Too many requests per second. Maximum requests allowed are 1req/2sec Please try again later!\",\n  \"error_code\": 5\n}\n```\n\nThe api is limit to 1req/2sec, so you should control the frequency.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserenader2014%2Frarbg-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserenader2014%2Frarbg-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserenader2014%2Frarbg-api/lists"}