https://github.com/giodelabarrera/pokedex-api
Pokédex REST API
https://github.com/giodelabarrera/pokedex-api
express node pokedex pokemon pokemon-api standardjs
Last synced: 3 months ago
JSON representation
Pokédex REST API
- Host: GitHub
- URL: https://github.com/giodelabarrera/pokedex-api
- Owner: giodelabarrera
- Created: 2020-07-18T17:22:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-03T00:55:07.000Z (almost 6 years ago)
- Last Synced: 2025-06-28T09:37:59.306Z (about 1 year ago)
- Topics: express, node, pokedex, pokemon, pokemon-api, standardjs
- Language: JavaScript
- Homepage:
- Size: 268 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Pokédex API
Pokédex REST API serving the characters of pokemon.
## Getting started
### Installation
```sh
npm i
```
### Run server
```sh
npm start
```
Now you can make requests to http://localhost:3030
#### Alternative port
You can start server on other ports with the environment variable:
```sh
PORT=3034 npm start
```
## Endpoints
### `GET /pokemon`
| Name | Type | Description | Default |
| -------- | ---------- | ------------------------------- | -------------- |
| `query` | `string` | Word to search (Number or Name) | |
| `types` | `string[]` | Types | |
| `sort` | `string` | Sort | highest_number | a_z | z_a) | lowest_number |
| `limit` | `number` | Number limit for results | 12 |
| `offset` | `number` | Results page index. | 0 |
**Example**
`/pokemon?query=char&types[]=Fire&sort=lowest_number&limit=12&offset=0`
```json
{
"total": 5,
"results": [
{
"id": 4,
"name": {
"english": "Charmander",
"japanese": "ヒトカゲ",
"chinese": "小火龙",
"french": "Salamèche"
},
"type": ["Fire"],
"base": {
"HP": 39,
"Attack": 52,
"Defense": 43,
"Sp. Attack": 60,
"Sp. Defense": 50,
"Speed": 65
}
}
]
}
```
### `GET /pokemon/{id or name}`
**Example**
`/pokemon/pikachu` or `/pokemon/25`
```json
{
"id": 25,
"name": {
"english": "Pikachu",
"japanese": "ピカチュウ",
"chinese": "皮卡丘",
"french": "Pikachu"
},
"type": ["Electric"],
"base": {
"HP": 35,
"Attack": 55,
"Defense": 40,
"Sp. Attack": 50,
"Sp. Defense": 50,
"Speed": 90
}
}
```
## License
MIT © Giorgio de la Barrera