Recommendations for viewing flame graph on API request?

Hello! I’m wondering if there is a more straightforward way to view a flame graph on an API request (i.e. non-HTML) than to save the HTML to disk and open it in a browser? Thanks!