# Algolia

> Algolia API Skill

- Skill: `ashish7802/algolia` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add ashish7802/algolia`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ashish7802/algolia/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: ashish7802 (https://skillmd.com/u/ashish7802)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/ashish7802/algolia

---

# Algolia API Skill

## Overview
Algolia provides ultra-fast full-text search. This skill focuses on indexing data from the backend and searching from the frontend.

## Installation
```bash
npm install algoliasearch
pip install algoliasearch
```

## Authentication
Frontend clients use the Search-Only API Key. Backends use the Admin API Key for indexing. Never expose the Admin key.

## Core Concepts
- **Index**: A collection of searchable JSON records.
- **ObjectID**: The unique identifier for a record.
- **Facets**: Attributes used for filtering and categorization.

## Common Workflows
1. Backend: Initialize client with Admin Key.
2. Push records to index via `saveObjects`.
3. Frontend: Initialize client with Search Key and query.

## Error Handling
Handle `ApiError`. Common errors are Payload Too Large (chunk your `saveObjects` calls) and Invalid Credentials.

## Security
Use Secured API Keys to restrict frontend search access (e.g., scoping a user's search token to only return their own data).

## Rate Limits
Limits are massive, but batch indexing should be limited to chunks of 1,000 to 10,000 records to prevent timeout.

## Best Practices
Do not store massive text blocks (like full articles) in a single record attribute. Truncate or chunk records to keep them under the 10KB to 100KB limits.

## Troubleshooting
If search results are inaccurate, check the index's 'Searchable Attributes' configuration in the Algolia Dashboard.

## References
- [API Reference](https://www.algolia.com/doc/api-reference/)

## Why use this skill
Use this when your agent works with **algolia** — structured patterns beat pasted docs and prevent common hallucinations.

## AI pitfalls
- Using outdated SDK or API versions from training data
- Inventing environment variable names
- Omitting error handling and retry logic

## Production checklist
- [ ] Secrets in environment variables, not source code
- [ ] Error handling and logging in place
- [ ] Rate limits and timeouts configured

## Related skills
- No graph relationships yet — see the knowledge graph in the docs site.

---
> **Last Verified:** 2026-07-02

