A dynamic web application that interfaces with the Marvel Comics API to display rich character, comic, series, story, and event data from the Marvel Universe—featured through Gambit and other favorite characters.
Project Overview Features Tech Stack Setup & Installation Usage Marvel API Details Environment Variables Attribution & Terms Credits
This project provides a responsive web interface to explore the Marvel universe using live data from the Marvel Comics API. The site highlights Gambit as a default character and allows users to view comics, series, stories, events, and more, all dynamically populated through JavaScript fetch requests.
Current features include loading Gambit on page load and his corresponding Series and Events. Later hopes to add a search and display for Marvel characters, comics, series, stories, and events Modular codebase with ES Modules, environment-based configuration, and clean project structure Dynamic content population without page reloads Image display with variant handling (portrait, standard, landscape, etc.) Attribution and Marvel-compliant linking
Frontend: HTML, CSS, JavaScript (ES Modules) Backend: Node.js, Express APIs: Marvel Comics API Other: dotenv for environment variables, md5 for request signing
node --env-file-if-exists=.env --watch server.js <--to replace nodemon and dotenv
Clone the repository:
git clone https://github.com/YourUsername/marvel-api-project.git
cd marvel-api-project
Install dependencies:
npm install
Set up your environment variables:
Copy .env.example to .env and add your Marvel public and private API keys:
PUBLIC_KEY=yourPublicKey
PRIVATE_KEY=yourPrivateKey
Start the server:
npm start
Open the app:
Visit http://localhost:PORT in your browser.
The landing page displays Gambit's info by default.
Use the navigation bar to explore series, events.
Click any item to view detailed information and images.
All data is fetched live from the Marvel API.
API Endpoint: https://gateway.marvel.com/v1/public/
All requests require apikey, ts (timestamp), and hash (md5 of ts + privateKey + publicKey) parameters.
Entity Types: Characters, Comics, Series, Stories, Events, Creators
Result Structure: All responses follow a common structure:
{
"code": 200,
"status": "Ok",
"data": {
"offset": 0,
"limit": 20,
"total": 30920,
"count": 20,
"results": [ ... ]
}
}
Images are built using a base path, variant (e.g. portrait_xlarge), and extension (e.g. .jpg). See Image Guide for details.
Variable | Purpose
PUBLIC_KEY | Marvel API public key
PRIVATE_KEY | Marvel API private key
PORT | Port for local server (optional)
"Data provided by Marvel. © 2014 Marvel" This must appear on every page displaying Marvel data.
If you display info beyond a title and thumbnail, you must link back to the corresponding Marvel.com URL provided in each API result.
Most users are limited to 3000 API calls/day. Cache API results where appropriate.
This app is for educational/non-commercial purposes only. No monetization, no advertising, no in-app purchases per Marvel API Terms of Use Do not expose your private API key in client-side code or public repos.
- Built by Stephen Lewis of Lewis Labs
- Thank you to both my mentors:
- Josiah Cornelius
- EJ Mason
Powered by the Marvel Comics API
Questions or feedback? Feel free to email me! st.rayis1085@yahoo.com