Call external program and copy stdout

How can I call an external program and copy stdout into the editor?

I would like to use BBT CAYW feature to insert my Zotero citaitons, since I don't like the Zotero import feature of the visual editor

Well in the meantime I came up with this to use the BBT CAYW feature:

#!/usr/bin/env bash

curl 'http://127.0.0.1:23119/better-bibtex/cayw?format=pandoc' 2>/dev/null | wl-copy
sleep 0.5s
# Press LEFTCTRL, press V, release V, release LEFTCTRL
ydotool key 29:1 47:1 47:0 29:0