A simple NodeJS Pokemon API.
I needed a simple pokedex API to play around so I made this one using the data provided in this repository https://github.com/fanzeyi/pokemon.json, collected from Bulbapedia.
This project, is a simple express application with a mongodb database. The database will hold the data, the json files, and express provides the corresponding routes.
- Docker
- Rename
.env-example
to.env
. - Clone the repository, then run
docker-compose up -d
- Access http://localhost:8080 - and explore the API.
Data
- http://localhost:8080/api/v1/pokemons - Lists all the pokemons.
- http://localhost:8080/api/v1/skills - All skills.
- http://localhost:8080/api/v1/items - All items.
- http://localhost:8080/api/v1/types - Lists types.
Pokemons sample:
[{
"_id": "5d317dc803514cb6d7ec78f5",
"id": 2,
"name": {
"english": "Ivysaur",
"japanese": "フシギソウ",
"chinese": "妙蛙草"
},
"type": [
"Grass",
"Poison"
],
"base": {
"HP": 60,
"Attack": 62,
"Defense": 63,
"Sp. Attack": 80,
"Sp. Defense": 80,
"Speed": 60
}
}]
Skills sample:
[{
"_id": "5d317dc803514cb6d7ec7fa9",
"accuracy": 100,
"category": "物理",
"cname": "手刀",
"ename": "Karate Chop",
"id": 2,
"jname": "からてチョップ",
"power": 50,
"pp": 25,
"type": "Fighting"
}]
Items sample:
[{
"_id": "5d317dc803514cb6d7ec7c23",
"name": {
"japanese": "マスターボール",
"english": "Master Ball",
"chinese": "大师球"
},
"id": 1
}]
Types sample:
[{
"_id": "5d317dc803514cb6d7ec8212",
"english": "Normal",
"chinese": "一般",
"japanese": "ノーマル"
}]
Media
- http://localhost:8080/api/v1/static/images/ - Base endpoint for images. You should append the pokemon number and name in the following format:
http://localhost:8080/api/v1/static/images/001Bulbasaur.png
. - http://localhost:8080/api/v1/static/thumbnails/ - Base endpoint for thumbnails. You should also append the pokemon number and name in the following format:
http://localhost:8080/api/v1/static/sprites/001Bulbasaur.png
. - http://localhost:8080/api/v1/static/sprites/ - Base endpoint for sprites. For sprites use pokemon number plus MS to get the full image url, like:
http://localhost:8080/api/v1/static/sprites/001MS.png
.
If you want to make any changes, a docker-compose.dev.yml basic file is provided, so you can attach chrome inspector to the docker container.
You can start it with:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Generic License.
https://bulbapedia.bulbagarden.net/wiki/Bulbapedia:Copyrights
Pokémon © 2002-2019 Pokémon. © 1995-2019 Nintendo/Creatures Inc./GAME FREAK inc. TM, ® and Pokémon character names are trademarks of Nintendo.
No copyright or trademark infringement is intended in using Pokémon content in this repository.