Feature Request: JavaScript API for AnkiMobile

There is JS API for AnkiDroid and I created addon for supporting unofficial JS API.

How it will help in card template design?
Using JS API know about card is new, learn or review then show some fields of cards when card is new and hide when it is review or learn.

For e.g.
There are four fields in practicing hanzi writing by drawing strokes. (Simplified, Traditional, Pinyin, Meaning)
So, when cards are new then show simplified and traditional characters with outline hint. But when cards are review then hide those fields and hint.

On AnkiDroid using JS API

AnkiDroidJS.ankiGetCardType()

On AnkiDesktop using unofficial JS API.

pycmd("AnkiJS.ankiGetCardType()", (ret) => {
    console.log(ret);
});
2 Likes

I’m afraid I don’t have the resources to support this at the moment, but maybe one day.

@krmanik just curious, what will you use this for ?

I want to create cross platform gamified Anki decks.
This is possible only with Anki JS API.