Giter VIP home page Giter VIP logo

superheros-api's Introduction

Superhero API

N|Solid

Welcome to this incredible superhero API!

This is an API that uses Marvel´s API to get a lot of data from all Marvel´s superheroes and then apply some logic so the front-end gets and uses only the info they need.

The API allows you to:

  • Get all the information you need about any superhero, like name, description, image and details.
  • Search for a superhero by name.
  • Search for all superheroes (it is arranged alphabetically and paged, you can handle the limit up to 50 per page and you can define the offset).
  • Post, Get, Put (modify) and Delete your favorites superheroes from a personal favorite list.

New Features!

  • Now you can get only the ID´s of your favorite superheroes list, or you can get the full data that front-end needs of the favorite superheroes list, depending on your needs.

This is a welcome message from the developer of this API:

I really hope you enjoy using this amazing API and I would love for you to tell me
what projects you are working on. Have fun!

Get Started

This API requires Node.js to run. This API uses MongoDB Atlas, so the database is on the cloud.

Clone the repository and then start the server with:

$ npm run dev

Please take a look at the dependencies that this API uses.

Tech

Superhero API uses:

  • Body-Parser - Node.js body parsing middleware.
  • Express - fast node.js network app framework [@tjholowaychuk]
  • lodash - JavaScript utility library
  • Mongoose - HTML to Markdown converter
  • MongoDB Atlas - Cloud-hosted MongoDB service
  • Morgan - HTTP request logger middleware for node.js
  • node.js - for the backend
  • node-fetch - module that brings Fetch API to Node.js
  • underscore - provides functional programming helpers

And of course Superhero API itself is open source with a public repository on GitHub.

How to use it?

For you to use this API you need to now the routes. This are the main routes you may want to use. (We will abbreviate Superhero as SH)

Action Route
Get first 20 SH http://localhost:3000/api/characters
Get list of SH setting limit and offset (*1) http://localhost:3000/api/characters/:limit/:offset
Search by name http://localhost:3000/api/characters/:name
Get user´s full favorite list(*2) http://localhost:3000/api/favorites/full-list/:dni]
Get user´s favorites ID´s list http://localhost:3000/api/favorites/:dni
Post user´s favorites http://localhost:3000/api/favorites/:dni
Modify (Put) user´s favorites http://localhost:3000/api/favorites/:dni
Delete user´s favorites http://localhost:3000/api/favorites/:dni

(*1) Limit: number of SH per page (max 50). Offset: from wich number of SH (there are over 1400 SH). Remember that /: means a parameter is ment to be used. For example: http://localhost:3000/api/characters/Hulk will get the Hulk data

(*2) All the favorites request uses DNI (National identity document) as the identifier of the user.

Some examples

Searching for Hulk:

image

Getting Superheroes List using limit 50 and setting offset to 1200:

image

Getting user´s favorite full Data:

image

POST a new user´s Favorite List

image

License

MIT

Free Software, Hell Yeah!

superheros-api's People

Contributors

arganarazalvaro avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.