0.6.9 • Published 3 years ago

api-growtopia v0.6.9

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Api Growtopia

A Simple Growtopia API built using NodeJs

Instalation

$ npm install api-growtopia --save

Feature

Example

  • Find Item Info Example:
const gt = require("api-growtopia");

gt.itemInfo("angel").then(result => {
  console.log(result);

  /*
  Result Output:
  {
  name: 'Angel Wings',
  url: 'https://growtopia.wikia.com/wiki/Angel_Wings',
  desc: 'Better than a Halo, these will actually let you double jump!',
  properties: ['This item never drops any seeds', 'This item can be transmuted'],
  image: 'https://static.wikia.nocookie.net/growtopia/images/8/8f/ItemSprites.png/revision/latest/window-crop/width/32/x-offset/1504/y-offset/1664/window-width/32/window-height/32?fill=cb-20210901104457',
  color: ['#EFEFEF', '#FFFFFF'],
  rarity: undefined,
  recipes: {
    type: 'Valentine Loot',
    recipe: ['It is a possible drop from breaking either a  Heartstone,  Golden Booty Chest, or a  Super Golden Booty Chest or from a  Well of Love every five  Golden Booty Chests filled.']
  },
  splice: undefined,
  info: "The Angel Wings is an unsplicable back item which was added as part of Valentine's Week 2013.",
  type: 'Clothes'
}
  */
}).catch(err => {
  //Handle error 
  console.error(err);
});
  • Search Item Example:
const gt = require("api-growtopia");

gt.searchItem("angel").then(result => {
  console.log(result);

  /*
  Result Output: 
  [{
  name: "Angel of Mercy's Wings",
  url: "https://growtopia.fandom.com/wiki/Angel_of_Mercy's_Wings"
  },
  {
    name: 'Angel Wings',
    url: 'https://growtopia.fandom.com/wiki/Angel_Wings'
  },
  {
    name: 'Angelic Counting Cloud',
    url: 'https://growtopia.fandom.com/wiki/Angelic_Counting_Cloud'
  }, {
    name: 'Angelic Heart Cloud',
    url: 'https://growtopia.fandom.com/wiki/Angelic_Heart_Cloud'
  },
  {
    name: 'Golden Angel Wings',
    url: 'https://growtopia.fandom.com/wiki/Golden_Angel_Wings'
  }]
  */

}).catch(err => {
  //Handle error 
  console.error(err);
});
  • Checking Server Status Example:
const gt = require("api-growtopia");

gt.server().then(result => {
  console.log(result);

  /*
  Result Output: 
  {
  date: 'Sep 28th',
  time: '08:14:23',
  online: 73624,
  wotdName: 'TEMPLERUINS',
  wotdUrl: 'https://i.ibb.co/sWmWVWJ/Panji-Rendering-TEMPLERUINS.png'
  }
  */
  
}).catch(err => {
//Handle error
  console.error(err);
});
  • Render World Example:
const gt = require("api-growtopia");

gt.renderWorld("buybait").then(result => {
  console.log(result);

  /*
  Output if success:
  {
  status: 'success',
  expired: '3600 Second',
  info: 'This feature only works if the World has been Rendered Before',
  url: 'https://i.ibb.co/17dwPL9/Panji-Rendering-BUYBAIT.png'
  }
  
  Output if fail:
  {
  status: 'failed',
  expired: null,
  info: 'This feature only works if the World has been Rendered Before',
  url: 'https://i.ibb.co/wRS9h9t/errors.jpg'
  }
  */

}).catch(err => {
  //Handle error 
  console.error(err);
});
  • Check Daily Quest Example:
const gt = require("api-growtopia");

gt.dailyQuest().then(res => {
  console.log(res);
  
/* Example Output:
{
  item1: {
    name: 'Picket Fence Seed',
    amount: '200',
    price: '200/2 WLs',
    rate: '+33.3%'
  },
  item2: {
    name: 'Steam Piston Seed',
    amount: '23',
    price: '13/1 WL',
    rate: '+13.3%'
  },
  totalPrice: '3 WLs'
}
*/

}).catch(err => {
  //Handle error 
  console.error(err);
});
  • Check Item Price Example:
const gt = require("api-growtopia");

gt.checkPrice("angel").then(res => {
  console.log(res);

/* Example Output:
{
  name: 'Angel Wings',
  price: '21 WLs',
  rate: '+14.3%',
  priceStatus: 'stable',
  demandStatus: 'stable',
  source: 'buyangel',
  lastEdit: '1mon ago',
  editor: 'HeaLeave',
  warning: 'The Price May Be Outdated!, Please double check in-game to make sure'
}
*/

}).catch(err => {
  //Handle error 
  console.error(err);
});
  • Find Item Image
const gt = require("api-growtopia");

gt.itemImage("angel").then(result => {
  console.log(result);
  
  /* Example Output:
  {
    itemName: 'Angel Wings',
    imgUrl: 'https://static.wikia.nocookie.net/growtopia/images/8/8f/ItemSprites.png/revision/latest/window-crop/width/32/x-offset/512/y-offset/1280/window-width/32/window-height/32?fill=cb-20210923151939'
  }
  */
  
}).catch(error => {
  console.error(error);
});

Info

  • Checking server status maybe will not work if the server is maintenance
  • Rendering World won't work if the World hasn't been rendered before
  • Check Price & Daily Quest is still Beta
  • You can also using Async Function if you don't want to use Method then()

Thanks To

0.6.9

3 years ago

0.6.5

3 years ago

0.6.0

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.1

3 years ago

0.2.1

3 years ago