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 thehitCount 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. hitCount field, which indicates how many times that book’s details have been accessed via the API. For example:
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}.
Step 3: Set a performance threshold
To identify high–performing books, you can set a threshold for thehitCount. 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 confirmhitCount is returned and processed correctly:
Optional: Measure marketing campaign effectiveness
Once you can retrievehitCount, 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
- Using the
hitCountfield for analytics — Learn howhitCounttracks customer interest in specific titles.
How to guides
- Migrate to BookHub Publisher API v2 — Update your code to use BookHub Publisher API v2’s new features.
- Migrate away from title sorting — Update your code to remove title sorting in BookHub Publisher API v2.
Reference
- Track high–performing books with
hitCount— Example code for using thehitCountfield in PHP. - Endpoint coverage for the
hitCountfield — Learn which BookHub Publisher API endpoints include thehitCountfield in their responses. - Release notes — Explore all changes in BookHub Publisher API v2.