A list of all public comic book character names in the Marvel universe, sourced from the API.
Total Characters: 1,252
Last Updated: Sunday, July 19th, 2015.
Data provided by Marvel. © 2015 Marvel
npm install marvel-characters [--g|--save]
var marvel = require('marvel-characters')
// random character
console.log(marvel())
//=> 'Iron Man'
// all characters
console.log(marvel.characters)
//=> ["3-D Man", "A-Bomb", ..., "Zuras", "Zzzax"]
Returns a random Marvel character name, like "Spider-Man"
.
The array of all character names.
The required JSON array.
You can also use the CLI here.
Usage:
marvel-characters [opt]
Options:
--help show help
--all list all characters
Example:
$ marvel-characters
Green Goblin
Clone & install:
git clone https://github.com/mattdesl/marvel-characters.git
cd marvel-characters
npm install
You will need a Marvel Developer account. Once you have API keys, copy them into a .marvel-charactersrc
file in the same directory. It should look like this, with your keys:
{
"privateKey": "egadg545151232d02ea0b9asdfasdfd5699a",
"publicKey": "badsg1cbadsggagafdh0"
}
Then use npm start
to scrape the new data.
MIT, see LICENSE.md for details.