Actions
April 27, 2025 ยท View on GitHub
All actions here work exactly the same as Anki-Connect unless specified otherwise.
All calls support the version <= 4 and > 4 format.
Versions <= 4 returns the plain result on success (with no JSON object wrapping said result).
However, versions > 4 returns a JSON of the following format on success:
{
"result": (result),
"error": null
}
On error, all versions will send the following:
{
"result": null,
"error": (error)
}
Do not expect the error message to be the exact same as the PC Anki-Connect error messages.
Deck Actions
deckNames
- See: Anki-Connect
deckNames - Used by Yomichan
deckNamesAndIds
- See: Anki-Connect
deckNamesAndIds - Used by Yomichan
Model Actions
modelNames
- See: Anki-Connect
modelNames - Used by Yomichan
modelNamesAndIds
- See: Anki-Connect
modelnamesandids - Used by Yomichan
modelFieldNames
- See: Anki-Connect
modelFieldNames - Used by Yomichan
Note Actions
findNotes
- See: Anki-Connect
findNotes - Attempting to escape a query with spaces using quotes will not work, unless
AnkiDroid is using the new (Rust) backend.
For example, the following query will not work:
"Note:My Mining Note" - Expect this to take longer to run compared to the PC version of Anki-Connect.
- Used by Yomichan
guiBrowse
- See: Anki-Connect
guiBrowse - This call only works with AnkiDroid versions past October 8, 2022 (2.16alpha88 and above)
- Used by Yomichan
canAddNotes
- See: Anki-Connect
canAddNotes - Internally, this behaves entirely different from Anki-Connect. Anki-Connect literally attempts to add
a note (without saving the collection) in order to determine whether the note can be added or not.
AnkiConnect Android instead queries the collection with the first field, and sees if any other cards
exist.
For example, if your first field was
Word,canAddNotesdetermines whether a note can be added or not by seeing if the queryWord:(WORD FIELD CONTENTS)finds any matches. Finding any match will returnfalse, and no matches will returntrue. - Because this internally queries the database, this action suffers from the same problems as
findNotes. To guarantee the correctness of the query, you must use the new backend. - If all notes have the same model, then the call is optimized as we can call an internal Ankidroid API function on the entire set of data.
- Used by Yomichan
canAddNotesWithErrorDetail
- See: Anki-Connect `canAddNotesWithErrorDetail
- Currently, if a card fails
canAddNotes, the error message will always say it's due to it being a duplicate, even if there was a different reason for the failure (For example, in Anki-Connect a card could fail thecanAddNotescheck if the first field was empty). - Used by Yomitan
notesInfo
- See: Anki-Connect
notesInfo - Used by Yomitan
addNote
- See: Anki-Connect
addNote - Used by Yomichan
- Anki-Connect desktop allows using various formats for the media file, but this api currently only
supports using the
urlanddatafield. Does not supportskipHashfor theurlfield. All ofpicture,audioandvideoare supported.
updateNoteFields
- See: Anki-Connect
updateNoteFields - See addNote for supported media actions.
Media Actions
storeMediaFile
- See: Anki-Connect
storeMediaFile - Filenames will get a random number appended to the end of them, i.e.
file.pngbecomesfile_123456789.png - Used by Yomichan
Miscellaneous Actions
multi
- See: Anki-Connect
multi - Used by Yomichan