Authors: Paige Gorry
last-airbender-api.herokuapp.comlast-airbender-api.fly.dev
DEPRECATION: As of 1/15/23, the herokuapp url is deprecated. Please use the updated fly.io url.
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, Mongoose, node-html-parser
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 idGET /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 charactersGET /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!