API Version 1 Rollout

I managed to finish off the API version 1 today — which was mostly moving a huge amount of stuff around and fixing some minor issues. It’s probably got a few bugs — so let me know if you see wrong/dodgy stuff.

The general goal is that you’ll be able to take almost every page on the site and squeeze an “/api” between the host name and the existing path to get the API equivalent. This means you can meander around finding the data you want with the web version, and easily convert this into a URL to get the data from programmatically.

An example:
- (normal site version) http://datdota.com/drafts?default=true
- (api version) http://datdota.com/api/drafts?default=true

All the existing filters/parameters will work as is — and the API version should use the recently deployed caching layer for speedy responses (where possible). In some cases the data outputted isn’t immediately obvious what it’s represented — so you can mostly just compare to the normal site to work out what’s what. This is mostly unavoidable to keep the (already large) responses down in size.

This was just an initial stab at the API, so not every query type has been migrated to support API queries yet — you might see some ‘nulls’ lurking. Over the next while, expect some of the data layout and styles to change (without warning!). Here’s a list of the queries that are live (in addition to some underlying class objects):

noxville@axe:~$ cat URLMappings.groovy | grep API | cut -d ‘“‘ -f 2
/api/players/performances
/api/players/unique-heroes
/api/players/hero-combos
/api/players/teams
/api/players/recordswork
/api/casters
/api/items/averages
/api/drafts
/api/ratings

I’ll look to migrate a few more query-types over the next week or so (most of the annoying work is done however), and then move on the following, hopefully around the time of ESL Katowice (mid-Feb):

  • data backfilling / accuracy tests
  • fixing up teamfight data for internal review
  • laning data frontend page & filter work
  • factional advantage frontend page

Feel free to poke me with issues on the datdota discord.

~ Noxville

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.