Skip to content

Instantly share code, notes, and snippets.

@leereilly
Created January 19, 2016 07:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leereilly/cfa27e6b672f4c1a8a6f to your computer and use it in GitHub Desktop.
Save leereilly/cfa27e6b672f4c1a8a6f to your computer and use it in GitHub Desktop.
Law Breakin' APIs

via https://twitter.com/romzr/status/689309894034456577:

what sort of APIs would be most useful? Player/matches stats, other stuff?

Basic API endpoints for players, weapons, factions, characters, and leaderboards would be a great starting point - useful for building out fun dashboards, profiles, dynamic images, etc. Endpoints for matches, maps, gamemodes, etc. getting into the real gameplay data would be useful for more challenging neckbeardy stuff. I noted a few example endpoints and use cases below.

Any example of game APIs u like?

I don't have any examples for games APIs that I play && like && use, but Riot Games' API and Battle.net Community APIs (WoW, Starcraft, Diablo) look great and are well-documented. If it doesn't have great documentation, it's not a great API IMHO.

Game-specific APIs that I use / used to use:


Example Endpoints / Use Cases

Just an idea for some API endpoints in LawBreakers (behind auth, rate-limiting, pagination, etc) that'd be useful in helping the community build #allTheThings.

Users

What's this player's kill/death ratio? How many games have they played? What's their experience level? How many kills with an Aerator have they logged? What's the most common cause of death. What's their preffered game mode on a Saturday night? Have I ever played them? What are our all time vs. stats? Next time I play them, which character / weapons cause them the most grief? What days/times do they normally play? A/S/L? This is where the request kicks off.

$ curl https://api.lawbreakers.com/users/leereilly

{
  "id": 1,
  "login": "leereilly",
  "avatar_url": "https://cdn.lawbreakers.com/images/users/leereilly.png",
  "kills": 1337,
  "deaths": 37,
  "weapons_url": "https://api.lawbreakers.com/users/leereilly/weapons",
  "teams_url": "https://api.lawbreakers.com/users/leereilly/teams",
  "game_modes_url": "https://api.lawbreakers.com/users/leereilly/game_modes",
  "characters_url": "https://api.lawbreakers.com/users/leereilly/characters",
  "foo": "bar",
  "etc": "etc",
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z"
}

Maps

How many games have been played on this map? Wins by faction by game mode? Getting into neckbeard territory here, but perhaps total kills/deaths logged at particular x,y,x coordinates :neckbeard:

$ curl https://api.lawbreakers.com/maps/grandview

Weapons

$ curl https://api.lawbreakers.com/weapons/aerator

Characters

$ curl https://api.lawbreakers.com/characters/breacher

Companies

$ curl https://api.lawbreakers.com/companies/bellizi

Factions

curl https://api.lawbreakers.com/factions/valkyries

Teams

Not really sure what this entity's called. Goodies vs. Baddies? Breakers vs. Law?

curl https://api.lawbreakers.com/teams/breakers

Achievements

List all of the achievements

curl https://api.lawbreakers.com/achievements

Game Modes

$ curl https://api.lawbreakers.com/game_modes/overcharge

Badges

List all the forum badges (assuming game ID is linked to forum ID).

Leaderboards

OK I'm getting tired now and now realize I won't have time to actually fin:zzz:

@bkp-romain
Copy link

Awesome! Thanks! We're definitely talking about that sort of public APIs internally :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment