# ink.resenha.book.getBook

> A book's page from Resenha's index: an edition's readers with their readings, everyone's reviews of it, and its other editions with theirs. By BookHive ID or ISBN-13, so a book BookHive's catalogue doesn't know has one page shared by its readers. Readers the caller blocks are left out. Requires the caller's service token.

- Kind: query
- Authority: book.resenha.ink
- Lexicon: 1
- Published by [resenha.ink](https://lexicon.garden/identity/did:plc:v7itjf4h3sb5zuegiiskctqb), not the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.book.getBook)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.book.getBook/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.book.getBook/analytics)

## Query (`ink.resenha.book.getBook`)

Type: query · GET

### Parameters (query string)

- `hiveId` (string): The book's BookHive ID. Not a stand-in beginning popfeed-, which names one reader's copy.
  - Constraints: maxLength: 64
- `isbn13` (string): The edition's ISBN-13, for a book without a BookHive ID.
  - Constraints: maxLength: 13

### Output (application/json)

- `book` (ref, required)
  - Reference: `#edition`
- `counts` (ref, required)
  - Reference: `#counts`
- `editions` (array, required): Other editions of the book, surest first.
  - `items` (ref)
    - Reference: `#otherEdition`
- `profiles` (array)
  - `items` (ref)
    - Reference: `ink.resenha.defs#profileView`
- `readings` (array, required): Up to a hundred: the caller's follows first, then by the latest change.
  - `items` (ref)
    - Reference: `#reading`
- `reviews` (array, required): Every review of this edition the index holds, newest first, each with the whole text and where its likes and comments live (popfeedReview or post) and how many.
  - `items` (ref)
    - Reference: `ink.resenha.defs#reviewView`

## #counts (`ink.resenha.book.getBook#counts`)

Type: object

### Properties

- `abandoned` (integer, required)
  - Constraints: minimum: 0
- `read` (integer, required)
  - Constraints: minimum: 0
- `reading` (integer, required)
  - Constraints: minimum: 0
- `wantToRead` (integer, required)
  - Constraints: minimum: 0

## #edition (`ink.resenha.book.getBook#edition`)

Type: object

One edition as the index knows it: BookHive's facts when it has the book, else what its readers' records say.

### Properties

- `authors` (string): Tab-separated, as BookHive stores them.
  - Constraints: maxLength: 1024
- `cover` (string · uri)
- `covers` (array)
  - Constraints: maxLength: 8
  - `items` (string · uri)
- `genres` (array)
  - Constraints: maxLength: 32
  - `items` (string)
    - Constraints: maxLength: 64
- `hiveId` (string)
  - Constraints: maxLength: 64
- `isbn13` (string)
  - Constraints: maxLength: 13
- `isbns` (array): Every ISBN-13 known for the edition, when there is more than one.
  - Constraints: maxLength: 16
  - `items` (string)
    - Constraints: maxLength: 13
- `language` (string)
  - Constraints: maxLength: 64
- `pages` (integer)
  - Constraints: minimum: 1
- `publisher` (string)
  - Constraints: maxLength: 256
- `title` (string)
  - Constraints: maxLength: 512
- `year` (integer)

## #otherEdition (`ink.resenha.book.getBook#otherEdition`)

Type: object

### Properties

- `book` (ref, required)
  - Reference: `#edition`
- `confidence` (string, required): sure: tied by BookHive's catalogue, a reader's link or Open Library's work. likely: the same title and first author after normalising, which a reader can confirm.
  - Constraints: knownValues: sure | likely
- `readers` (integer, required)
  - Constraints: minimum: 0
- `reviews` (array, required)
  - `items` (ref)
    - Reference: `ink.resenha.defs#reviewView`
- `sources` (array)
  - `items` (string)
    - Constraints: knownValues: catalogue | bookhive | reader | match | openlibrary | title

## #reading (`ink.resenha.book.getBook#reading`)

Type: object

One reader's record for the edition, with Resenha's likes and comments on it.

### Properties

- `actor` (string · did, required)
- `cid` (string · cid)
- `commentCount` (integer)
  - Constraints: minimum: 0
- `finishedAt` (string · datetime)
- `hasReview` (boolean)
- `likeCount` (integer)
  - Constraints: minimum: 0
- `progress` (ref)
  - Reference: `ink.resenha.defs#progressView`
- `source` (string, required)
  - Constraints: knownValues: bookhive | popfeed
- `stars` (integer)
  - Constraints: minimum: 1, maximum: 10
- `startedAt` (string · datetime)
- `status` (string)
  - Constraints: knownValues: wantToRead | reading | read | abandoned
- `uri` (string · at-uri, required): The reader's BookHive book record or Popfeed list item.
- `viewer` (ref)
  - Reference: `ink.resenha.defs#viewerState`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "counts": {
      "properties": {
        "abandoned": {
          "minimum": 0,
          "type": "integer"
        },
        "read": {
          "minimum": 0,
          "type": "integer"
        },
        "reading": {
          "minimum": 0,
          "type": "integer"
        },
        "wantToRead": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "wantToRead",
        "reading",
        "read",
        "abandoned"
      ],
      "type": "object"
    },
    "edition": {
      "description": "One edition as the index knows it: BookHive's facts when it has the book, else what its readers' records say.",
      "properties": {
        "authors": {
          "description": "Tab-separated, as BookHive stores them.",
          "maxLength": 1024,
          "type": "string"
        },
        "cover": {
          "format": "uri",
          "type": "string"
        },
        "covers": {
          "items": {
            "format": "uri",
            "type": "string"
          },
          "maxLength": 8,
          "type": "array"
        },
        "genres": {
          "items": {
            "maxLength": 64,
            "type": "string"
          },
          "maxLength": 32,
          "type": "array"
        },
        "hiveId": {
          "maxLength": 64,
          "type": "string"
        },
        "isbn13": {
          "maxLength": 13,
          "type": "string"
        },
        "isbns": {
          "description": "Every ISBN-13 known for the edition, when there is more than one.",
          "items": {
            "maxLength": 13,
            "type": "string"
          },
          "maxLength": 16,
          "type": "array"
        },
        "language": {
          "maxLength": 64,
          "type": "string"
        },
        "pages": {
          "minimum": 1,
          "type": "integer"
        },
        "publisher": {
          "maxLength": 256,
          "type": "string"
        },
        "title": {
          "maxLength": 512,
          "type": "string"
        },
        "year": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "A book's page from Resenha's index: an edition's readers with their readings, everyone's reviews of it, and its other editions with theirs. By BookHive ID or ISBN-13, so a book BookHive's catalogue doesn't know has one page shared by its readers. Readers the caller blocks are left out. Requires the caller's service token.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "book": {
              "ref": "#edition",
              "type": "ref"
            },
            "counts": {
              "ref": "#counts",
              "type": "ref"
            },
            "editions": {
              "description": "Other editions of the book, surest first.",
              "items": {
                "ref": "#otherEdition",
                "type": "ref"
              },
              "type": "array"
            },
            "profiles": {
              "items": {
                "ref": "ink.resenha.defs#profileView",
                "type": "ref"
              },
              "type": "array"
            },
            "readings": {
              "description": "Up to a hundred: the caller's follows first, then by the latest change.",
              "items": {
                "ref": "#reading",
                "type": "ref"
              },
              "type": "array"
            },
            "reviews": {
              "description": "Every review of this edition the index holds, newest first, each with the whole text and where its likes and comments live (popfeedReview or post) and how many.",
              "items": {
                "ref": "ink.resenha.defs#reviewView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "book",
            "counts",
            "readings",
            "reviews",
            "editions"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "hiveId": {
            "description": "The book's BookHive ID. Not a stand-in beginning popfeed-, which names one reader's copy.",
            "maxLength": 64,
            "type": "string"
          },
          "isbn13": {
            "description": "The edition's ISBN-13, for a book without a BookHive ID.",
            "maxLength": 13,
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    },
    "otherEdition": {
      "properties": {
        "book": {
          "ref": "#edition",
          "type": "ref"
        },
        "confidence": {
          "description": "sure: tied by BookHive's catalogue, a reader's link or Open Library's work. likely: the same title and first author after normalising, which a reader can confirm.",
          "knownValues": [
            "sure",
            "likely"
          ],
          "type": "string"
        },
        "readers": {
          "minimum": 0,
          "type": "integer"
        },
        "reviews": {
          "items": {
            "ref": "ink.resenha.defs#reviewView",
            "type": "ref"
          },
          "type": "array"
        },
        "sources": {
          "items": {
            "knownValues": [
              "catalogue",
              "bookhive",
              "reader",
              "match",
              "openlibrary",
              "title"
            ],
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "book",
        "confidence",
        "readers",
        "reviews"
      ],
      "type": "object"
    },
    "reading": {
      "description": "One reader's record for the edition, with Resenha's likes and comments on it.",
      "properties": {
        "actor": {
          "format": "did",
          "type": "string"
        },
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "commentCount": {
          "minimum": 0,
          "type": "integer"
        },
        "finishedAt": {
          "format": "datetime",
          "type": "string"
        },
        "hasReview": {
          "type": "boolean"
        },
        "likeCount": {
          "minimum": 0,
          "type": "integer"
        },
        "progress": {
          "ref": "ink.resenha.defs#progressView",
          "type": "ref"
        },
        "source": {
          "knownValues": [
            "bookhive",
            "popfeed"
          ],
          "type": "string"
        },
        "stars": {
          "maximum": 10,
          "minimum": 1,
          "type": "integer"
        },
        "startedAt": {
          "format": "datetime",
          "type": "string"
        },
        "status": {
          "knownValues": [
            "wantToRead",
            "reading",
            "read",
            "abandoned"
          ],
          "type": "string"
        },
        "uri": {
          "description": "The reader's BookHive book record or Popfeed list item.",
          "format": "at-uri",
          "type": "string"
        },
        "viewer": {
          "ref": "ink.resenha.defs#viewerState",
          "type": "ref"
        }
      },
      "required": [
        "uri",
        "actor",
        "source"
      ],
      "type": "object"
    }
  },
  "id": "ink.resenha.book.getBook",
  "lexicon": 1
}
```
