Thank you for writing the function. Can you explain how the code is injected into the page and provide an example of how to use the function with an API endpoint?