> Part of the Rephonic API reference. The full list of pages is at https://rephonic.com/llms.txt.

# Autocomplete

> Suggestions as someone types a search.

```
GET https://api.rephonic.com/api/search/autocomplete/
```

Suggest search terms and podcasts as someone types in a search box. What comes back depends on the `mode`.

| Mode         | `suggestions`   | `podcasts`                  |
| ------------ | --------------- | --------------------------- |
| `topics`     | Topics          | Podcasts whose name matches |
| `titles`     | Empty           | Podcasts whose name matches |
| `publishers` | Publisher names | Empty                       |
| `episodes`   | Topics          | Empty                       |

## Parameters

| Field | In | Description | Default | Max | Required |
|-------|----|-------------|---------|-----|----------|
| mode | query | The kind of search the user is doing. One of `topics`, `titles`, `publishers`, `episodes`. |  |  | Yes |
| query | query | What the user has typed so far. |  |  | Yes |

## Response Fields

- `suggestions` (array of strings): Suggested search terms. In `topics` and `episodes` mode these are topics. In `publishers` mode they are publisher names. Empty in `titles` mode.
- `podcasts` (array of objects): Podcasts whose name matches the query, in `topics` and `titles` mode. Empty in the other modes.
  - `id` (string): The podcast's Rephonic ID.
  - `name` (string): The podcast's name.
  - `publisher` (string): The publisher's name.
  - `artwork_thumbnail_url` (string): The cover art, 70 by 70 pixels.

## Example Request

```bash
curl -G https://api.rephonic.com/api/search/autocomplete/ \
  -H "X-Rephonic-Api-Key: YOUR_API_KEY" \
  --data-urlencode "mode=topics" \
  --data-urlencode "query=marketing"
```

## Example Response

```json
{
  "suggestions": [
    "marketing",
    "digital marketing",
    "marketing strategies",
    "online marketing",
    "media marketing",
    "content marketing",
    "social media marketing",
    "marketing tips",
    "business marketing",
    "marketing agency"
  ],
  "podcasts": [
    {
      "id": "social-media-marketing-podcast",
      "name": "Social Media Marketing Podcast",
      "publisher": "Michael Stelzner, Social Media Examiner",
      "artwork_thumbnail_url": "https://img.rephonic.com/artwork/social-media-marketing-podcast.jpg?width=70&height=70&quality=95"
    }
  ]
}
```
