Skip to main content
The hitCount field in the BookWithAnalytics schema provides a count of how many times a book’s details have been retrieved via the GET /v2/books/{bookId} endpoint. You can use this to track the popularity and performance of books over time. This guide shows you how to retrieve hitCount, rank your catalog by it, and flag high performers — then, optionally, measure a marketing campaign’s impact. Only requests made by buyers increment hitCount, providing an accurate reflection of buyer interest in each book. Requests from publishers or cached responses do not affect the count, ensuring that the metric specifically tracks genuine buyer engagement. For details on hitCount data type, initial value, update behavior, and availability, see hitCount field explained.

Prerequisites

Before you begin, ensure you meet the following prerequisites:
  • Familiarity with the BookHub Publisher API v2.
  • A valid JWT for authentication.
  • Access to your codebase that integrates with the BookHub Publisher API.

Tips

The following examples show how to use the hitCount field correctly and what to avoid. See hitCount Analytics for more information.

✅ Good uses

  • Identifying trending books over weeks/months
  • Measuring marketing campaign effectiveness
  • Generating internal reports

❌ Avoid

  • Making instant inventory decisions based on a single view count.
  • Using it as the sole metric for success.
  • Treating it as perfectly accurate (may have slight delays in updates).

Step 1: Retrieve book details with hitCount

To see the hitCount for a specific book, make a GET request to the GET /v2/books/{bookId} endpoint.
The following Python examples use 123e4567-e89b-41d4-a716-426614174000 as the book_id or test_book_id.
The response will include the hitCount field, which indicates how many times that book’s details have been accessed via the API. For example:
The print statement outputs:

Step 2: Retrieve hitCount for all books and identify top performers

The GET /v2/books endpoint does not include hitCount in its response. To retrieve hitCount for all books, fetch each book individually using GET /v2/books/{bookId}.
This approach makes one API request per book, so the number of requests scales linearly with your catalog size. For large catalogs, this may exceed the rate limit (150 requests per minute). See Monitor rate limits for guidance.
The output lists books sorted by performance:

Step 3: Set a performance threshold

To identify high–performing books, you can set a threshold for the hitCount. For example, you might want to flag any book with a hitCount greater than 1000 as a high performer. You can implement this logic in your code as follows:

Response

After running Step 3, the output identifies high performers:

Step 4: Test your implementation

Retrieve a known book and confirm hitCount is returned and processed correctly:

Optional: Measure marketing campaign effectiveness

Once you can retrieve hitCount, you can reuse it to measure a campaign’s impact by comparing counts before and after. This is a separate use case from ranking — use it when you’re evaluating a specific promotion.

Next steps

Explore related topics:

Conceptual guides

How to guides

Reference


Last modified on August 18, 2026