A retrospective on PokeAPI
Published: 2020-02-18 01:15:15

About seven years ago I created [pokeapi.co](https://pokeapi.co). This is the story of how I built it.

It is always a delight to hear people talk about PokeAPI and how they use it. Sometimes, I don't even mention I built it to those people. I just like seeing how much joy it brings them, and how much they learn from using it. It is a feeling I can't quite describe. I feel like the creation of the site involved a short amount of very intense effort that turned into my most successful thing ever. So it's not like I did anything nobody else could, I just did it first.

And to top it all off, it's about...Pokemon?!

![https://i.kym-cdn.com/entries/icons/original/000/027/475/Screen_Shot_2018-10-25_at_11.02.15_AM.png](https://i.kym-cdn.com/entries/icons/original/000/027/475/Screen_Shot_2018-10-25_at_11.02.15_AM.png)

I had graduated university in early 2013. At university I had built a few simple Pokemon battling simulators as I was learning to code. The way the Pokemon video games worked made a lot of sense to me, from a "programming" perspective. It's all about numbers and structured data. I was already a keen Pokemon fan (obviously) and at one point I was even **in the top 16 Pokemon trading card game players in the UK**. I had even taken the [Professor course](https://www.pokemon.com/us/play-pokemon/organize/become-a-professor/) and judged at competitions.

In 2013, APIs were just beginning to become valuable products, with startups like [Twilio](https://twilio.com) and [Stripe](https://stripe.com) being the new hotness of the early decade. After I graduated I moved to London to work with a [company](https://hubbub.org/) I had interned at the previous summer. The part of programming that captured my attention was the philosophy behind [REST APIs](https://www.martinfowler.com/articles/richardsonMaturityModel.html) but I didn't see many APIs following this pattern.

So I took the idea of a pure REST API, and then I took the data that was [scraped from the games](https://github.com/veekun/pokedex) and I built a REST API for it.

![https://i.imgur.com/9I9vBBL.png](https://i.imgur.com/9I9vBBL.png)

The project took me literally one weekend to complete. I sat in [this costa coffee shop](https://goo.gl/maps/m8a4jTAFg9XdMViW9) and bought about ten coffees over two days, stole their wifi, and wrote the entire project. That was all it took.

I created a twitter account for it and shared the project on hackernews and boom I [got 2,000 hits in less than a day](https://twitter.com/PokeAPI/status/402026263327412224).

## Depression

Let's jump into a side story quickly because I think it is important. I've struggled with mental health since around the time I built PokeAPI. In fact: the reason I was so focussed and hammered it out is because I was in a major depressive peroid and desperately needed some distraction. I had no friends in London, I was running out of money, and I no family there to help me.

I have to deal with mental health every day, and it's hard for me to understand how I produced something like PokeAPI when I was in one of the darkest periods of my mental health journey. But it is what it is, and for the record: I am managing my mental health very well now.

## PokeAPI v1

The original version was a debug-mode (yes, I left it in debug mode for about a year) [Django project](https://djangoproject.com) running [Tasty pie](https://django-tastypie.readthedocs.io/en/latest/) to expose the data through an HTTP API. It was really janky, it barely held together. I coded the frontend using very basic JavaScript knowledge (I didn't become a proper js developer for at least another five years) and some poor css.

But that didn't matter because [it became popular really fast](https://twitter.com/PokeAPI/status/411435695740575744). It even landed me my first real job, where I got to travel around the world and promote APIs. I was incredibly lucky and at the time I had no idea how I had pulled it all off.

## PokeAPI v2

Around 2015 the API had served roughly a million requests. I figured out this number by logging each hit in a database table for each month. I would then print out that table in csv format, copy & paste it into a spreadsheet, and then do some excel math to sum the values.

The site was still very janky, but at least I had turned off debug mode by this point. A developer called [zaneadix](https://github.com/zaneadix) came along and wanted to extend the API to support all the data in the veekun data set. I told them I was happy to let them contribute, and they did, incredibly so. This version was built on the same project but it used [Django REST Framework](https://www.django-rest-framework.org/) to provide the APIs.

We released v2 of the API around June 2015. The most contribution I did at this point was code review and bug fixing. V2 was a huge success, and I think we hit 25 million API requests about a year later.

## Moving towards static sites

So by 2018 I was barely involved in PokeAPI. There was occasional bug fixes and data updates, but a team of people were now managing it all for me, without me asking. [Alessandro](https://github.com/Naramsim) and [Tim](https://github.com/tdmalone) became, for all intents and purposes, the core developers of PokeAPI.

At this time I didn't contribute much, and I let the project run stale. I had more important things in life to deal with. I think it's okay to step back from stuff like this. But I could have been more open about it.

The team wanted to help me reduce the cost of the site. It was costing me around $40USD a month to run, purely because it was unoptimised and running on one giant machine on DigitalOcean.

Alessandro and Tim came up with a [tool](https://github.com/PokeAPI/ditto) that scraped the site, generated json files, and then hosted them on a server. The frontpage and docs became a [separate repo too](https://github.com/PokeAPI/pokeapi.co). This reduced the costs to less than $10USD a month. I maintained the cost for the domain, which was around $30USD a year.

## and now

So here we are, in 2020. The project is as strong as ever. We provide about 23 million API requests a month. That's an insane number. It is used for teaching API development all over the world. I see it mentioned in all sorts of blog posts, official documentation examples, and even [video game articles](https://www.polygon.com/2014/6/27/5850720/pokemon-battle-slack-vox).

[Here](https://geekeasier.com/pokeapi-the-free-pokemon-restful-api-for-developers/10053/) are [just](https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/) a few [more](https://www.twilio.com/blog/2014/11/build-your-own-pokedex-with-django-mms-and-pokeapi.html) articles [talking](https://dev.to/search?q=pokeapi) about it.

What more is there to do? It needs new data. It is about a game and a half behind the current series. There are something like 1000 Pokemon now.

It could benefit from some new features. But that would increase the costs. I don't think it will ever be a full time job, because the lawyers will come running at me.

Side note: I met some developers from the Pokemon company, and they love my API. They were keen to collaborate, and I tried to pursue something but it never went anywhere. Their loss, I guess.

**I am thinking of coming back to build new stuff**. I know it's an excellent resource for learning, and I want to tidy up the source code and use it to show off good open source practices, not just a good API resource for learning.

Also: people keep asking for a search feature. This would not be in the production version, to keep costs down. But it would be easy to add to the open source project. So maybe. Watch this space.

# Retrospective

What would I share about this story? Let's do an open retrospective to talk about the good and bad.

## Bad

What has gone wrong with this project?

* I should stop avoiding issues on the project and address them.

* I have not shown enough appreciation for those who helped to keep it alive when I was absent.

* Building things are really easy, working with people is hard.

* I used to treat every comment as personal criticism. I felt obligated to deal with all issues. That's not okay, and I shouldn't have to.


## Good

What has gone well?

* It only took a short amount of very intense effort to get this started. My advice to anyone who wants to build something: **you can do it! Just try!**

* It has inspired probably hundreds of people to program. I genuinely wonder how many people have been introduced to programming because of me and the rest of the team. That feeling is just bliss.

* It has helped me with my career. Some people say you should run a side project because it will show off what you can do. PokeAPI literally scored me multiple jobs, so that advice was true for me.

* I ended up discovering a framework (Django) that I love. I went on to help with it and ended up becoming a Django foundation member.


# Parting advice

PokeAPI didn't take me long to build, and it was only a short, intense burst of effort. But I was also very very lucky. Don't feel disheartened if you can't find a niche thing to build. But **do keep building stuff** - you never know where it might take you. There are hundreds of franchises or things out there that could do with an API; so build one!

![https://media1.giphy.com/media/jvVn70uHEOBqg/giphy.gif?cid=790b7611152dca43c20770d39b31ad34ea9d69ecd0b3a13a&rid=giphy.gif](https://media1.giphy.com/media/jvVn70uHEOBqg/giphy.gif?cid=790b7611152dca43c20770d39b31ad34ea9d69ecd0b3a13a&rid=giphy.gif)