Count API
An Overview of what the Count API offers within Datastreamer
The Count API is ideal to prevent quantities and counts for search queries exceeding 10,000 results.
Integrated Sources
Count API is only available for integrated partner sources and users of Datastreamer Data Store.
Endpoint Details
Endpoint | Type | Description | Status |
---|---|---|---|
/api/count | POST | Central endpoint for Count API which enables developer to retrieve the total count of results based on the provided parameters. | Live |
Request Object Details
A sample request body looks like:
{
"query": {
"query": "coffee",
"data_sources": [
"wsl_instagram"
]
}
}
Data Source and Query are extensively used within the JSON request body to filter out the results as per the requirements. Apache Lucene based syntax is used to write down the queries within the query
parameter of the request body. The format and content of the query is the same as the Search API format.
Response Details
Based on the data_source
provided in the request body as well as the query; the response of the Count API is the total number of documents available at the sources provided. The individual results are not provided by the Count API endpoint.
{
"total": {
"value": 267252
}
}
Updated 5 months ago