# Algolia Integration via LowCodeAPI

**Last Updated**: February 11, 2026

## Overview

Algolia provides a powerful search and discovery platform that delivers fast, relevant search experiences. The API enables you to manage your indices, perform searches, and analyze search behavior.

**Main Features:**
- A/B Testing for search optimization
- Analytics and insights
- Web crawling and indexing
- Infrastructure monitoring
- Real-time search API

## Base Endpoint

```
https://api.lowcodeapi.com/algolia
```

**Important**: Always include the provider name `algolia` in the URL path after `api.lowcodeapi.com/`

## Authentication

Algolia uses Application ID and API Key authentication. When using LowCodeAPI, you only need your LowCodeAPI `api_token` - the system automatically maps your Algolia credentials.

**Required Credentials:**
1. **Application ID** - Your unique Algolia application identifier
2. **API Key** - Your API key for accessing Algolia APIs

**Where to get credentials:**
- Visit [Algolia API Keys](https://www.algolia.com/account/api-keys/) to create or manage your API keys
- Your Application ID is displayed in your Algolia dashboard

**Authentication in requests:**
LowCodeAPI automatically handles authentication by using your stored `applicationid` and `api_key` from your LowCodeAPI account.

## URL Format (Important)

LowCodeAPI supports **two URL formats** for endpoints with path parameters. Always try the **New Format first**, and only fall back to the **Old Format** if it doesn't work.

### New Format (Priority) - Dynamic Path Parameters

Path parameters stay in the URL path. The provider name is always included.

```
https://api.lowcodeapi.com/algolia/2/abtests/{id}?api_token=YOUR_API_TOKEN
```

### Old Format (Fallback) - Sanitized Path + Query Parameters

Path parameters become query parameters. The provider name is always included.

```
https://api.lowcodeapi.com/algolia/2/abtests/id?id={id}&api_token=YOUR_API_TOKEN
```

### Decision Flow for AI Agents

1. Always use **New Format** first - Keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider

### Multiple Path Parameters

For endpoints with multiple path parameters:

```bash
# New Format (Priority)
https://api.lowcodeapi.com/algolia/api/1/crawlers/{id}/tasks/{tid}?api_token=XXX

# Old Format (Fallback)
https://api.lowcodeapi.com/algolia/api/1/crawlers/id/tasks/tid?id={id}&tid={tid}&api_token=XXX
```

## API Categories

- **A/B Testing** - Create and manage A/B tests to optimize search
- **Analytics** - Search analytics, top searches, filters, and conversions
- **Crawler** - Web crawling and content indexing
- **Insights** - Event tracking and user behavior
- **Monitoring** - Infrastructure metrics and status monitoring
- **Personalization** - User personalization and affinity
- **Query Suggestions** - Query suggestion management
- **Recommend** - Recommendation API endpoints
- **Search** - Index management, objects, rules, synonyms, and search operations
- **Usage** - Usage metrics and billing

## Common Endpoints

### A/B Testing

#### Create A/B Test

**Method:** POST | **Path:** `/2/abtests`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests?api_token=YOUR_API_TOKEN
```

**Request Body:** See [Algolia A/B Test documentation](https://www.algolia.com/doc/rest-api/ab-test/#add-ab-test) for body parameters

**Example Request:**
```bash
curl -X POST "https://api.lowcodeapi.com/algolia/2/abtests?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Test ranking algorithm",
    "variants": [...],
    "trafficPercentage": 50
  }'
```

**Example Response:**
```json
{
  "data": {
    "abtestID": 123456,
    "name": "Test ranking algorithm",
    "status": "running"
  }
}
```

#### Get A/B Test

**Method:** GET | **Path:** `/2/abtests/{id}`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests/{id}?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests/id?id={id}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{id}` | string | Yes | The A/B test ID |

**Example Request:**
```bash
curl -X GET "https://api.lowcodeapi.com/algolia/2/abtests/123456?api_token=YOUR_API_TOKEN"
```

**Example Response:**
```json
{
  "data": {
    "abtestID": 123456,
    "name": "Test ranking algorithm",
    "status": "running",
    "variants": [...]
  }
}
```

#### Stop A/B Test

**Method:** POST | **Path:** `/2/abtests/{id}/stop`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests/{id}/stop?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests/id/stop?id={id}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{id}` | string | Yes | The A/B test ID |

#### Delete A/B Test

**Method:** DELETE | **Path:** `/2/abtests/{id}`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests/{id}?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/2/abtests/id?id={id}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{id}` | string | Yes | The A/B test ID |

### Analytics

#### Get Top Searches

**Method:** GET | **Path:** `/2/searches`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/2/searches?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/2/searches?api_token=YOUR_API_TOKEN
```

**Example Request:**
```bash
curl -X GET "https://api.lowcodeapi.com/algolia/2/searches?api_token=YOUR_API_TOKEN"
```

**Example Response:**
```json
{
  "data": {
    "searches": [
      {"search": "product", "count": 1523},
      {"search": "review", "count": 892}
    ]
  }
}
```

#### Get Top Hits

**Method:** GET | **Path:** `/2/hits`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/2/hits?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/2/hits?api_token=YOUR_API_TOKEN
```

#### Get Top Filters for an Attribute

**Method:** GET | **Path:** `/2/filters/{attribute}`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/2/filters/{attribute}?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/2/filters/attribute?attribute={attribute}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{attribute}` | string | Yes | The attribute name to filter by |

**Example Request:**
```bash
curl -X GET "https://api.lowcodeapi.com/algolia/2/filters/category?api_token=YOUR_API_TOKEN"
```

### Crawler

#### Create a Crawler

**Method:** POST | **Path:** `/api/1/crawlers`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers?api_token=YOUR_API_TOKEN
```

#### Get a Crawler

**Method:** GET | **Path:** `/api/1/crawlers/{id}`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers/{id}?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers/id?id={id}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{id}` | string | Yes | The crawler ID |

#### Run a Crawler

**Method:** POST | **Path:** `/api/1/crawlers/{id}/run`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers/{id}/run?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers/id/run?id={id}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{id}` | string | Yes | The crawler ID |

#### Get Status of a Crawler Task

**Method:** GET | **Path:** `/api/1/crawlers/{id}/tasks/{tid}`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers/{id}/tasks/{tid}?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/api/1/crawlers/id/tasks/tid?id={id}&tid={tid}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{id}` | string | Yes | The crawler ID |
| `{tid}` | string | Yes | The task ID |

### Monitoring

#### Get Current API Status

**Method:** GET | **Path:** `/1/status`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/1/status?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/1/status?api_token=YOUR_API_TOKEN
```

#### Get Infrastructure Metrics

**Method:** GET | **Path:** `/1/infrastructure/{metric}/period/{period}`

**New Format URL:**
```
https://api.lowcodeapi.com/algolia/1/infrastructure/{metric}/period/{period}?api_token=YOUR_API_TOKEN
```

**Old Format URL:**
```
https://api.lowcodeapi.com/algolia/1/infrastructure/metric/period/period?metric={metric}&period={period}&api_token=YOUR_API_TOKEN
```

**Path Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `{metric}` | string | Yes | The metric name (e.g., avg_build_time, avg_processing_time) |
| `{period}` | string | Yes | The time period (e.g., hour, day, week, month) |

**Example Request:**
```bash
curl -X GET "https://api.lowcodeapi.com/algolia/1/infrastructure/avg_build_time/period/day?api_token=YOUR_API_TOKEN"
```

## Response Format

All responses from LowCodeAPI are wrapped in a `data` key:

```json
{
  "data": {
    // Actual response from provider API
  }
}
```

The `data` key contains the raw response from the provider's API.

## Complete Endpoint Reference

| Method | New Format Path | Old Format Path | Description |
|--------|----------------|----------------|-------------|
| POST | `/2/abtests` | `/2/abtests` | Add A/B test |
| GET | `/2/abtests` | `/2/abtests` | List A/B tests |
| GET | `/2/abtests/{id}` | `/2/abtests/id?id={id}` | Get A/B test |
| POST | `/2/abtests/{id}/stop` | `/2/abtests/id/stop?id={id}` | Stop A/B test |
| DELETE | `/2/abtests/{id}` | `/2/abtests/id?id={id}` | Delete A/B test |
| GET | `/2/status` | `/2/status` | Get analytics status |
| GET | `/2/searches` | `/2/searches` | Get top searches |
| GET | `/2/searches/count` | `/2/searches/count` | Get count of searches |
| GET | `/2/searches/noResults` | `/2/searches/noResults` | Get top searches with no results |
| GET | `/2/searches/noClicks` | `/2/searches/noClicks` | Get top searches with no clicks |
| GET | `/2/hits` | `/2/hits` | Get top hits |
| GET | `/2/filters` | `/2/filters` | Get top filter attributes |
| GET | `/2/filters/{attribute}` | `/2/filters/attribute?attribute={attribute}` | Get top filters for an attribute |
| POST | `/api/1/crawlers` | `/api/1/crawlers` | Create a crawler |
| GET | `/api/1/crawlers` | `/api/1/crawlers` | Get available crawlers |
| GET | `/api/1/crawlers/{id}` | `/api/1/crawlers/id?id={id}` | Get a crawler |
| PATCH | `/api/1/crawlers/{id}` | `/api/1/crawlers/id?id={id}` | Partially update a crawler |
| POST | `/api/1/crawlers/{id}/run` | `/api/1/crawlers/id/run?id={id}` | Run a crawler |
| POST | `/api/1/crawlers/{id}/pause` | `/api/1/crawlers/id/pause?id={id}` | Pause a crawler's run |
| GET | `/api/1/crawlers/{id}/stats/urls` | `/api/1/crawlers/id/stats/urls?id={id}` | Get statistics on a crawler |
| GET | `/api/1/crawlers/{id}/tasks/{tid}` | `/api/1/crawlers/id/tasks/tid?id={id}&tid={tid}` | Get status of a task |
| POST | `/api/1/crawlers/{id}/tasks/{tid}/cancel` | `/api/1/crawlers/id/tasks/tid/cancel?id={id}&tid={tid}` | Cancel a blocking task |
| GET | `/1/events` | `/1/events` | Push events (POST) |
| GET | `/1/status` | `/1/status` | Get current API status |
| GET | `/1/incidents` | `/1/incidents` | List last incidents |

## API Definition Endpoints

To discover all available endpoints for Algolia:

| Format | URL | Description |
|--------|-----|-------------|
| New Format | `https://backend.lowcodeapi.com/algolia/openapi` | OpenAPI spec with dynamic path parameters |
| Old Format | `https://backend.lowcodeapi.com/algolia/definition` | API definition with sanitized paths |

**Example:**
```bash
curl -X GET "https://backend.lowcodeapi.com/algolia/openapi"
```

## Usage Examples

### Example 1: Create and Monitor an A/B Test

```bash
# Step 1: Create an A/B test
# No ID needed - we're creating a new test
curl -X POST "https://api.lowcodeapi.com/algolia/2/abtests?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Compare relevance models",
    "variants": [...]
  }'

# Response returns abtestID: 123456 - we'll use this in subsequent calls
# "abtestID": 123456

# Step 2: Get A/B test status
# abtestID 123456 returned from Step 1
curl -X GET "https://api.lowcodeapi.com/algolia/2/abtests/123456?api_token=YOUR_API_TOKEN"

# Step 3: Stop the A/B test when done
# Using same abtestID 123456 from Step 1
curl -X POST "https://api.lowcodeapi.com/algolia/2/abtests/123456/stop?api_token=YOUR_API_TOKEN"
```

### Example 2: Analyze Search Performance

```bash
# Step 1: Get top searches
# No ID needed - analytics endpoint doesn't require specific resource IDs
curl -X GET "https://api.lowcodeapi.com/algolia/2/searches?api_token=YOUR_API_TOKEN"

# Step 2: Get top searches with no results
# No ID needed - analytics endpoint
curl -X GET "https://api.lowcodeapi.com/algolia/2/searches/noResults?api_token=YOUR_API_TOKEN"

# Step 3: Get top filters for a specific attribute
# "category" is the attribute name we're filtering by (not an ID)
curl -X GET "https://api.lowcodeapi.com/algolia/2/filters/category?api_token=YOUR_API_TOKEN"
```

### Example 3: Crawler Workflow

```bash
# Step 1: Create a new crawler
# No ID needed - we're creating a new crawler
curl -X POST "https://api.lowcodeapi.com/algolia/api/1/crawlers?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Site Crawler",
    "config": {...}
  }'

# Response returns crawler ID: crawler_abc123
# "crawlerID": "crawler_abc123"

# Step 2: Run the crawler
# crawler_abc123 is the ID returned from Step 1
curl -X POST "https://api.lowcodeapi.com/algolia/api/1/crawlers/crawler_abc123/run?api_token=YOUR_API_TOKEN"

# Response returns task ID: task_xyz789
# "taskID": "task_xyz789"

# Step 3: Check task status
# crawler_abc123 from Step 1, task_xyz789 from Step 2
curl -X GET "https://api.lowcodeapi.com/algolia/api/1/crawlers/crawler_abc123/tasks/task_xyz789?api_token=YOUR_API_TOKEN"

# Step 4: Get crawler statistics
# crawler_abc123 from Step 1
curl -X GET "https://api.lowcodeapi.com/algolia/api/1/crawlers/crawler_abc123/stats/urls?api_token=YOUR_API_TOKEN"
```

### Example 4: Infrastructure Monitoring

```bash
# Step 1: Get current API status
# No ID needed - status endpoint
curl -X GET "https://api.lowcodeapi.com/algolia/1/status?api_token=YOUR_API_TOKEN"

# Step 2: Get infrastructure metrics
# "avg_build_time" is the metric name, "day" is the period (not IDs)
curl -X GET "https://api.lowcodeapi.com/algolia/1/infrastructure/avg_build_time/period/day?api_token=YOUR_API_TOKEN"

# Step 3: Get infrastructure metrics for different period
# Same metric, different period
curl -X GET "https://api.lowcodeapi.com/algolia/1/infrastructure/avg_build_time/period/week?api_token=YOUR_API_TOKEN"

# Step 4: List recent incidents
# No ID needed - incidents endpoint
curl -X GET "https://api.lowcodeapi.com/algolia/1/incidents?api_token=YOUR_API_TOKEN"
```

## Error Handling

Common HTTP status codes and their meanings:

| Status Code | Meaning |
|-------------|---------|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Check your API token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Invalid endpoint or resource ID |
| 429 | Rate Limit Exceeded - Too many requests |
| 500 | Internal Server Error - Contact Algolia support |

For detailed error information, refer to the [Algolia REST API documentation](https://www.algolia.com/doc/rest-api/search/).

## Official Documentation

- [Algolia REST API](https://www.algolia.com/doc/rest-api/search/)
- [A/B Testing API](https://www.algolia.com/doc/rest-api/ab-test/)
- [Analytics API](https://www.algolia.com/doc/rest-api/analytics/)
- [Crawler API](https://www.algolia.com/doc/rest-api/crawler/)
- [Monitoring API](https://www.algolia.com/doc/rest-api/monitoring/)