There’s a couple of ways to do this. The simplest is to use an ajax call to the endpoint in the rails API that serves the data you want to display. If you want the latest 20 topics, then you might want to try /latest.json.
The challenge is if you need to combine info from multiple endpoints you then wait on multiple calls to complete which can really slow performance down in the theme component.