> ## Documentation Index
> Fetch the complete documentation index at: https://galejames.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a specific book

> Retrieves detailed information about a specific book.

## v2 changes

- **(new)**: Returns `hitCount` field.
- The `hitCount` increments each time a buyer retrieves the book via `GET /v2/books/{bookId}`. Requests authenticated with publisher credentials do not increment the count.




## OpenAPI

````yaml GET /books/{bookId}
openapi: 3.0.3
info:
  title: BookHub Publisher API
  description: >
    BookHub's Publisher API enables programmatic management of book inventory on
    the BookHub marketplace. 

    This API uses path-based versioning (v2) and requires authentication via
    JWTs.


    > The interactive "Try it" playground is backed by a mock server: requests
    return documented example responses and don't persist. Enter any value in
    the Authorization field to try a request; for write endpoints, fill the
    required fields shown.
  version: 2.0.1
  contact:
    name: BookHub API Support
    email: api-support@bookhub.com
    url: https://docs.bookhub.com
servers:
  - url: https://bookhub-mock.onrender.com
    description: >-
      Interactive mock — returns live example responses (no real data or
      persistence)
  - url: https://api.bookhub.com/api/v2
    description: Production server - Version 2
  - url: https://api.bookhub.com/api/v1
    description: Production server - Version 1 (legacy)
security:
  - BearerAuth: []
tags:
  - name: Books
    description: Operations for managing book catalog
paths:
  /books/{bookId}:
    description: Endpoint for retrieving or managing a specific book.
    get:
      tags:
        - Books
      summary: Get a specific book
      description: >
        Retrieves detailed information about a specific book.


        ## v2 changes


        - **(new)**: Returns `hitCount` field.

        - The `hitCount` increments each time a buyer retrieves the book via
        `GET /v2/books/{bookId}`. Requests authenticated with publisher
        credentials do not increment the count.
      operationId: getBook
      parameters:
        - name: bookId
          in: path
          required: true
          description: Unique identifier of the book
          schema:
            type: string
          example: 123e4567-e89b-41d4-a716-426614174000
      responses:
        '200':
          description: Successfully retrieved book
          headers:
            ETag:
              schema:
                type: string
              description: Entity tag for caching
              example: '"33a64df551425fcc55e4d42a148795d9f25f89d4"'
            Cache-Control:
              schema:
                type: string
              description: Cache directives
              example: max-age=3600, must-revalidate
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    $ref: '#/components/schemas/BookWithAnalytics'
              example:
                status: success
                data:
                  bookId: 123e4567-e89b-41d4-a716-426614174000
                  title: The Great Adventure
                  author: Jane Smith
                  description: An epic tale of courage and discovery
                  language: en-US
                  publisher: Adventure Books Inc
                  publishedDate: '2024-03-15'
                  isbn: 978-0-1234-5678-9
                  price: 24.99
                  status: ACTIVE
                  coverImages:
                    - https://covers.bookhub.com/great-adventure-front.jpg
                  genres:
                    - Fiction
                    - Adventure
                  bookFormat: Hardcover
                  createdDate: '2024-12-25T10:30:00Z'
                  updatedDate: '2024-12-26T15:45:00Z'
                  hitCount: 1247
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitError'
components:
  schemas:
    BookWithAnalytics:
      allOf:
        - $ref: '#/components/schemas/BaseBook'
        - type: object
          properties:
            hitCount:
              type: integer
              minimum: 0
              description: >
                Number of times this book has been retrieved by buyers (v2
                only).


                The `hitCount` increments each time a buyer retrieves the book
                via `GET /v2/books/{bookId}`. Requests authenticated with
                publisher credentials do not increment the count. Use it to
                track the popularity and performance of books over time. 
              example: 1247
              readOnly: true
    BaseBook:
      type: object
      required:
        - title
        - author
        - description
        - language
        - publisher
        - publishedDate
        - isbn
        - price
        - genres
        - bookFormat
      properties:
        bookId:
          type: string
          description: Unique identifier for the book
          readOnly: true
        title:
          type: string
          maxLength: 255
          description: Book title
          example: The Great Adventure
        author:
          type: string
          maxLength: 255
          description: Primary author name
          example: Jane Smith
        description:
          type: string
          maxLength: 5000
          description: Book description or synopsis
          example: An epic tale of courage and discovery
        publisher:
          type: string
          maxLength: 255
          description: Publisher name
          example: Adventure Books Inc
        publishedDate:
          type: string
          format: date
          description: Original publication date
          example: '2024-01-15'
        isbn:
          type: string
          pattern: >-
            ^(?:ISBN(?:-1[03])?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[- ]){3})[-
            0-9X]{13}$|97[89][0-9]{10}$|(?=(?:[0-9]+[- ]){4})[-
            0-9]{17}$)(?:97[89][- ]?)?[0-9]{1,5}[- ]?[0-9]+[- ]?[0-9]+[-
            ]?[0-9X]$
          description: >-
            ISBN-10 or ISBN-13 identifier. Must be unique across the publisher's
            catalog. Duplicate ISBNs return `409 Conflict`.
          example: 978-0-1234-5678-9
        price:
          type: number
          format: decimal
          minimum: 0.01
          description: Base price in USD
          example: 24.99
        status:
          type: string
          enum:
            - PENDING
            - ACTIVE
            - INACTIVE
          default: PENDING
          description: Current publication status. Always set to PENDING on creation.
          readOnly: true
        coverImages:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 5
          description: URLs to book cover images
        genres:
          type: array
          items:
            type: string
          minItems: 1
          maxItems: 5
          description: Book genres or categories
          example:
            - Fiction
            - Mystery
            - Thriller
        bookFormat:
          type: string
          enum:
            - Paperback
            - Hardcover
            - eBook
          description: Physical or digital format
        createdDate:
          type: string
          format: date-time
          description: When the book was created in the system
          readOnly: true
          example: '2024-12-25T10:30:00Z'
        updatedDate:
          type: string
          format: date-time
          description: When the book was last updated
          readOnly: true
          example: '2024-12-26T15:45:00Z'
    ErrorResponse:
      type: object
      description: >
        Error response returned when an API request fails.

        Note: `validation_context` and `provided_value` use snake_case rather
        than camelCase — 

        this is a known inconsistency that will be addressed in a future
        version.
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
          description: Status indicator
        message:
          type: string
          description: Human-readable error message
          example: Validation failed
        errors:
          type: array
          description: Detailed error information for each failed field
          items:
            type: object
            properties:
              field:
                type: string
                description: Field that caused the error
                example: isbn
              error:
                type: string
                description: Error type
                example: INVALID_FORMAT
              description:
                type: string
                description: Detailed error explanation
                example: ISBN must match the pattern for ISBN-10 or ISBN-13
              validation_context:
                type: object
                description: Additional context about the validation failure
                properties:
                  rule:
                    type: string
                    example: pattern_match
                  constraint:
                    type: object
                    example:
                      pattern: ^[0-9]{13}$
                  provided_value:
                    type: string
                    example: invalid-isbn
  responses:
    UnauthorizedError:
      description: Unauthorized access
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Authentication failed
            errors:
              - field: Authorization
                error: INVALID_TOKEN
                description: >-
                  The JWT is missing, malformed, or expired. Obtain a new token
                  and retry.
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Book not found
            errors:
              - field: bookId
                error: NOT_FOUND
                description: >-
                  No book exists with bookId
                  123e4567-e89b-41d4-a716-426614174000
    RateLimitError:
      description: |
        Rate limit exceeded. Retry after the window resets — see the
        `X-RateLimit-Reset` header for the Unix timestamp when the current
        window closes, and `X-RateLimit-Remaining` for requests left in it.
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Maximum requests allowed per minute
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests remaining in current window
        X-RateLimit-Reset:
          schema:
            type: integer
            format: unix-timestamp
          description: Unix timestamp when rate limit resets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: >-
              Rate limit exceeded. Retry after the window resets (see
              X-RateLimit-Reset header).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT obtained from the authentication endpoint

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.