Skip to main content

Resource Stats

GET/api/v1/idap/{resource_type}/stats

Overview

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.

Media Resources

Stats are not supported on media resources. Returns 400 Bad Request.

Path Parameters

resource_typestringrequired

The resource type to get stats for.

Options: businesses, domains, contacts, emails, phones, company_registry, linkedin_profiles

Query Parameters

formatstringdefault: json

Response format.

Options: json, yaml, md

Response

resource_typestring

The resource type.

totalinteger

Total number of resources of this type in your account.

by_flagobject

Count of resources per active flag. Only flags with at least one resource are included.

Example: { "new": 342, "qualified": 1205, "contacted": 3891 }

by_sourceobject

Count of resources per source worker.

Example: { "spider_maps": 8932, "spider_site": 3915 }

last_24hobject

Activity counts in the last 24 hours.

Keys: created (new resources), updated (modified resources)

Example Request

curl "https://spideriq.ai/api/v1/idap/businesses/stats" \
-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_flag counts to track lead progression through your workflow