Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.43 KB

README.md

File metadata and controls

56 lines (44 loc) · 1.43 KB

IPRoyal Residential API Wrapper

JavaScript Async/Await API for proxy service IPRoyal.com

API

To work with the API, you must have an account token. You can get it in your personal account on the portal.

Starting

Connect the IPRoyal module to Node.JS and create a new instance of the class.

let iproyal = require(`iproyal-wrapper`);
let token = `abc`; // IPRoyal account token

let account = new iproyal(token);

Methods

  • new IPRoyal();
  • account.getInfo();
  • account.getSubUsers();
  • account.createSubUser();
  • account.getSubUserInfo();
  • account.updateSubUserInfo();
  • account.addSubUserTraffic();
  • account.takeSubUserTraffic();
  • account.getAvailableCountries();
  • account.getAvailableCountrySets();
  • account.getAvailableRegions();
  • account.getProxyHostNames();
  • account.generateUserProxyList();

Examples

let account = new iproyal(`abc`);
let subusersList = await account.getSubUsers(10);
console.log(subusersList);
console.log(await subusersList.next());
console.log(await subusersList.next());
let account = new iproyal(`abc`);
let newSubUser = await account.creteSubUser(`login`, `password`, traffic);
console.log(anewSubUser);
let newSubUser = await account.creteSubUser(`login`, `password`, traffic);
console.log(await account.addSubUserTraffic(newSubUser.id, 4));