Support » Plugin: Stock Ticker » Plugin not working

  • Resolved michael.plyler

    (@michaelplyler)


    It appears that the Google Finance API is offline or has been removed?
    If this is the case, will you have an update the pulls this data from another API?

Viewing 15 replies - 1 through 15 (of 45 total)
  • I noticed this as well, can we please have an update asap as it’s not working for anyone.

    Not working for me either

    Hello all,

    Unfortunately, Google in this September removed free API we used for stock data. This was URL from where we until now grabbed data for stock https://finance.google.com/finance/info?client=ig&q=MSFT,AAPL but /info resource does not exists anymore.

    I’ll try to find other stock resource allowed on WordPress.org. If anyone have some advise, I’ll be happy to update plugin to use other stock resource.

    Thank you for understanding,
    Aleksandar U.

    @ecommonist well, my plugin used Yahoo Finance as resource for stock quotes at the same beginning, but then plugin was suspend from wordpress.org because of that. Then I switch to allowed Google Finance to get back plugin in the repo.

    In short – Yahoo Finance is not allowed to be used in plugins hosted on wordpress.org

    Is there an option for a paid version or a way to host it externally?

    Link after yahoo proposal has instructions to reuse google finance data, a csv sheet still working by now.

    Hi @ecommonist,

    Thanks for pointing that out.

    I look more now when I’m back to office, and I see that existing Google Finance JSON per symbol like https://finance.google.com/finance?q=NASDAQ:AAPL&output=json contains change value and percentage (what Stock Ticker provide to users), but unfortunately does not have last trade date and time info, and that is must have.

    Also, that JSON can provide stock data only for single symbol, and size is over 15KB per symbol. There is no much users who use just couple symbols in ticker (under 5), so downloading and parsing such large amount of JSON data does not look like reasonable approach (requesting 10 threads from Google for 10 symbols will be over 150KB of data and 9x slower than single request.

    I’ll look further for full replacement solution. If I do not find anything acceptable, I’ll run poll for Stock Ticker users and ask them what they wish to have (for example, if last trade has not required, then this JSON from Google Finance will work).

    Cheers,
    Aleksandar

    Hello guys,

    I’ll probably have some beta version of plugins ready next week, which will utilize AlphaVantage.co API. I’ll post update and progress to this thread, to thread for my other plugin https://wordpress.org/support/topic/fix-for-api-breakage/ and on my website https://urosevic.net/wordpress/plugins/stock-ticker/ and https://urosevic.net/wordpress/plugins/stock-quote/

    Aleksander, looking forward to a solution and an updated version of your stock ticker plug-in. Good luck!

    Flexer

    (@flexer)

    Aleksander I am too, looking forward to a solution and an updated version of your stock ticker plug-in.

    Plugin Author Aleksandar Urošević

    (@urkekg)

    Hello everybody,

    Please find ALPHA-1 version of future 0.3.0 release of Stock Ticker on https://drive.google.com/open?id=0B8BerXvnwoN3cjF0eGptMWVqN1U

    This to work you have to:

    1. Get free API Key from AlphaVantage.io https://www.alphavantage.co/support/#api-key
    2. Field Alpha Vantage API Key: Set AV API Key in plugin global settings as shown on screenshot https://goo.gl/3PKxLM
    3. Field All Stock Symbols: Enter all stock symbols you’ll use on website, separated by comma. This field is used to fetch stock data from AlphaVantage.co API by AJAX in background. Because AV have only API to get data for single symbol, that can take a while to get.
      Please note, for default symbols we still have field in Default Settings section.
    4. Enable Auto Refresh option because on first load if we do not have data downloaded from AV.co they will be loaded through AJAX after a while.

    Please note, test this on dev/staging websites, not recommended for live websites at the moment.

    Any thoughts, please feedback to this thread.

    Thank you in advance for help to make Stock Ticker perfect again 🙂

    Regards,
    Aleksandar

    Hi Aleksander<
    Thank you for this.

    I installed the plugin on a staged install.
    Got the API
    Entered the symbol. Only need one for this site.
    > This is on the Toronto Stock Exchange
    So defined as per https://pypkg.com/pypi/alpha-vantage/f/alpha_vantage/alphavantage.py
    TSE:SYMBOL in both widget and Global Setting
    Got the value! But rather than $9.68 got $9,6800> So possibly a typo in the decimal?

    Thanks again for your hard work,
    Daveed

    • This reply was modified 3 months, 4 weeks ago by  Flexer.

    @urkekg : Me again. Just noticed that I am getting consol response [Stock Ticker update quotes response: null] even with a value.
    > Refreshing (soft) sometimes returns a value sometimes not.
    > probably has to do with the API call, so understandable.

    Daveed

    Hi @flexer,

    Decimal and thousand separator and number of decimal places will be options in plugin settings. It’s first TODO item for new version.
    At the moment I set it to European format by default – dot for thousand and comma for decimal dot, with four decimal places.

    This is how I made this to work:

    1. I check is there still valid (not expired) transient cache for global symbols.
    2. If transient cache is still valid, then I use that one as localy stored data, and render ticker elements for each symbol.
    3. If transient cache is expired, then first page load will display ‘Unfortunately…’ error message, but auto refresh will load data after they are fetched from AlphaVantage API. I do this to prevent blocked page rendering. But, I’ll probably change this and I leave ‘Loading…’ message until we get stock data and have it ready for displaying.
    4. There is one AJAX call on page load that ping plugin to check do we need to fetch new data from API (If transient cache expired). At the moment that “ping” executes after rendering AJAX request (previously mentioned ‘unfortunately…’ message if no valid transient cache)
      Now I first ping for update check, then try to render ticker.
    5. If transient cache expired, I fetch data from API for each global symbol (one by one), crunch received data for each symbol and pack everything to single transient cache entry in WP.
    6. Cache timeout (180 seconds by default) is time to make transient cache valid for. After that time expire, I fetch new data from Alpha Vantage
    7. On each settings update I invalidate transient caches, in case that user changed global symbols or cache timeout so we have to get new data from API

    I noticed that AlphaVantage.co API is not super fast, and often return error (for example I set 4 global symbols, data is fetched for 1st and 2nd, then fail for 3rd and success with 4th).

    Alpha Vantage support:

    • Various stock exchanges, so for example TSE:ACB will provide prices for https://web.tmxmoney.com/company.php?qm_symbol=ACB&locale=en
    • Indexes which should be entered with leading dot, for example .DJI for Dow Jones Industrial Average
    • Currencies, if entered in format with following =X, for example EURGBP=X

    Regarding message in console “Stock Ticker update quotes response: null” – that is resolved (and it’s just debugging info for me during development, that ‘null’ means that there is no need to fetch new data from AV because transient cache is still valid). You’ll not see that console error anymore.

    Updated version 0.2.99-alpha2 https://drive.google.com/open?id=0B8BerXvnwoN3bk0zRkZfaDlFVFk

    Thank you,
    Aleksandar

Viewing 15 replies - 1 through 15 (of 45 total)
  • You must be logged in to reply to this topic.