The anki-connect addon runs a local server that cardbuilder could post to create Anki cards in real time. We could likely achieve something similar by directly making changes to Anki's database, but it seems safer and easier to reuse existing software for this.
Documentation for note related API calls is here and documentation for handling media is here.