# com.livtet.listShelvesWithBooks

> List shelf records, each hydrated with a preview of the books on it. At most `booksPerShelf` books are returned per shelf; read a full shelf with `listBooksOnShelf`. Answers are cut at a fixed deadline rather than holding the request open, so a shelf under load may come back with fewer books than asked for.

- Kind: query
- Authority: livtet.com
- Lexicon: 1
- Published by [biblio.livtet.com](https://lexicon.garden/identity/did:plc:e2x3ihw2ntxt7pcgzmtu3abi), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/com.livtet.listShelvesWithBooks)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/com.livtet.listShelvesWithBooks/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e2x3ihw2ntxt7pcgzmtu3abi/com.livtet.listShelvesWithBooks/analytics)

## Query (`com.livtet.listShelvesWithBooks`)

Type: query · GET

### Parameters (query string)

- `booksPerShelf` (integer): Maximum number of books to hydrate per shelf. This query is a preview: `listBooksOnShelf` is the complete, paginated listing for one shelf.
  - Constraints: minimum: 1, maximum: 100, default: 25
- `cursor` (string): Opaque pagination cursor.
- `did` (string · did): Scope the read to one account's shelves. Omitted, the read is network-wide across every account.
- `limit` (integer): Maximum number of shelves to return.
  - Constraints: minimum: 1, maximum: 100, default: 50

### Output (application/json)

- `cursor` (string)
- `shelves` (array, required)
  - `items` (ref)
    - Reference: `com.livtet.defs#shelfWithBooksView`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "type": "string"
            },
            "shelves": {
              "items": {
                "ref": "com.livtet.defs#shelfWithBooksView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "shelves"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "booksPerShelf": {
            "default": 25,
            "description": "Maximum number of books to hydrate per shelf. This query is a preview: `listBooksOnShelf` is the complete, paginated listing for one shelf.",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "cursor": {
            "description": "Opaque pagination cursor.",
            "type": "string"
          },
          "did": {
            "description": "Scope the read to one account's shelves. Omitted, the read is network-wide across every account.",
            "format": "did",
            "type": "string"
          },
          "limit": {
            "default": 50,
            "description": "Maximum number of shelves to return.",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "description": "List shelf records, each hydrated with a preview of the books on it. At most `booksPerShelf` books are returned per shelf; read a full shelf with `listBooksOnShelf`. Answers are cut at a fixed deadline rather than holding the request open, so a shelf under load may come back with fewer books than asked for.",
  "id": "com.livtet.listShelvesWithBooks",
  "lexicon": 1
}
```
