candymachinescraper
v1.1.12
Published
Get CandyMachineID from an v1 or v2 site, in a couple of seconds.
Downloads
19
Maintainers
Readme
What Does it do?
Grabs Candy Machine ID of any v1 or v2 candy machine websites.
Installation
npm i candymachinescraper --save
Example Usage
// Get Candy Id
const candyMachineScraper = require('candymachinescraper');
async function test() {
var url = 'https://mintsite.com';
await candyMachineScraper.getCandyId(pathToNodeModules, url, function(data) {
console.log(data);
// {
// state: 'success',
// data: '2QcWbuQTyfEDdHHhpgfoXfptkFipE5J1SqQiZxvZERuR'
// }
});
}
test();
For getting Metadata it uses the Blockchain API
// Get Candy Id & MetaData
const candyMachineScraper = require('candymachinescraper');
async function test() {
var url = 'https://mintsite.com';
await candyMachineScraper.getCandyId(pathToNodeModules, url, async function(data) {
console.log(data);
// {
// state: 'success',
// data: '2QcWbuQTyfEDdHHhpgfoXfptkFipE5J1SqQiZxvZERuR'
// }
var candyId = data.data;
await candyMachineScraper.getMetaData(apiKeyId, apiSecretKey, candyId, function(data) {
console.log(data);
// {
// state: 'success',
// data: (Candy Machine Metadata)
// }
});
});
}
test();
Sample Response:
// Success
{
state: 'success',
data: '2QcWbuQTyfEDdHHhpgfoXfptkFipE5J1SqQiZxvZERuR'
}
// Error
{
state: 'error',
data: "Didnt't find the ID :("
}