Get Index Recommendations
Get comprehensive MongoDB index recommendations.
Analyzes query patterns and generates prioritized index recommendations with ready-to-use MongoDB commands.
Use Cases:
- Get actionable index suggestions
- Prioritize database optimization
- Copy/paste index creation commands
- Track optimization opportunities
Recommendation Levels:
- HIGH PRIORITY: >100 queries, >300ms avg OR >10 very slow queries
- MEDIUM PRIORITY: >50 queries, >200ms avg OR >20 slow queries
- LOW PRIORITY: >10 queries but acceptable performance
- NO ACTION: Low usage, no optimization needed
Response Includes:
- Prioritized recommendations
- Usage and latency statistics
- MongoDB index creation commands
- Summary by priority level
Example:
curl -X GET "https://api.mixpeek.com/v1/analytics/namespaces/indexes/recommendations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Namespace: your-namespace"
Authorizations
Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings → API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing header returns 403; an invalid or revoked key returns 401.
Namespace id (ns_...), not the namespace name. This scopes the request rather than authenticating it, and it is required on every operation marked x-mixpeek-namespace-scoped.
Query Parameters
Days of history to analyze
1 <= x <= 90Minimum queries to consider
1 <= x <= 100Maximum recommendations to return
1 <= x <= 100Response
Successful Response
Response for index recommendations endpoint.

