Tried any of the below?
AnkiConnect (HTTP API): https://git.foosoft.net/alex/anki-connect
Rust: https://github.com/ankitects/anki/tree/main/rslib via Protobuf: https://github.com/ankitects/anki/tree/main/proto/anki
Rough DB Schema (outdated, but sufficient): https://github.com/ankidroid/Anki-Android/wiki/Database-Stru...