No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore Initial commit Feb 13, 2016
LICENSE
README.md v0.0.1 Feb 13, 2016
index.js Added API version header for v1 Feb 13, 2016
package.json

README.md

node-api-iceandfire

About

Node module for interacting with An API of Ice and Fire.

More information available on Reddit.

Installation

npm install --save api-iceandfire

require('api-iceandfire')

Methods

All methods return promises for a JSON object.

  • get(type, index)
  • getBook(index)
  • getCharacter(index)
  • getHouse(index)

Conforms to data caching guidelines via etag method.

Example

var iaf = require('api-iceandfire')

iaf.getBook(1).then(book => console.dir(book))

/*
{ url: 'http://www.anapioficeandfire.com/api/books/1',
  name: 'A Game of Thrones',
  isbn: '978-0553103540',
  authors: [ 'George R. R. Martin' ],
  numberOfPages: 694,
  publisher: 'Bantam Books',
  country: 'United States',
  mediaType: 'Hardcover',
  released: '1996-08-01T00:00:00',
  characters:
   [ 'http://www.anapioficeandfire.com/api/characters/2',
     'http://www.anapioficeandfire.com/api/characters/12',
     'http://www.anapioficeandfire.com/api/characters/13',
	 ...
*/

TODO

  • API versioning support
  • getAllX methods