---
title: "Retrieve analytics rules"
method: GET
path: "/analytics/rules"
tags: ["analytics"]
---

# Retrieve analytics rules

`GET /analytics/rules`

Retrieve all analytics rules. Use the optional rule_tag filter to narrow down results.

## Query parameters

- `rule_tag` string

## Response `200`

Analytics rules fetched

- AnalyticsRule[]
  - `name` string, required
  - `type` 'popular_queries' | 'nohits_queries' | 'counter' | 'log', required
  - `collection` string, required
  - `event_type` string, required
  - `rule_tag` string
  - `params` object
    - `destination_collection` string
    - `limit` integer
    - `capture_search_requests` boolean
    - `meta_fields` string[]
    - `expand_query` boolean
    - `counter_field` string
    - `weight` integer

---

[API](https://skmtc.dev/typesense/apis/typesense-api.md) · [All operations](https://skmtc.dev/typesense/apis/typesense-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/typesense/typesense-api/revisions/1d9b3b61638e/schema)
