GET
https://spideriq.ai
/
api
/
v1
/
search
/
aggregations
curl -X GET "https://spideriq.ai/api/v1/search/aggregations" \
  -H "Authorization: Bearer cli_xxx:key:secret"
{
  "success": true,
  "total_documents": 32798,
  "by_job_type": [
    {"name": "spiderMaps", "count": 28500},
    {"name": "spiderSite", "count": 4298}
  ],
  "by_category": [
    {"name": "Restaurant", "count": 8234},
    {"name": "Coffee Shop", "count": 3421},
    {"name": "Hotel", "count": 2156},
    {"name": "Retail", "count": 1987}
  ],
  "by_country": [
    {"name": "Luxembourg", "count": 15234},
    {"name": "Germany", "count": 8456},
    {"name": "France", "count": 5678}
  ],
  "avg_rating": 4.2,
  "total_reviews": 456789,
  "verified_emails_count": 12456,
  "indexed_over_time": [
    {"date": "2026-01-15", "count": 1234},
    {"date": "2026-01-16", "count": 1567},
    {"date": "2026-01-17", "count": 1890},
    {"date": "2026-01-18", "count": 2134},
    {"date": "2026-01-19", "count": 1756},
    {"date": "2026-01-20", "count": 2345},
    {"date": "2026-01-21", "count": 1876}
  ]
}

Overview

Returns aggregated statistics from your indexed data for building dashboards and analytics views. Use cases: Dashboard statistics, data overview, trend analysis, filter counts.

Authentication

Authorization
string
required
Bearer token in format: Bearer client_id:api_key:api_secret

Query Parameters

job_type
string
Filter aggregations by job type (e.g., spiderMaps, spiderSite).

Response

success
boolean
Whether the request was successful.
total_documents
integer
Total number of indexed documents.
by_job_type
array
Document counts by job type.
by_category
array
Document counts by category.
by_country
array
Document counts by country.
avg_rating
number
Average rating across all businesses.
total_reviews
integer
Total review count across all businesses.
verified_emails_count
integer
Number of verified email addresses.
indexed_over_time
array
Indexing trend over time for charts.
error
string
Error message if any.

Examples

curl -X GET "https://spideriq.ai/api/v1/search/aggregations" \
  -H "Authorization: Bearer cli_xxx:key:secret"
{
  "success": true,
  "total_documents": 32798,
  "by_job_type": [
    {"name": "spiderMaps", "count": 28500},
    {"name": "spiderSite", "count": 4298}
  ],
  "by_category": [
    {"name": "Restaurant", "count": 8234},
    {"name": "Coffee Shop", "count": 3421},
    {"name": "Hotel", "count": 2156},
    {"name": "Retail", "count": 1987}
  ],
  "by_country": [
    {"name": "Luxembourg", "count": 15234},
    {"name": "Germany", "count": 8456},
    {"name": "France", "count": 5678}
  ],
  "avg_rating": 4.2,
  "total_reviews": 456789,
  "verified_emails_count": 12456,
  "indexed_over_time": [
    {"date": "2026-01-15", "count": 1234},
    {"date": "2026-01-16", "count": 1567},
    {"date": "2026-01-17", "count": 1890},
    {"date": "2026-01-18", "count": 2134},
    {"date": "2026-01-19", "count": 1756},
    {"date": "2026-01-20", "count": 2345},
    {"date": "2026-01-21", "count": 1876}
  ]
}

Dashboard Example

Here’s how to use aggregations to build a dashboard:
async function loadDashboardStats(authToken) {
  const response = await fetch(
    'https://spideriq.ai/api/v1/search/aggregations',
    { headers: { 'Authorization': `Bearer ${authToken}` } }
  );
  const data = await response.json();

  return {
    totalRecords: data.total_documents,
    avgRating: data.avg_rating?.toFixed(1),
    verifiedEmails: data.verified_emails_count,
    jobTypeBreakdown: data.by_job_type,
    topCategories: data.by_category.slice(0, 5),
    indexingTrend: data.indexed_over_time
  };
}