I'm learning about writing APIs, and to do that I'm trying to write my own Pokemon GraphQL API. I want it to be able to serve an extensive collection of Pokemon sprites, and I'm trying to find a good way to go about it. I intend to use a MySQL database to hold all the data and serve as the backend for the API.
I know that the PokeAPI sprite Github repo has all the sprites nicely organized, but I'm having trouble understanding how I would use it in my API. At the top of their
I know that the PokeAPI sprite Github repo has all the sprites nicely organized, but I'm having trouble understanding how I would use it in my API. At the top of their
README.md
it says:To save load on PokéAPI, we host all the sprite images here. If you want to use all the sprites in your application, you can just download the entire contents directly.
- How should I store the sprites in my database? Should I store the images themselves, or could I instead store the URLs and have my API serve those? I'm trying to do this project for as low a cost as possible, so even if all the sprite images together are just a little over half a GB, I'm not sure whether I could host those (if you know any good options for that, let me know! A few dollars a month is fine with me, but not more than that).
- If I should store the images themselves, then it seems like I need to download the contents of the PokeAPI repo. If instead I can store the URLs, should I still download their repo as their
README.md
says? Or could I just store the URL to the appropriate sprite in the PokeAPI repo?