marvel-api-hash-generator
v1.0.3
Published
In this project we take need hash to work in Marvel API.
Downloads
14
Readme
Marvel API Hash generator
In this project we take need hash to work in Marvel API.
You need
- Go to Marvel API Getting Started
- Register in Marvel API.
- Go to My Develop Account section: Link
- Take public and private keys
- Create script file and add this content to take hash value and try in Characters Request
const getApiHash = require('marvel-api-hash-generator').getApiHash;
const timeStamp = 1;
const privateKey = 'privateKeyValue';
const publicKey = 'publicVale';
const hashValue = getApiHash(timeStamp, privateKey, publicKey);
const requestConstantCharacters = 'https://gateway.marvel.com/v1/public/characters?';
const exampleUrl = `${requestConstantCharacters}ts=${timeStamp}&apikey=${publicKey}&hash=${hashValue}`;
// https://gateway.marvel.com/v1/public/characters?ts=1&apikey=<public-key>&hash=09fe991c34996e64c0424e446f27c9f0
console.log(exampleUrl);