Authors: Paige Gorry
last-airbender-api.herokuapp.com
This is an open-source API that provides character information from Avatar: The Last Airbender. This information is publicly sourced; I do not claim to own.
Node.js, MongoDB, Express, Jest, SuperTest, nodemon, dotenv, Mongoose, morgan, SuperAgent, node-html-parser, express-ga-middleware
All routes are GET routes
- GET /api/v1/characters - get all characters (default 20 per page / 497 total characters)
- GET /api/v1/characters?perPage=NUMBER&page=NUMBER - pagination now available!
- pagination is also available on other endpoints below
- example: GET /api/v1/characters?perPage=10&page=5
- GET /api/v1/characters/CHARACTER_ID - get character by id
- GET /api/v1/characters?affiliation=NATION_NAME - get characters with a specific affiliation
- choices: "Fire Nation", "Water Tribe", "Earth Kingdom", "Air Nomads", "Team Avatar", and more!
- example: GET /api/v1/characters?affiliation=Fire+Nation
- GET /api/v1/characters?enemies=CHARACTER_NAME - get characters that are enemies of a specific character
- example: GET /api/v1/characters?enemies=Aang
- GET /api/v1/characters?allies=CHARACTER_NAME - get characters who are allies of a specific character
- example: GET /api/v1/characters?allies=Aang
- GET /api/v1/characters?name=CHARACTER_NAME - get characters whose name matches a string
- example: GET /api/v1/characters?name=Aang
- GET /api/v1/characters/random - get one random character
- example: GET /api/v1/characters/random
- GET /api/v1/characters/random?count=NUMBER - get a number of random characters
- GET /api/v1/characters/avatar - get all avatars
- example: GET /api/v1/characters/avatar
Any error in query parameter values will likely respond with an empty array []
as a response. Double-check the parameters and ask for help if you think something isn't working properly.
I welcome any and all contributions! Feel free to submit a Pull Request with your changes to make this a better API for everyone!
-
Clone and download GitHub repo
-
Install dependencies:
npm i
-
Run scripts:
npm run lint
npm run pretest
npm run test
npm run test:watch
npm run start
(start node server)
npm run start:watch
(start nodemon server)
npm run seed
(seed database)
npm run drop
(drop MongoDB)
npm run db-load-all
(drop db and load seed data from scratch)
Standard MIT
Thank you to Kate Dameron for inspiring me to create my own API!