If you’ve ever envied the big financial sites with their up-to-the-minute stock market data, now you can have the same functionality on your site. Adding stock market data to your WordPress website is easy with a stock market ticker plugin.
“Ticker” is one of those funny names that’s a holdover from long ago. Mechanical stock market tickers were used for 100 years, but in the 1960s, they became obsolete when computers took over the delivery of stock market data.
Yet here we are, half a century later, still calling any dynamic listing of stock data a “ticker.”
Be that as it may, once you’ve decided that you want a stock market widget for your website, there are more than a few to choose from. They’re all variations on the same theme, but we like the Stock Ticker WordPress plugin, so that’s what we’re going to use here.
Installing the Stock Ticker WordPress Plugin
Log in to your WordPress admin panel.
In the left column navigation mouse over the “Plugins” link and click the “Add New” link.
In the “Search plugins…” box, enter “Stock Ticker.”
Once you have located the plugin, click the “Install Now” button.
When the plugin has been installed, click the “Activate” button.
Obtaining and Entering an API Key
Before you can use the Stock Ticker WordPress plugin, you have to get an API key from AlphaVantage.co. Alpha Vantage supplies the quote data for the plugin (which is updated every 15 minutes). They can provide data from 23 different exchanges, so they likely have you covered no matter which exchanges you’re interested in.
You can get a free API key that is limited to five requests per minute. If you want to update more than five times per minute, premium tiers are available. From what I can see, if you maintain a relatively small list of stock symbols, the free API does the job quite well.
“Requests” are API calls, not page loads, so most of us won’t have to worry about too many visitors crashing the plugin. I tried to crash it with a URL tester loading the site from 25 different locations simultaneously, and I couldn’t kill it. But if you do need to increase API calls, the premium tiers are available.
Once you have the API key, here’s how you add it to the stock market ticker. In the left column navigation, mouse over the “Settings” link and click the “Stock Ticker” link.
The first of the general settings is “AlphaVantage.co API Key.” Enter your key in the field, scroll down to the bottom of the page, and click the “Save Changes” button.
You can configure which stocks are displayed using added shortcode elements. But for this tutorial, we’re going to use the generic shortcode without any customization. We’ll do all of our customizations in the plugin settings.
Basic Stock Ticker Plugin Configuration
By default, the plugin shows stock market ticker data for Microsoft, Apple, and Intel. So right out of the box, if you enter the [stock_ticker] shortcode into a post or page, the information for those stocks will scroll across the screen.
If you go to the “All Stock Symbols” field, you’ll see the ticker symbols for Microsoft, Apple, and Intel (AAPL,MSFT,INTC).
Those are all well and good, but it’s getting close to lunchtime as I type this, so let’s add something tastier. Like Pizza Hut, Chipotle, and Ruth’s Chris Steak House (YUM,CMG,RUTH).
And since I’m more likely to be eating a cup of noodles than steak, we’ll add Nissin (NFPDF) as well.
After the “All Stock Symbols” field has been updated, scroll down and click the “Save Changes” button.
Since we’ve changed the data we’re requesting from the API, in the “Force data fetch” section, click the “Fetch Stock Data Now!” button. The display will let you know when the data has been fetched.
As you can see, the plugin fetches data for all of the ticker symbols listed in the “All Stock Symbols” field. We added to that list rather than replacing AAPL,MSFT,INTC because we may want to display the tech company data at some point.
But if you are not likely to display data for one or more of the symbols, it’s best to delete them from the “All Stock Symbols” field.
A bit further down, in the “Stock Symbols” section, is where we list the stocks that we want to display. We want to stop displaying the tech companies data and replace them with the food companies. So we replace the tech company symbols with the food company symbols.
Scroll down and click the “Save Changes” button, and you can see that the food companies have replaced the tech companies in our post.
Adding Company Names
As you can see, the data for our newly added symbols is showing up fine, but the company names are missing. If the symbols alone serve your purposes, you don’t have to change anything.
But if you want to display the food company names the same way the tech company names were displayed, scroll down to the “Custom Names” section.
Here you will add the stock ticker symbol followed by a semicolon and the company name. So I’m going to add:
Scroll down and click the “Save Changes” button.
Now the company names are displayed.
Note that if you want to display the company name and the ticker symbol, you will update the “Custom Names” section with something like this:
Displaying Currency Markets
Another cool thing the Stock Ticker plugin will do is display currency markets.
If you scroll down to the bottom of the “Custom Names” section, you can see an example, comparing the Euro to the British Pound.
So for example, if we wanted to see where the Euro stands in relation to the U.S. Dollar, we could copy that line in the “Custom Names” section, paste it below the Euro/Pound line and edit it.
Then in both the “All Stock Symbols” and “Stock Symbols” fields, enter EURUSD.
Scroll down and click the “Save Changes” button.
Click the “Fetch Stock Data Now!” button.
Now our site displays the relationship between the Euro and the Dollar.
Not for Investing Purposes
You may have noticed the disclaimers made by the plugin author, stressing that the plugin should be used “for informational and educational purposes only,” and that it shouldn’t be considered investment advice. That’s true, and we should probably reiterate that point.
The stock data is provided by a third party, and it is delayed up to 15 minutes, so you probably wouldn’t want to be hitting refresh on a browser running this plugin, using it to decide when to BUY! or SELL!
Would you consider using this plugin on a financial-themed site? Can you think of any cool uses for the currency comparison data?
Author: Michael Phillips
Michael Phillips is a web hosting industry veteran, helping people make the most of their web presence since 1995.