tyrauber / stock_quote

A ruby gem that retrieves stock quotes from IEX
MIT License
211 stars 55 forks source link

Endpoints that used to work now give "unexpected token" errors #62

Closed zadamsr closed 5 years ago

zadamsr commented 5 years ago

I had automation that used endpoints provided through this gem. One example is a simple:

stock_chart = StockQuote::Stock.raw_chart('AAPL','5y')

This used to return with the stock_chart json object but now it returns this error:

ERROR: 765: unexpected token at 'Forbidden' C:/Ruby25-x64/lib/ruby/2.5.0/json/common.rb:156:in parse' C:/Ruby25-x64/lib/ruby/2.5.0/json/common.rb:156:inparse' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/stock_quote-2.0.0/lib/stock_quote/stock.rb:68:in block in request' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rest-client-2.0.2-x64-mingw32/lib/restclient/request.rb:807:inprocess_result' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rest-client-2.0.2-x64-mingw32/lib/restclient/request.rb:725:in block in transmit' C:/Ruby25-x64/lib/ruby/2.5.0/net/http.rb:910:instart' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rest-client-2.0.2-x64-mingw32/lib/restclient/request.rb:715:in transmit' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rest-client-2.0.2-x64-mingw32/lib/restclient/request.rb:145:inexecute' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rest-client-2.0.2-x64-mingw32/lib/restclient/request.rb:52:in execute' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/stock_quote-2.0.0/lib/stock_quote/stock.rb:67:inrequest' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/stock_quote-2.0.0/lib/stock_quote/stock.rb:63:in batch' C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/stock_quote-2.0.0/lib/stock_quote/stock.rb:25:inblock (2 levels) in create_method'

tyrauber commented 5 years ago

Unfortunately, it looks like IEX terminated these API endpoints. The whole test suite is failing with 403 Forbidden.

Details:

Stock data is now available on IEX Cloud.

IEX Cloud is a flexible financial data platform connecting a wide array of developers with curated financial data. On June 1, 2019, IEX Group removed all non-IEX data, and certain functionality, according to the schedule. IEX Cloud, a non-Exchange platform, will continue to provide access to third-party data sources.

It's probably worth migrating to the iex-ruby-client.

tyrauber commented 5 years ago

@zadamsr The gem is updated and bumped to 3.0.0. An API KEY is now required, unfortunately.

StockQuote::Stock.new(api_key: YOUR_API_KEY)

Otherwise, usage and responses remain the same.