Skip to main content
GET
/
v1
/
analytics
/
namespaces
/
indexes
/
recommendations
Get Index Recommendations
curl --request GET \
  --url https://api.mixpeek.com/v1/analytics/namespaces/indexes/recommendations \
  --header 'Authorization: <authorization>' \
  --header 'X-Namespace: <x-namespace>'
{
  "namespace_id": "<string>",
  "time_range_days": 123,
  "recommendations": [
    {
      "field_name": "<string>",
      "query_count": 123,
      "avg_latency_ms": 123,
      "p95_latency_ms": 123,
      "slow_query_count": 123,
      "very_slow_query_count": 123,
      "priority_score": 123,
      "recommendation": "<string>",
      "mongodb_index_command": "<string>"
    }
  ],
  "summary": {}
}

Headers

Authorization
string
required

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

X-Namespace
string
required

REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'

Query Parameters

days
integer
default:30

Days of history to analyze

Required range: 1 <= x <= 90
min_usage_count
integer
default:5

Minimum queries to consider

Required range: 1 <= x <= 100
limit
integer
default:50

Maximum recommendations to return

Required range: 1 <= x <= 100

Response

Successful Response

Response for index recommendations endpoint.

namespace_id
string
required

Namespace ID analyzed

time_range_days
integer
required

Number of days analyzed

recommendations
IndexRecommendation · object[]
required

Index recommendations

summary
Summary · object
required

Summary statistics (high_priority, medium_priority, low_priority counts)