Open web developer tools and go to the "Network" tab
Load a page of Lemmy while logged in
Right-click on one of the network requests, select Copy Value -> Copy as curl
Paste the resulting value to command line in a place that has curl; that'll give you a request that has the right auth tokens and etc
Backspace over the actual URL so you can replace it with the API calls you need
Use --request GET --url "https://$server/api/v3/post/list?liked_only=true" --header 'accept: application/json' to get liked posts as JSON
Use --request GET --url "https://$server/api/v3/comment/list?GetComments=liked_only=true" --header 'accept: application/json' to get liked comments as JSON