Every anki card is just a webview. Its very possible to call an api
https://docs.ankiweb.net/templates/intro.html
----
But you'd want AnkiConnect, or a Python-based addon for your workflow
> Anki desktop app auto-launch > Perhaps the most precarious aspect of the Anki-Connect add-on is that the Anki desktop application must be running for any of the API calls to work. Yanki Connect tries to sand down this rough edge by (optionally) automatically launching the Anki desktop app if it's not running already.