I recently blogged about how I built PokeAPI, a very popular open source API. A lot of new developers often encounter this early on in their career.
I want to give people a chance to ask me questions about it, or about running open source projects, or programming in python/django.
Top comments (14)
What is something you wish more people knew about the interaction between mental health challenges and creating/maintaining a project like this?
Well, I think that if I had been more experienced with my mental health, then I would have noticed my manic obsessive tendency to build the original project and I might have stopped myself, thus never having actually built PokeAPI. So it's a bit of a double edged sword - I created PokeAPI in part to avoid the issues with my deteriorating mental health.
I would say this: mental health affects people in a lot of different ways, and it's hard to deal with it. It takes a lot of time to reach some plateau of normalcy, let alone being properly happy. If working on a project for days and days gives you focus and happiness, then do it, but don't let it consume you. Don't ignore the pain you're feeling.
just read the article. it was inspiring. may i know the PokeAPI current servers specifications that manages to handles those 25 milions requests permonth ?
It's all cached data on firebase. We cache the results for 24 hours, and the API is hit enough that a large majority of the requests are just returning the cached result!
Is it expensive for this amount of requests using Firebase?
We cache all the api results, as they never change we can do that. So we only pay for functions that run - i.e. - the first time a function runs to return data, after that it is a cached result. So around $10USD a month.
I was totally amazed to see the volume its handling currently! Great work!
I would like to know what measures you usually take to stop abuse or any sort of DDoS attacks as the API seems to be public.
Cloudflare provides a free tier that blocks a tonne of malicious traffic for us. I guess there is not much to exploit so we're quite lucky when it comes to DDOSing, it's almost always innocent young developers accidentally spamming the server.
Thanks for the details. Do you have any recommendations on protecting a public api from DDoS attacks? I haven't found a direct way with Cloud Flare to protect a REST API, where as I see they have good details for protecting a website though.
Set your DNS up with Cloudflare, it'll deal with 90% of issues. You can also set up rate limiting in your project. We used to do rate limiting by IP address.
Fascinating. Who are biggest users of this Pokemon APIs? What are some of the applications that they build on top of it? Which application do you like most?
I believe nearly all of the users are students, at least the largest majority. Quite a few simple services like pokedex.org runs off the API too.
How to create Apk of python code
What you're probably after is how to package a python program, this is a good guide: packaging.python.org/