> ## Documentation Index
> Fetch the complete documentation index at: https://www.algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# (Beta) Retrieve the field catalog

> Beta: this endpoint is under active development and may change without notice.

Returns the static catalog of analytics fields, grouped by domain and usage (metrics, filters,
groups, distributions). No authentication is required. Use it to discover valid `(domain, kind)`
pairs before building the other `/3/patterns/*` queries; two fields are combinable in one query
only when their `roots` intersect. Each entry's `requires` lists the ACLs needed when that field
is actually used in a query.


## OpenAPI

````yaml specs/searchstats.yml get /3/patterns/fields
openapi: 3.1.0
info:
  title: Analytics API
  summary: >-
    The Analytics API gives you access to metrics related to your Algolia search
    experience
  description: >
    ## Base URLs


    Base URLs for the Analytics API:


    - `https://analytics.us.algolia.com`

    - `https://analytics.de.algolia.com`

    - `https://analytics.algolia.com` (alias of `analytics.us.algolia.com`)


    Use the URL that matches your [analytics
    region](https://dashboard.algolia.com/account/infrastructure/analytics).


    **All requests must use HTTPS.**


    ## Availability and authentication


    Access to the Analytics API is available as part of the [Premium or Elevate
    plans](https://www.algolia.com/pricing).


    Add these headers to authenticate requests:


    - `x-algolia-application-id`. Your Algolia application ID.

    - `x-algolia-api-key`. An API key with the necessary permissions to make the
    request.
      The required access control list (ACL) to make a request is listed in each endpoint's reference.

    You can find your application ID and API key in the [Algolia
    dashboard](https://dashboard.algolia.com/account/api-keys).


    ## Rate limits


    You can make up to **100 requests per minute per app** to the Analytics API.

    The response includes headers with information about the limits.


    ## Parameters


    Query parameters must be
    [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding).

    Non-ASCII characters must be UTF-8 encoded.

    Plus characters (`+`) are interpreted as spaces.


    ## Response status and errors


    The Analytics API returns JSON responses.

    Since JSON doesn't guarantee any specific ordering, don't rely on the order
    of attributes in the API response.


    - Successful responses return a `2xx` status

    - Client errors return a `4xx` status

    - Server errors are indicated by a `5xx` status.


    Error responses have a `message` property with more information.


    ## Version


    The current version of the Analytics API is version 2, indicated by the
    `/2/` in each endpoint's URL.


    A Beta semantic patterns framework is also available under `/3/patterns/*`
    for building custom

    analytics queries. These endpoints are under active development and may
    change without notice.


    ## Query aggregation


    Algolia accepts queries on each keystroke.

    To ensure you have relevant analytics data, however, the series of
    keystrokes is aggregated to keep only the latest (final) user query.

    This is called "prefix" aggregation.


    For more information, see [Query agggregation and
    processing](https://www.algolia.com/doc/guides/search-analytics/concepts/query-aggregation).


    See the analytics implementation overview for more information about query
    aggregation.
  version: 2.0.0
servers:
  - url: https://analytics.{region}.algolia.com
    variables:
      region:
        description: The region where your Algolia application is hosted.
        enum:
          - us
          - de
        default: us
  - url: https://analytics.algolia.com
security:
  - appId: []
    apiKey: []
tags:
  - name: click
    x-displayName: Clicks
    description: |
      Metrics related to click and conversion events,
      such as click and conversion rates for your search results.
  - name: filter
    x-displayName: Filters
    description: |
      Metrics related to filters.
  - name: pattern
    x-displayName: Patterns (Beta)
    description: >
      Beta — the semantic patterns query framework (`/3/patterns/*`).

      Build custom analytics queries from metrics, groupBy, filters, and
      parameters.

      These endpoints are under active development and may change without
      notice.
  - name: revenue
    x-displayName: Revenue
    description: |
      Metrics related to revenue.
  - name: search
    x-displayName: Searches
    description: |
      Metrics related to searches and search results,
      such as the no-results rate or the most frequent search queries.
  - name: status
    x-displayName: Status
    description: Check the status of the Analytics API.
  - name: user
    x-displayName: Users
    description: Metrics related to the users of your search.
externalDocs:
  url: https://www.algolia.com/doc/guides/search-analytics/overview
  description: Search analytics.
paths:
  /3/patterns/fields:
    get:
      tags:
        - pattern
      summary: (Beta) Retrieve the field catalog
      description: >
        **Beta**: this endpoint is under active development and may change
        without notice.


        Returns the static catalog of analytics fields, grouped by domain and
        usage (metrics, filters,

        groups, distributions). No authentication is required. Use it to
        discover valid `(domain, kind)`

        pairs before building the other `/3/patterns/*` queries; two fields are
        combinable in one query

        only when their `roots` intersect. Each entry's `requires` lists the
        ACLs needed when that field

        is actually used in a query.
      operationId: getPatternsFields
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: Strong entity tag over the catalog; stable per release.
              schema:
                type: string
            Cache-Control:
              description: Caching directives for the catalog response.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Catalog'
        '400':
          $ref: '#/components/responses/BadRequest'
      security: []
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |-
            // Initialize the client
            var client = new AnalyticsClient(
              new AnalyticsConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")
            );

            // Call the API
            var response = await client.GetPatternsFieldsAsync();

            // print the response
            Console.WriteLine(response);
        - lang: go
          label: Go
          source: >-
            // Initialize the client with your application region, eg.
            analytics.ALGOLIA_APPLICATION_REGION

            client, err := analytics.NewClient("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY", analytics.US)

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Call the API

            response, err := client.GetPatternsFields()

            if err != nil {
              // handle the eventual error
              panic(err)
            }



            // print the response

            print(response)
        - lang: java
          label: Java
          source: >-
            // Initialize the client

            AnalyticsClient client = new
            AnalyticsClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY",
            "ALGOLIA_APPLICATION_REGION");


            // Call the API

            Catalog response = client.getPatternsFields();


            // print the response

            System.out.println(response);
        - lang: javascript
          label: JavaScript
          source: >-
            // Initialize the client

            // Replace 'us' with your Algolia Application Region

            const client = algoliasearch('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY').initAnalytics({ region: 'us' });


            // Call the API

            const response = await client.getPatternsFields();



            // print the response

            console.log(response);
        - lang: kotlin
          label: Kotlin
          source: |-
            // Initialize the client
            val client =
              AnalyticsClient(
                appId = "ALGOLIA_APPLICATION_ID",
                apiKey = "ALGOLIA_API_KEY",
                region = "ALGOLIA_APPLICATION_REGION",
              )

            // Call the API
            var response = client.getPatternsFields()


            // print the response
            println(response)
        - lang: php
          label: PHP
          source: >-
            // Initialize the client

            $client = AnalyticsClient::create('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');


            // Call the API

            $response = $client->getPatternsFields();



            // print the response

            var_dump($response);
        - lang: python
          label: Python
          source: >-
            # Initialize the client

            # In an asynchronous context, you can use AnalyticsClient instead,
            which exposes the exact same methods.

            client = AnalyticsClientSync(
                "ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
            )


            # Call the API

            response = client.get_patterns_fields()



            # print the response

            print(response)
        - lang: ruby
          label: Ruby
          source: >-
            # Initialize the client

            client = Algolia::AnalyticsClient.create("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")


            # Call the API

            response = client.get_patterns_fields



            # print the response

            puts(response)
        - lang: scala
          label: Scala
          source: |-
            // Initialize the client
            val client = AnalyticsClient(
              appId = "ALGOLIA_APPLICATION_ID",
              apiKey = "ALGOLIA_API_KEY",
              region = Option("ALGOLIA_APPLICATION_REGION")
            )

            // Call the API
            val response = Await.result(
              client.getPatternsFields(
              ),
              Duration(100, "sec")
            )

            // print the response
            println(response)
        - lang: swift
          label: Swift
          source: >-
            // Initialize the client

            let client = try AnalyticsClient(appID: "ALGOLIA_APPLICATION_ID",
            apiKey: "ALGOLIA_API_KEY", region: .us)


            // Call the API

            let response = try await client.getPatternsFields()


            // print the response

            print(response)
        - lang: cURL
          label: curl
          source: |-
            curl --request GET \
              --url https://analytics.us.algolia.com/3/patterns/fields \
              --header 'accept: application/json'
components:
  schemas:
    Catalog:
      type: object
      title: Field catalog
      additionalProperties: false
      required:
        - domains
      properties:
        domains:
          type: object
          description: Catalog entries grouped by domain.
          additionalProperties:
            $ref: '#/components/schemas/DomainCatalog'
    DomainCatalog:
      type: object
      title: Domain catalog
      additionalProperties: false
      required:
        - metrics
        - filters
        - groups
        - distributions
      properties:
        distributions:
          type: array
          description: Fields usable in distributions.
          items:
            $ref: '#/components/schemas/CatalogEntry'
        filters:
          type: array
          description: Fields usable as filters.
          items:
            $ref: '#/components/schemas/CatalogEntry'
        groups:
          type: array
          description: Fields usable in `groupBy`.
          items:
            $ref: '#/components/schemas/CatalogEntry'
        metrics:
          type: array
          description: Fields usable as metrics.
          items:
            $ref: '#/components/schemas/CatalogEntry'
    ErrorBase:
      description: Error.
      type: object
      x-keep-model: true
      additionalProperties: true
      properties:
        message:
          type: string
          example: Invalid Application-Id or API-Key
    CatalogEntry:
      type: object
      title: Catalog entry
      additionalProperties: false
      required:
        - kind
        - description
        - roots
        - requires
      properties:
        description:
          type: string
          description: Human-readable description of the field.
        kind:
          type: string
          description: Field identifier.
        requires:
          type: array
          description: >-
            Public ACL identifiers required to read the field, for example
            `clickAnalyticsEnabled`.
          items:
            type: string
        roots:
          type: array
          description: >-
            Root stages the field depends on. Two fields are combinable in one
            query only when their roots intersect.
          items:
            type: string
  responses:
    BadRequest:
      description: Bad request or request arguments.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBase'
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-algolia-application-id
      description: Your Algolia application ID.
    apiKey:
      type: apiKey
      in: header
      name: x-algolia-api-key
      description: >
        Your Algolia API key with the necessary permissions to make the request.

        Permissions are controlled through access control lists (ACL) and access
        restrictions.

        The required ACL to make a request is listed in each endpoint's
        reference.

````