Typesense · Schema

Typesense Analytics Event

Schema for analytics events logged to Typesense for tracking search behavior, clicks, conversions, and visits.

Full-Text SearchOpen-SourceSearch EnginesTypo ToleranceVector Search

Properties

Name Type Description
type string Type of analytics event being logged.
name string Name of the event, which must match a name defined in an analytics rule.
data object Event data payload containing the search query, document interaction, and user details.
View JSON Schema on GitHub

JSON Schema

typesense-analytics-event-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://typesense.org/schemas/typesense/analytics-event.json",
  "title": "Typesense Analytics Event",
  "description": "Schema for analytics events logged to Typesense for tracking search behavior, clicks, conversions, and visits.",
  "type": "object",
  "required": ["type", "name", "data"],
  "properties": {
    "type": {
      "type": "string",
      "description": "Type of analytics event being logged.",
      "enum": ["click", "conversion", "visit", "custom"]
    },
    "name": {
      "type": "string",
      "description": "Name of the event, which must match a name defined in an analytics rule.",
      "minLength": 1
    },
    "data": {
      "type": "object",
      "description": "Event data payload containing the search query, document interaction, and user details.",
      "properties": {
        "q": {
          "type": "string",
          "description": "The search query associated with this event."
        },
        "doc_id": {
          "type": "string",
          "description": "ID of the document the user interacted with."
        },
        "user_id": {
          "type": "string",
          "description": "Identifier of the user who triggered the event."
        },
        "position": {
          "type": "integer",
          "description": "Position of the document in the search results when the event was triggered.",
          "minimum": 1
        },
        "tags": {
          "type": "object",
          "description": "Arbitrary key-value metadata tags for categorizing and filtering events.",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    }
  },
  "$defs": {
    "AnalyticsRule": {
      "type": "object",
      "description": "An analytics rule that controls how search queries and events are aggregated.",
      "required": ["name", "type", "params"],
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique name for the analytics rule.",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "description": "Type of analytics rule determining how data is aggregated.",
          "enum": ["popular_queries", "nohits_queries", "counter", "log"]
        },
        "params": {
          "type": "object",
          "description": "Rule parameters defining source, destination, and aggregation settings.",
          "properties": {
            "source": {
              "type": "object",
              "description": "Source configuration specifying which collections and events to track.",
              "properties": {
                "collections": {
                  "type": "array",
                  "description": "Collections to monitor for search queries.",
                  "items": {
                    "type": "string"
                  }
                },
                "events": {
                  "type": "array",
                  "description": "Event configurations to track.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Event type to track."
                      },
                      "weight": {
                        "type": "number",
                        "description": "Weight assigned to this event type for scoring."
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the event."
                      }
                    }
                  }
                }
              }
            },
            "destination": {
              "type": "object",
              "description": "Destination for aggregated analytics data.",
              "properties": {
                "collection": {
                  "type": "string",
                  "description": "Collection to store the aggregated results."
                },
                "counter_field": {
                  "type": "string",
                  "description": "Field to use as a counter for counter-type rules."
                }
              }
            },
            "limit": {
              "type": "integer",
              "description": "Maximum number of entries to generate.",
              "minimum": 1
            },
            "expand_query": {
              "type": "boolean",
              "description": "Whether to expand queries for suggestion generation."
            }
          }
        }
      }
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/typesense-analytics-event"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.