There’s very little difference between mobiledoc and lexical in that regard, the underlying formats are different but functionally “cards” work very similarly in both editors.
There are two ways to insert cards:
1. Inside HTML with ?source=html
To create an embed via the HTML conversion you’d need to do something similar to what the editor itself does which is make an oembed API request to fetch the iframe HTML from the external embed source. Once you have that HTML you can put it in your HTML as an iframe:
<iframe src="${original embed url}">${fetched embed html}</iframe>
For bookmarks you’d need to do something similar and use metascraper or equivalent to fetch all of the necessary metadata and then build the bookmark card HTML manually using the same classes you see when Ghost renders a bookmark card on the front-end.
Ghost does have an endpoint for fetching embed/bookmark data at /ghost/api/admin/oembed/?url=${url to embed} that you can use to fetch the data ready for HTML creation. If you add an embed/bookmark card in the editor with your browser’s developer tools open you’ll be able to inspect the request and the data it gives you back.
2. Directly using the mobiledoc (original editor) / lexical (beta editor) formats
Here the process would be similar to the above with the requests to fetch the embed HTML or metadata from the external source but then you can add that data directly to a card payload in the source content. Downside to this approach is that it requires all of your content to be created in that format.