REST endpoints
Count view results
Get the total number of tokens that match each Pulse view, to build page controls. Takes the same body as Query views.
POST
Returns, for each view, the total number of tokens that match its model, filters and scope.
The fields
limit and offset are ignored for the count. Use it next to POST /pulse/views to show page numbers or a “showing 1 to 25 of N” label.
The body is exactly the same as for POST /pulse/views, so you can send one body to both endpoints. It is validated the same way and returns the same errors.
Body
The views to count, 1 to 10, with unique names. If omitted, the server counts the default
new, bonding and bonded views. Each view has the same properties as in Query views.model (top level), assetMode, filterQuotes, excludeLPTokens and compressed are accepted for compatibility and have no effect.
Response
200 OK with content-type: application/json; charset=utf-8. One key per view, in request order.
Counts always come from the database and are cached for about 30 seconds per view definition. They can differ slightly from what the live engine returns on the first page of /pulse/views.
The count can be larger than you can page to.
offset stops at 500 and limit at 100, so the deepest reachable position is 600. If pagination is 1,250, positions 601 to 1,250 cannot be fetched; narrow the view with filters instead.Paging recipe
- Send your body to
/pulse/views/paginationto get the total for each view. - Work out the number of pages:
min(total, 600)divided by your page size, rounded up. - For page
p(starting at 0), send the same body to/pulse/viewswithoffsetset top × limit. Keepoffsetat 500 or below.