API Documentation

http://netrunnerdb.com can be queried via an http API.

All Sets

/api/sets/ returns data about all the sets in the database.

All Cards

/api/cards/ returns data about all the cards in the database.

One Set

/api/set/{code} returns card data about the cards in the set identified by code (core for Core Set, etc).

One Card

/api/card/{code} returns card data about the card identified by code (01001 for Noise, etc).

One Decklist

/api/decklist/{id} returns name, author and composition of the decklist identified by id (as found in decklist urls).

All Decklists for One Day

/api/decklists/by_date/{Y-m-d} returns all decklists published at the given date. Example: /api/decklists/by_date/2013-12-31.

All Decks of authenticated user

Deprecated, will be removed August 1st, 2014

/api/decks returns all decks created by the authenticated user.

OAuth2

The following API endpoints require a OAuth2 authentication. To get the required credentials and some additional info, contact me via email (alsciende (at) icloud.com) with a description of your application.

All Decks of authenticated user

/api_oauth2/decks returns all decks created by the authenticated user.

Save a deck for an authenticated user

/api_oauth2/save_deck/{id} saves the deck and returns its info. Parameters:

Publish a decklist for an authenticated user

/api_oauth2/publish_deck/{id} publishes a deck and returns the info of the decklist. Parameters:

Returned value

Data returned is in json format.
Set and card data include a "url" key giving the absolute url of the page that holds the data.
Card data include a "imagesrc" key giving the relative url of the image of the card.

jsonp

Optional GET parameter "jsonp" for script tags. Unavailable for OAuth2 endpoints.

Examples

/api/card/01001 returns data for Noise
/api/sets/?jsonp=parseSets returns data for all sets wrapped in a call to parseSets()

Encoding

The response is in ascii encoding. Non-ascii characters are encoded with \uXXXX with XXXX their hexadecimal unicode value.
To test your application, 3 cards are useful:

Caching

CORS

Localization

Add a parameter _locale=xx to get the results in xx locale.