/results endpoints to provide a uniform sample of the dataset for efficient data analysis and visualization. This feature is particularly useful for use cases like charting (if you only have 4 000 pixels on the chart, then 10 000 datapoints are plenty), where analyzing a full dataset isn’t necessary. Sampling returns a subset (with a uniform distribution) of data, optimizing usage of very large results with reduced latency and costs. You can apply sampling to the following endpoints:
Example Sampling Request
- Python SDK
- cURL
- Python
- Javascript
Sampling Parameters
sample_count
- Type:
integer - Description: Determines the number of rows to return as a sample from the result set. If the available dataset contains fewer rows than the specified
sample_count, the entire dataset is returned.
- Sampling is designed to provide a randomized subset of data, with each request potentially producing different outcomes.
- When specifying
sample_count(e.g.,sample_count = 10000), the number is approximate. The actual number of rows returned may vary slightly (e.g., 10013, 10017), reflecting the probabilistic nature of the sampling process. sample_countis incompatible withoffset,limit, andfiltersparameters.sample_countcan be used withcolumnsto specify which data fields to include in the sample.- Specifying a low
sample_countrelative to total rows, being probabilistic, may return 0 rows due to the probability based sampling calculation (e.g., 10 in 100,000, means each row has ~0.01% chance to be included)
Sampling Response
Example sampling response
Example sampling response
Showing trimmed response for
sample_count=200 instead of specified sample_count=10000 in example request to not overwhelm the doc.
