Resource Stats
/api/v1/idap/{resource_type}/statsOverview
Returns aggregate counts for a resource type — total count, breakdown by flag, breakdown by source worker, and activity in the last 24 hours. Useful for dashboard widgets, agent decision-making context, and daily reports.
Stats are not supported on media resources. Returns 400 Bad Request.
Path Parameters
resource_typestringrequiredThe resource type to get stats for.
Options: businesses, domains, contacts, emails, phones, company_registry, linkedin_profiles
Query Parameters
formatstringdefault: jsonResponse format.
Options: json, yaml, md
Response
resource_typestringThe resource type.
totalintegerTotal number of resources of this type in your account.
by_flagobjectCount of resources per active flag. Only flags with at least one resource are included.
Example: { "new": 342, "qualified": 1205, "contacted": 3891 }
by_sourceobjectCount of resources per source worker.
Example: { "spider_maps": 8932, "spider_site": 3915 }
last_24hobjectActivity counts in the last 24 hours.
Keys: created (new resources), updated (modified resources)
Example Request
- cURL
- Python
- cURL (YAML)
curl "https://spideriq.ai/api/v1/idap/businesses/stats" \
-H "Authorization: Bearer <your_token>"
import httpx
response = httpx.get(
"https://spideriq.ai/api/v1/idap/businesses/stats",
headers={"Authorization": "Bearer <your_token>"},
)
stats = response.json()
print(f"Total businesses: {stats['total']}")
print(f"Qualified: {stats['by_flag'].get('qualified', 0)}")
print(f"Created today: {stats['last_24h'].get('created', 0)}")
curl "https://spideriq.ai/api/v1/idap/businesses/stats?format=yaml" \
-H "Authorization: Bearer <your_token>"
Response Example
{
"resource_type": "businesses",
"total": 12847,
"by_flag": {
"new": 342,
"qualified": 1205,
"contacted": 3891,
"rejected": 2104,
"converted": 487,
"priority": 156,
"do_not_contact": 89
},
"by_source": {
"spider_maps": 8932,
"spider_site": 3915
},
"last_24h": {
"created": 89,
"updated": 234
}
}
{
"detail": "no_data_schema"
}
Use Cases
- Dashboard widgets — Show total leads, qualified count, conversion rate
- Agent context — Before an AI agent starts working, it can check stats to understand the current state of data
- Daily reports — Track new resources created and flagged in the last 24 hours
- Pipeline monitoring — Compare
by_flagcounts to track lead progression through your workflow