Get Confluence page source Code (HTML?) in a User Macro

I’ve come to contact you here because I’m having some trouble understanding how to create a specific User Macro.

Indeed, I am currently looking for a way to retrieve the source code of a Confluence page in order to extract a list of all the Issues listed on it. The final goal is to create a list of all the issues present on the page.

Could you help me to understand how to make this user macro? (documentations / code allowing me to recover the HTML code etc…).

Thanks in advance for your help!