Skip to main content
GET
/
v1
/
datasets
/
{table}
/
stats
Get stats
curl --request GET \
  --url https://api.trydatadriver.com/v1/datasets/{table}/stats

Documentation Index

Fetch the complete documentation index at: https://docs.trydatadriver.com/llms.txt

Use this file to discover all available pages before exploring further.

When you’d use this

Before paying the cost of pulling thousands of rows, peek at the counts. “How many tier-1 leads in Texas?” — this answers it in one cheap call. Perfect for dashboards and filter UIs.

Query parameters

NameTypeDefaultDescription
group_bystring (optional)tier,state,match_scoreComma-separated column names to break down counts by. Max 5.
Cached for 60 seconds. This endpoint is hit a lot, so we cache it. If you need to-the-second precision, use /search.

Request

curl "https://api.trydatadriver.com/v1/datasets/leads/stats?group_by=tier,state" \
  -H "Authorization: Bearer dd_a3f9b2c1d4e5f6g7h8i9j0"
Note the quotes around the URL. The ? and = can confuse the shell, so wrap it.

Response

{
  "total": 102345,
  "group_by": ["tier", "state"],
  "groups": [
    { "tier": "1", "state": "AZ", "count": 3214 },
    { "tier": "1", "state": "TX", "count": 5872 },
    { "tier": "1", "state": "CA", "count": 7104 },
    { "tier": "3", "state": "AZ", "count": 1432 },
    { "tier": "4", "state": "AZ", "count": 945 }
  ],
  "cached_at": "2026-05-09T12:14:00Z"
}
Each item in groups shows one combination of values plus its count. So the third row above means: 7,104 leads have tier=1 AND state=CA. The response includes X-Cache: HIT or X-Cache: MISS so you can see whether the answer came from the cache.