business-science / riingo

An R interface to the Tiingo stock price API
https://business-science.github.io/riingo/
Other
51 stars 9 forks source link

Tiingo News API `start_date`/`end_date` not respected #15

Open DavisVaughan opened 3 years ago

DavisVaughan commented 3 years ago

@tiingo Hey Tiingo team. I'm working on exposing the News API, but it doesn't look like the start/end date parameter is being respected. Is this expected? Look how the published date contains dates in April of this year, even though I limit it to February.

> x <- riingo_news("AAPL", end_date = as.Date("2020-02-01"))
> x
# A tibble: 100 x 9
   tags        id tickers  url         description       publishedDate       source title     crawlDate          
   <list>   <int> <list>   <chr>       <chr>             <dttm>              <chr>  <chr>     <dttm>             
 1 <chr …  2.47e7 <chr [6… https://ww… Tech is one of t… 2020-04-22 12:12:00 zacks… Coronavi… 2020-04-22 13:32:43
 2 <chr …  2.47e7 <chr [2… https://ww… Sophisticated ha… 2020-04-22 12:00:00 wsj.c… Apple iP… 2020-04-22 12:09:43
 3 <chr …  2.47e7 <chr [3… https://ww… Franco-Italian c… 2020-04-22 11:58:22 reute… STMicro … 2020-04-22 12:26:21
 4 <chr …  2.47e7 <chr [3… https://ww… Franco-Italian c… 2020-04-22 11:57:35 reute… UPDATE 2… 2020-04-22 13:26:40
 5 <chr …  2.47e7 <chr [7… https://ta… Major equity ind… 2020-04-22 11:46:15 talkm… After Bi… 2020-04-22 11:46:21
 6 <chr …  2.47e7 <chr [5… https://ww… The United State… 2020-04-22 11:24:00 reute… American… 2020-04-22 12:23:38
 7 <chr …  2.47e7 <chr [3… https://ww… These two chipma… 2020-04-22 11:15:00 fool.… 2 Cash-R… 2020-04-22 11:41:08
 8 <chr …  2.47e7 <chr [4… https://ww… The U.S. governm… 2020-04-22 11:14:45 reute… Factbox:… 2020-04-22 12:22:05
 9 <chr …  2.47e7 <chr [5… https://ww… The United State… 2020-04-22 11:06:38 reute… INSIGHT-… 2020-04-22 13:27:24
10 <chr …  2.47e7 <chr [6… https://fi… Here is a sneak … 2020-04-22 10:43:10 finan… 5 Large-… 2020-04-22 11:59:39
# … with 90 more rows

This is the URL that gets passed through

https://api.tiingo.com/tiingo/news?tickers=AAPL&startDate=2019-07-22&endDate=2020-02-01&limit=100&offset=0
tcash21 commented 2 years ago

Loving this package @DavisVaughan! I've noticed an issue with getting news in general lately. Not sure if Tiingo API is just down or if the endpoint has changed (see image) Screenshot

DavisVaughan commented 2 years ago

The status page says "some services are experiencing issues" https://status.tiingo.com. Any thoughts @tiingo?

tiingo commented 2 years ago

Hey @DavisVaughan that was related to a crypto incident that has been stable for two weeks now. Just posted a quick update there. News is unaffected.

403 error code means that the API token is not correct - or has not been passed.

tiingo commented 2 years ago

For why start/end dates are not respected - News API dates on the Power plans go back 3 months of history + ongoing updates. If you need historical data prior to that, you must get an enterprise account and we can do a data export (APIs are not the best for delivering that massive amount of data)

tcash21 commented 2 years ago

My API token works for ticker prices, is it a separate API key for news?

tiingo commented 2 years ago

Ah! Do you have a subscribed Power plan by chance? News API is only available for paid plans at this time. That could be it