# api-iceandfire

> ## About

Latest version **0.1.0** (published 2016-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install api-iceandfire
pnpm add api-iceandfire
yarn add api-iceandfire
bun add api-iceandfire
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-02-13 |
| First published | 2016-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Alex Webb |
| Maintainers | alexwebb2 |

## Links

- npm: https://www.npmjs.com/package/api-iceandfire
- Repository: https://github.com/alexwebb2/node-api-iceandfire
- Homepage: https://github.com/alexwebb2/node-api-iceandfire#readme
- Issues: https://github.com/alexwebb2/node-api-iceandfire/issues
- npm.io page: https://npm.io/package/api-iceandfire

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.3.0
- [superagent](https://npm.io/package/superagent.md) ^1.7.2

## Recent versions

- 0.1.0 (latest) — 2016-02-13
- 0.0.1 — 2016-02-13

## README

# node-api-iceandfire

## About

Node module for interacting with [An API of Ice and Fire](https://anapioficeandfire.com/).

More information available on [Reddit](https://www.reddit.com/r/asoiaf/comments/45lt0o/spoilers_everything_introducing_an_api_of_ice_and/).

## 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

```js
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

---
_Source: https://npm.io/package/api-iceandfire · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
