Marvel is an API wrapper for Marvel's Comics API
npm install marvel
var Marvel = require('marvel')
var marvel = new Marvel({ publicKey: "<pubKey>", privateKey: "<privateKey>"})
marvel.characters
.name("Hulk")
.get(function(err, resp) {
if (err) { console.log("Error: ", err) }
else { console.log(resp) }
})
This finds out the event id for "Civil War" and then returns 50 characters that were in the event (along with their thumbnail picture, if applicable)
var Marvel = require('marvel')
var marvel = new Marvel({ publicKey: "<pubKey>", privateKey: "<privateKey>"})
marvel.events
.name("civil war")
.get(function(err, res) {
if (err) { throw err }
var eventId = res[0].id
marvel.characters
.events(eventId)
.limit(50)
.get(function(err, res) {
if (err) { throw err }
res.forEach(function(chr) {
console.log(chr.name + " " + (!!chr.thumbnail ? (chr.thumbnail.path + "." + chr.thumbnail.extension) : ""))
})
})
})
This new version of the Marvel library tries to make it easier to form queries.
Searches for a character with an id of, character_id
.
Searches for the character named, name
.
Searches for characters whose name begins with name
.
Limits results to characters that have been modified after inputed date
(format is: 2014-06-10T16:12:58-0400).
Orders the returning JSON by the field, field
. If a minus sign (-) is in front of the field
, then it returns in descending order.
Options are: name, modified, -name, -modified
Returns results only after num
matches have occurred.
If two parameters are given, it returns num
results only after offset
records have been returned.
If only one parameter is given, it returns the first num
results.
Searches for a comic with an id of, comic_id
.
Return comics that only contain format, name
Options are: comic, magazine, trade paperback, hardcover, digest, graphic novel, digital comic, infinite comic
Return comics that only contain format type, type
Options are: comic, collection
Whether or not to exclude "variants" of the comic, e.g. alternate covers (true for yes, false for no)
Return comics within the time period specified in dateString
Options are: lastWeek, thisWeek, nextWeek, thisMonth
Return comics within the predefined range in date
with additional dates separated by commas
Searches for comics named, name
.
Searches for comics whose name begins with name
.
Limits results to comic series that started in the year num
Looks only for comics whose issue number match num
Filter by Diamond Code code
Filter by Digital ID, num
Filter by UPC code, code
Filter by ISBN code, code
Filter by EAN code, code
Filter by ISSN code, code
Includes only results which are available digitally if bool
is true.
Accepts a comma-separated list of IDs which match only comics in which those characters have appeared together
Accepts a comma-separated list of IDs which match only comics in which those creators have appeared together
Limits results to characters that have been modified after inputed date
(format is: 2014-06-10T16:12:58-0400).
Orders the returning JSON by the field, field
. If a minus sign (-) is in front of the field
, then it returns in descending order.
Options are: focDate, onsaleDate, title, issueNumber, modified, -focDate, -onsaleDate, -title, -issueNumber, -modified
Returns results only after num
matches have occurred.
If two parameters are given, it returns num
results only after offset
records have been returned.
If only one parameter is given, it returns the first num
results.
Searches for a creator with an id of, creator_id
.
Searches for creators with first name, name
.
Searches for creator with middle name, name
.
Searches for creator with last name, name
.
Searches for creator with suffix/honorific, name
.
Searches for creator's name that begins with str
.
Searches for creator's first name that begins with str
.
Searches for creator's middle name that begins with str
.
Searches for creator's last name that begins with str
.
Limits results to characters that have been modified after inputed date
(format is: 2014-06-10T16:12:58-0400).
Orders the returning JSON by the field, field
. If a minus sign (-) is in front of the field
, then it returns in descending order.
Options are: lastName, firstName, middleName, suffix, modified, -lastName, -firstName, -middleName, -suffix, -modified
Returns results only after num
matches have occurred.
If two parameters are given, it returns num
results only after offset
records have been returned.
If only one parameter is given, it returns the first num
results.
Searches for an event with an id of event_id
.
Searches for the event named, name
.
Searches for events whose name begins with name
.
Limits results to characters that have been modified after inputed date
(format is: 2014-06-10T16:12:58-0400).
Orders the returning JSON by the field, field
. If a minus sign (-) is in front of the field
, then it returns in descending order.
Options are: name, startDate, modified, -name, -startDate, -modified
Returns results only after num
matches have occurred.
If two parameters are given, it returns num
results only after offset
records have been returned.
If only one parameter is given, it returns the first num
results.
Searches for a series with an id of series_id
.
Searches for series named, name
.
Searches for series whose name begins with name
.
Limits results to comic series that started in the year num
Filter the series by publication frequency type.
Options are: collection, one shot, limited, ongoing
Return only series that contain one or more comics with the specified format
Options are: comic, magazine, trade paperback, hardcover, digest, graphic novel, digital comic, infinite comic
Limits results to characters that have been modified after inputed date
(format is: 2014-06-10T16:12:58-0400).
Orders the returning JSON by the field, field
. If a minus sign (-) is in front of the field
, then it returns in descending order.
Options are: title, modified, startYear, -title, -modified, -startYear
Returns results only after num
matches have occurred.
If two parameters are given, it returns num
results only after offset
records have been returned.
If only one parameter is given, it returns the first num
results.
Searches for a story with an id of story_id
.
Limits results to characters that have been modified after inputed date
(format is: 2014-06-10T16:12:58-0400).
Orders the returning JSON by the field str
. If a minus sign (-) is in front of the str
, then it orders in descending order.
Returns results only after num
matches have occurred.
If two parameters are given, it returns num
results only after offset
records have been returned.
If only one parameter is given, it returns the first num
results.
MIT
Shuan Wang ([email protected])