https://github.com/thenets/pokeapi-cache
PokeAPI-Cache for fast requests 🎮
https://github.com/thenets/pokeapi-cache
api docker golang
Last synced: 30 days ago
JSON representation
PokeAPI-Cache for fast requests 🎮
- Host: GitHub
- URL: https://github.com/thenets/pokeapi-cache
- Owner: thenets
- License: mit
- Created: 2020-09-20T13:23:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-20T14:26:34.000Z (over 5 years ago)
- Last Synced: 2025-03-29T10:34:51.455Z (about 1 year ago)
- Topics: api, docker, golang
- Language: Go
- Homepage: https://pokeapi-cache.herokuapp.com/
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PokeAPI Cache
PokeAPI-Cache is up to 4x faster than access PokeAPI directly.
## How to use
It's the same as PokeAPI official documentation:
- https://pokeapi.co/
You will need to change `pokeapi.co` to `pokeapi-cache.herokuapp.com`. Nothing more.
Examples:
- https://pokeapi-cache.herokuapp.com/api/v2/pokemon/pikachu
- https://pokeapi-cache.herokuapp.com/api/v2/move/34
## Benchmark
### PokeAPI
```python
import datetime as dt
import requests
def pokeapiBenchmark():
for i in range(500):
url = "https://pokeapi-cache.herokuapp.com/api/v2/move/%d" % (i+1)
r = requests.get(url)
t_before = dt.datetime.now()
pokeapiBenchmark()
t_after = dt.datetime.now()
print(t_after - t_before)
```
Result: `0:04:12.039194`
### PokeAPI-Cache
```python
import datetime as dt
import requests
def pokeapiBenchmark():
for i in range(500):
url = "https://pokeapi-cache.herokuapp.com/api/v2/move/%d" % (i+1)
r = requests.get(url)
t_before = dt.datetime.now()
pokeapiBenchmark()
t_after = dt.datetime.now()
print(t_after - t_before)
```
Result: `0:01:22.681270`
## Credits
Thanks for everyone from [PokeAPI](https://github.com/PokeAPI/pokeapi) community! 💖
## License
MIT