# ink.resenha.discover.getBooks

> Ranked by how many readers did so in the window.

- Kind: query
- Authority: discover.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.discover.getBooks)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.discover.getBooks/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:v7itjf4h3sb5zuegiiskctqb/ink.resenha.discover.getBooks/analytics)

## Query (`ink.resenha.discover.getBooks`)

Type: query · GET

### Parameters (query string)

- `limit` (integer)
  - Constraints: minimum: 1, maximum: 100, default: 50
- `window` (string)
  - Constraints: default: "week", knownValues: week | month

### Output (application/json)

- `books` (array, required)
  - `items` (ref)
    - Reference: `#bookCount`

## #bookCount (`ink.resenha.discover.getBooks#bookCount`)

Type: object

### Properties

- `book` (ref, required)
  - Reference: `ink.resenha.defs#bookView`
- `finished` (integer)
  - Constraints: minimum: 0
- `readers` (integer, required): Readers who started, finished or reviewed it in the window.
  - Constraints: minimum: 0
- `reviewed` (integer)
  - Constraints: minimum: 0
- `started` (integer)
  - Constraints: minimum: 0

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "bookCount": {
      "properties": {
        "book": {
          "ref": "ink.resenha.defs#bookView",
          "type": "ref"
        },
        "finished": {
          "minimum": 0,
          "type": "integer"
        },
        "readers": {
          "description": "Readers who started, finished or reviewed it in the window.",
          "minimum": 0,
          "type": "integer"
        },
        "reviewed": {
          "minimum": 0,
          "type": "integer"
        },
        "started": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "book",
        "readers"
      ],
      "type": "object"
    },
    "main": {
      "description": "Ranked by how many readers did so in the window.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "books": {
              "items": {
                "ref": "#bookCount",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "books"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "limit": {
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "window": {
            "default": "week",
            "knownValues": [
              "week",
              "month"
            ],
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "description": "The books Resenha's readers started, finished or reviewed most lately.",
  "id": "ink.resenha.discover.getBooks",
  "lexicon": 1
}
```
