No, no, no. Hold on. Read the API carefully: Lichess.org API Docs. You have many options. You can query games since & until, you have to convert the datetime to an epoch first, and then send it. You have an option to get a maximum number of requested games as well, max=30 for example: https://reqbin.com/jqg7yxni. reqbin is like pastebin, but instead of text I share the example request. Please take a look, it works. You shouldn't fetch all games first. I can help you with the query if you struggle to figure it out.
CBH doesn't store games in PGN, so first you would have to convert them to PGN and then add them to a note, possibly with filters like max games to import or since & until, or who played etc. But mind it's brutally massive, like 15-30MD to implement, it's just an idea, I don't know how much motivation you have to develop this plugin.
You can take a look at Obsidian plugins as well, there's probably a lot of code you can copy & paste: Plugins for Chess - Obsidian Hub - Obsidian Publish.
Yes, that's why it's so tricky. You would have to add a separate config on top of fen like
```diagram
fen: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP
arrow a4->c6 : red
arrow h2->c2: yellow
highlight: c5 blue
\```
Thank you for your effort! Now it works, just tested.
It's so frustrating that the diagram loses focus when I scroll through the moves, it's high priority to fix it