Pulling API calls into body text of a blog post

I run the lastest version of Ghost, hosted by Ghost, using the latest Krabi theme.

I also have a paid subscription to iexcloud.io, which is an API to provide data around stocks. The purpose of my site is to share due diligence articles on stocks that I like or hold, and I’d like to use the API for it to pull metrics through into my blog posts (e.g. latest stock price, etc) so my articles remain up-to-date and relevant.

How do I embed these into my blog posts? I’ve tried using the HTML snippet for it, but I can’t seem to get it to work.

As an example, I may in my blog post have a sentence like “The current share price of Apple is $xyz”, where $xyz then needs to show the real-time price from an API call that is in the format of “https://cloud.iexapis.com/stable/stock/aapl/quote?token=YOUR_TOKEN_HERE” (my API token not mentioned for obvious reasons).

Any help would be greatly appreciated. Thank you.

1 Like