# An AnkiConnect alternative that works without Anki open

AnkiConnect lets a script talk to Anki Desktop, but only while the desktop app is running on the same machine. The Ankinize REST API does the same job on a server: scripts, CI jobs, AI agents and browser extensions add and read cards with no desktop app open, and the cards sync to Anki on every device.

## AnkiConnect and Ankinize side by side

|   | AnkiConnect | Ankinize REST API |
| --- | --- | --- |
| What it is | An add-on that opens an HTTP port inside Anki Desktop. | A sync server that exposes the same Collection over REST. |
| Anki Desktop must be running | Yes, on the same machine (localhost:8765). | No. The API runs on the server. |
| Reach it from a server, CI or a phone | Not without tunnelling your desktop. | Yes, over HTTPS with an API key. |
| Gets cards to your devices | Through Anki's own sync, after you sync the desktop. | Cards sync to Anki Desktop, AnkiDroid and AnkiMobile the next time they sync. |
| Search | Anki search syntax with findNotes and findCards. | The same Anki search text in `q`, plus typed builders in the SDK. |
| Batches and safe retries | multi for several actions. | Batch endpoints, and an `Idempotency-Key` header so a retry never adds a card twice. |
| Drive Anki's windows (browser, add dialog) | Yes: the gui actions. | No. It works on the data, not the interface. |
| Account and cost | None. Free and local. | An Ankinize account (free 200 MB), or your own server. |
| Who maintains it | A community add-on, outside the Anki team. | Ankinize, independent of Anki and AnkiWeb. |

> When AnkiConnect is still the right tool
> 
> If you only automate on the machine where Anki runs, need to open the browser or the add dialog, or depend on a tool that already speaks AnkiConnect, keep it. Ankinize is for the cases AnkiConnect cannot reach: no desktop, no localhost, many devices.

## Add a note

The same task in both. Ankinize names a note type and a deck as strings, and keys fields by camelCase name (`Back Extra` is `backExtra`).

```
curl localhost:8765 -X POST -d '{
  "action": "addNote",
  "version": 6,
  "params": { "note": {
    "deckName": "Reading", "modelName": "Basic",
    "fields": { "Front": "What is FSRS?", "Back": "A spaced repetition scheduler." }
  } }
}'
```

## Find notes

Anki's search syntax carries over, so a query you have already written for AnkiConnect works unchanged.

```
curl localhost:8765 -X POST -d '{
  "action": "findNotes", "version": 6,
  "params": { "query": "deck:Reading is:due" }
}'
```

## Action by action

| AnkiConnect action | Ankinize endpoint |
| --- | --- |
| deckNames, deckNamesAndIds | `GET /api/v1/decks` |
| createDeck | `POST /api/v1/decks` |
| addNote | `POST /api/v1/notes` |
| addNotes | `POST /api/v1/notes/batch-create` |
| findNotes | `GET /api/v1/notes?q=` |
| findCards | `GET /api/v1/cards?q=` |
| notesInfo | `GET /api/v1/notes/{id}` |
| updateNoteFields | `PATCH /api/v1/notes/{id}` |
| deleteNotes | `POST /api/v1/notes/batch-delete` |
| getTags | `GET /api/v1/tags` |
| storeMediaFile | `PUT /api/v1/media/{name}` |
| answerCards | `POST /api/v1/cards/{id}/answer` |

## Next

Make a key under *API Keys & Devices* (see [Authentication](https://ankinize.com/docs/authentication)), then try the calls in the [API reference](https://ankinize.com/docs/api) or install the [TypeScript SDK](https://ankinize.com/docs/sdk). To let an AI agent do it, read [AI agents and Ankinize](https://ankinize.com/docs/agents).
