Skip to content
Joakim Skoog edited this page Jan 24, 2024 · 1 revision
Name Type Description
url string The hypermedia URL of this resource
name string The name of this book
isbn string The International Standard Book Number (ISBN-13) that uniquely identifies this book.
authors array of strings An array of names of the authors that wrote this book.
numberOfPages integer The number of pages in this book.
publiser string The company that published this book.
country string The country that this book was published in
mediaType string The type of media this book was released in.
released date The date (ISO 8601) when this book was released.
characters array of strings An array of Character resource URLs that has been in this book.
povCharacters array of strings An array of Character resource URLs that has had a POV-chapter in this book.

List all books

Request

$ curl "https://www.anapioficeandfire.com/api/books"

Response

[
    {
        "authors": [
            "George R. R. Martin"
        ],
        "characters": [
            "https://www.anapioficeandfire.com/api/characters/2"
        ],
        "country": "United States",
        "isbn": "978-0553103540",
        "mediaType": "Hardcover",
        "name": "A Game of Thrones",
        "numberOfPages": 694,
        "povCharacters": [
            "https://www.anapioficeandfire.com/api/characters/148"
        ],
        "publisher": "Bantam Books",
        "released": "1996-08-01T00:00:00",
        "url": "https://www.anapioficeandfire.com/api/books/1"
    },
    {
        "authors": [
            "George R. R. Martin"
        ],
        "characters": [
            "https://www.anapioficeandfire.com/api/characters/2"
        ],
        "country": "United States",
        "isbn": "978-0553108033",
        "mediaType": "Hardcover",
        "name": "A Clash of Kings",
        "numberOfPages": 768,
        "povCharacters": [
            "https://www.anapioficeandfire.com/api/characters/148"
        ],
        "publisher": "Bantam Books",
        "released": "1999-02-02T00:00:00",
        "url": "https://www.anapioficeandfire.com/api/books/2"
    }
]

Filtering books

You can also include filter parameters in your request to the books endpoint by including parameters in the query string.

Parameter Type Result
name string Books with the given name are included in the response
fromReleaseDate date Books that were released after, or on, the given date are included in the response
toReleaseDate date Books that were released before, or on, the given date are included in the response

Get specific book

Request

$ curl "https://www.anapioficeandfire.com/api/books/1"

Response

{
    "authors": [
        "George R. R. Martin"
    ],
    "characters": [
        "https://www.anapioficeandfire.com/api/characters/2"
    ],
    "country": "United States",
    "isbn": "978-0553103540",
    "mediaType": "Hardcover",
    "name": "A Game of Thrones",
    "numberOfPages": 694,
    "povCharacters": [
        "https://www.anapioficeandfire.com/api/characters/148"
    ],
    "publisher": "Bantam Books",
    "released": "1996-08-01T00:00:00",
    "url": "https://www.anapioficeandfire.com/api/books/1"
}
Clone this wiki locally