{"id":15594031,"url":"https://github.com/fiveisprime/marvel-api","last_synced_at":"2025-04-10T05:05:40.905Z","repository":{"id":13732836,"uuid":"16427147","full_name":"fiveisprime/marvel-api","owner":"fiveisprime","description":"Node.js wrapper for working with the official Marvel Comics API","archived":false,"fork":false,"pushed_at":"2024-02-07T21:59:42.000Z","size":123,"stargazers_count":101,"open_issues_count":3,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T05:05:30.139Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npm.im/marvel-api","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fiveisprime.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-01T02:52:13.000Z","updated_at":"2025-03-02T02:49:03.000Z","dependencies_parsed_at":"2024-06-19T17:53:42.302Z","dependency_job_id":null,"html_url":"https://github.com/fiveisprime/marvel-api","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiveisprime%2Fmarvel-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiveisprime%2Fmarvel-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiveisprime%2Fmarvel-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fiveisprime%2Fmarvel-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fiveisprime","download_url":"https://codeload.github.com/fiveisprime/marvel-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161273,"owners_count":21057555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T00:22:31.885Z","updated_at":"2025-04-10T05:05:40.879Z","avatar_url":"https://github.com/fiveisprime.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"marvel-api [![Build Status](https://travis-ci.org/fiveisprime/marvel-api.svg?branch=master)](https://travis-ci.org/fiveisprime/marvel-api) [![NPM version](https://badge.fury.io/js/marvel-api.svg)](http://badge.fury.io/js/marvel-api)\n==========\n\nNode.js wrapper for working with the official Marvel Comics API\n\n# Usage\n\nHead over to [developer.marvel.com](http://developer.marvel.com) and sign up/in\nto get your API keys. Install the module using [npm](https://npmjs.org) and\ninitialize an API client using the public and private API keys for your\naccount.\n\n```js\nvar api = require('marvel-api');\n\nvar marvel = api.createClient({\n  publicKey: 'my-public-key'\n, privateKey: 'my-private-key'\n});\n```\n\nAll methods return promises but also accept a callback.\n\n..use the promise...\n\n```js\nmarvel.characters.findAll()\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n..or use a callback.\n\n```js\nmarvel.characters.findAll(function(err, results) {\n  if (err) {\n    return console.error(err);\n  }\n\n  console.log(results);\n});\n```\n\n### Response Format\n\nThe response includes two properties, `data` which is the actual data returned\nfrom the request and `meta` which includes information about the result set\nsuch as the number of items retrieved, the total available items and the\ncurrent offset into the data. This allows some visibility into the data so that\nyou can make incremental requests to retrieve large datasets.\n\n```js\n{\n  data: [\n    {\n      id: 43495,\n      digitalId: 28150,\n      ...\n    },\n    {\n      id: 42566,\n      digitalId: 0,\n      ...\n    }\n  ],\n  meta: {\n    offset: 0,\n    limit: 20,\n    total: 2576,\n    count: 20\n  }\n}\n```\n\n### Example\n\nFind Spider-Man's ID then the first 20 comics he's been in.\n\n```js\nmarvel.characters.findByName('spider-man')\n  .then(function(res) {\n    console.log('Found character ID', res.data[0].id);\n    return marvel.characters.comics(res.data[0].id);\n  })\n  .then(function(res) {\n    console.log('found %s comics of %s total', res.meta.count, res.meta.total);\n    console.log(res.data);\n  })\n  .fail(console.error)\n  .done();\n```\n\n# API\n\nthe API is broken into pieces based on the data that will be worked with. Each\nobject has methods for interacting with the specific bits of data for that\nobject with some reasonable defaults.\n\n## Characters\n\n###  #findAll\n\nFetch all characters within range. Accepts a limit and/or offset. Offset defaults\nto 0; limit defaults to 20 with a maximum of 100.\n\nFetch the first 20 characters.\n\n```js\nmarvel.characters.findAll()\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch the first 5 characters.\n\n```js\nmarvel.characters.findAll(5)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch 3 characters starting at index 30.\n\n```js\nmarvel.characters.findAll(3, 30)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #findByName\n\nFetch characters (returns an array) with the specified name.\n\n```js\nmarvel.characters.findByName('spider-man')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #findNameStartsWith\n\nFetch characters with names that start with the specified string.\n\n```js\nmarvel.characters.findNameStartsWith('spi')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n###  #find\n\nFetch a single character with the specified ID.\n\n```js\nmarvel.characters.find('1011227')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #comics\n\nFetch a list of comics filtered by character ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.characters.comics('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #events\n\nFetch a list of events filtered by character ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.characters.events('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #stories\n\nFetch stories filtered by character ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.characters.stories('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n## Creators\n\n###  #findAll\n\nFetch all creators within range. Accepts a limit and/or offset. Offset defaults\nto 0; limit defaults to 20 with a maximum of 100.\n\nFetch the first 20 creators.\n\n```js\nmarvel.creators.findAll()\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch the first 5 creators.\n\n```js\nmarvel.creators.findAll(5)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch 3 creators starting at index 30.\n\n```js\nmarvel.creators.findAll(3, 30)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #findByName\n\nFetch creators (returns an array) with the specified name. A first name, middle\nname (option) and last name (option) can be specified.\n\nFetch by first name only.\n\n```js\nmarvel.creators.findByName('austin')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch by first and middle name only.\n\n```js\nmarvel.creators.findByName('Goran', 'Sudzuka')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch by first, middle, and last name.\n\n```js\nmarvel.creators.findByName('Pat', 'Lee', '(X-Men/FF)')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n###  #find\n\nFetch a single creator with the specified ID.\n\n```js\nmarvel.creators.find('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #comics\n\nFetch a list of comics filtered by creator ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.creators.comics('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #stories\n\nFetch a list of creators filtered by story ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.creators.stories('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n## Comics\n\n###  #findAll\n\nFetch all comics within range. Accepts a limit and/or offset. Offset defaults\nto 0; limit defaults to 20 with a maximum of 100.\n\nFetch the first 20 comics.\n\n```js\nmarvel.comics.findAll()\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch the first 5 comics.\n\n```js\nmarvel.comics.findAll(5)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch 3 comics starting at index 30.\n\n```js\nmarvel.comics.findAll(3, 30)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n###  #find\n\nFetch a single comic with the specified ID.\n\n```js\nmarvel.comics.find('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #characters\n\nFetch a list of comics filtered by character ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.comics.characters('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #stories\n\nFetch a list of comics filtered by story ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.comics.stories('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n## Events\n\n###  #findAll\n\nFetch all events within range. Accepts a limit and/or offset. Offset defaults\nto 0; limit defaults to 20 with a maximum of 100.\n\nFetch the first 20 events.\n\n```js\nmarvel.events.findAll()\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch the first 5 events.\n\n```js\nmarvel.events.findAll(5)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch 3 events starting at index 30.\n\n```js\nmarvel.events.findAll(3, 30)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #findByName\n\nFetch events (returns an array) with the specified name.\n\n```js\nmarvel.events.findByName('spider-man')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n###  #find\n\nFetch a single event with the specified ID.\n\n```js\nmarvel.events.find('1011227')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #comics\n\nFetch a list of comics filtered by event ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.events.comics('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #characters\n\nFetch a list of characters filtered by event ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.events.characters('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #stories\n\nFetch stories filtered by event ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.events.stories('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n## Series\n\n###  #findAll\n\nFetch all series within range. Accepts a limit and/or offset. Offset defaults\nto 0; limit defaults to 20 with a maximum of 100.\n\nFetch the first 20 series.\n\n```js\nmarvel.series.findAll()\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch the first 5 series.\n\n```js\nmarvel.series.findAll(5)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch 3 series starting at index 30.\n\n```js\nmarvel.series.findAll(3, 30)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #findByTitle\n\nFetch series (returns an array) with the specified title.\n\n```js\nmarvel.series.findByTitle('spider-man')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n###  #find\n\nFetch a single series with the specified ID.\n\n```js\nmarvel.series.find('1011227')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #comics\n\nFetch a list of comics filtered by series ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.series.comics('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #events\n\nFetch a list of events filtered by series ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.series.events('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #stories\n\nFetch stories filtered by series ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.series.stories('1011334')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n## Stories\n\n###  #findAll\n\nFetch all stories within range. Accepts a limit and/or offset. Offset defaults\nto 0; limit defaults to 20 with a maximum of 100.\n\nFetch the first 20 stories.\n\n```js\nmarvel.stories.findAll()\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch the first 5 stories.\n\n```js\nmarvel.stories.findAll(5)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\nFetch 3 stories starting at index 30.\n\n```js\nmarvel.stories.findAll(3, 30)\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n###  #find\n\nFetch a single comic with the specified ID.\n\n```js\nmarvel.stories.find('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #characters\n\nFetch a list of stories filtered by character ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.stories.characters('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n### #characters\n\nFetch a list of stories filtered by character ID.\n\nOptionally accepts a limit [20] and an offset [0].\n\n```js\nmarvel.stories.characters('4110')\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n## #query\n\nFetch a list of any kind of items by query.\n\n```js\nmarvel.query('comics', {title: 'Uncanny X-MEN', issueNumber: 188})\n  .then(console.log)\n  .fail(console.error)\n  .done();\n```\n\n# License\n\nCopyright (c) 2014, Matt Hernandez \u003cmatt@modulus.io\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiveisprime%2Fmarvel-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiveisprime%2Fmarvel-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiveisprime%2Fmarvel-api/lists"}