Skip to main content
Sometimes you need to access the Algolia API client directly.

Access the Algolia API client

The client is available as a singleton and uses the Algolia credentials you added to your Rails configuration. For example, to get settings:
Ruby

Access model indices

To access the index used by a model, use the index_name class method and pass it as a variable to the API client. This method follows your naming configuration, such as per-environment settings or custom names.
Ruby
Last modified on June 19, 2026