Yahoo finance API Quotes wrong date randomly - between today and yesterday days ago - yahoo-finance

I am using the yahoo finance API to get the price quotes from the market that has closed. I usually run the API at about 11pm at night (USA time). The API will return today's market data some times and yesterdays market data sometimes. It seems to be random and if you run it a few times in a row you can see it randomly switching between these dates. How can I get it to consistently return the latest quotes and not yesterday's quotes?

Related

Google Sheets - How to set a daily shift reminder on sheets (kind of)

I've been trying to do this for a while but can't find a solution. At work there is a special task that needs to be done daily by different people, on rotating shifts. I am trying to create a simple file in sheets in which you can go and clearly see who should be doing that tasks that day.
The data comes from a schedule that is located within the same file. Every day different people are supposed to do these tasks
So what I am trying to do is basically a formula (s) that will recognize what day is today and present it so everyone knows who is supposed to do those tasks today. This should update itself everyday, taking the data from the database. So if today is Friday 20/08/2022 it will show whatever is on the database for that date. If today is Saturday 21/08/2022 it will update and reflect what the schedule/database has.
Sounds pretty easy but I dont know where to start.
Thanks for your help!
try:
=FILTER(C:G; A:A=TODAY())

I use =GOOGLEFINANCE in my google sheet. Does it update hourly even when the sheet is closed?

here is my spreadsheet https://docs.google.com/spreadsheets/d/1jU8n0xVcN8M1h9a6rOaN8Cjax7J6znJc2ZXgoioY8oc/edit?usp=sharing
I use it to track my portfolio. I have a script enabled that scours the internet for the current market values of my investment funds (since some are not available as tickers on GOOGLE FINANCE). However, some are available on GOOGLE FINANCE (e.g. VOO and VXUS). The ones I scripted update once daily, then I have a another script to log each daily value on a history log so I can see how it changes over time.
My question is, when the sheet is closed, i.e. not open by me on any device, does the google finance formula (i.e. =iferror(GoogleFinance(B6,"price"),"No Data")) update hourly as well?
I have already gone to File>Settings>Calculations>Enabled Calculation Refreshes every hour.
My question is simply if this hourly-updating only works when the sheet is open, or does it work when the sheet is closed?
Thank you very much.
AFAIK there is no official documentation for that, as GOOGLEFINANCE can't be retrieved programmatically due to Google restrictions, it doesn't make sense that these formulas be recalculated when nobody has the spreadsheet open.

Yahoo finance or google finance will block if i will subscribe all stocks?

I want to retrieve all stocks from few exchanges - by retrieve the stocks that inside those exchanges (by taking from http://www.nasdaq.com/screening/company-list.aspx).
And then I will quote for all stocks from google or Yahoo.
My question is if I will quote all of them for every 5 seconds or 10 seconds - will they block me?
What is the correct way for getting all stocks and they updated data?
Thanks!
David,
tl;dr - yahoo finace is OK (scraping 2,000 stocks) if you insert pauses in your code
I have some clumsy, but working code (my first attempt at scrapping) that pulls some data from Yahoo Finance. While I don't like the code and I will rewrite it for nasdaq.com in following weeks, I can tell you that I'm not getting blocked.
I have a few years old list of stocks for Russel 2000 so there are around 2,000 tickers I'm slowly going through and pulling some data from balance sheet. I'm using Selenium (see my question history, there is only one to see/get working code), code loads Chromium web browser (Linux) clicks on Balance sheet, scrape some data, clicks quarterly link, scraps more data and then closes the browser. For every ticker (stock).
Just to be on a safe side, I put several pauses into my code, for every scrap or navigation on site I added between 5 and 10 seconds. That way I'm slowly scraping data and Yahoo seems to be OK with this :-) It takes about one minute per ticker. I'm running this scrap job (for the first time!) now for over 30 hours lol and I'm currently at ticker that starts with T so I have few more hours to go.
I have read somewhere that some sites can spot this slow scraping also. So as an idea, instead of just hard code pause of say 7 seconds, you could run random number generator between IDK, 7-15 seconds and that way pauses will be more random and less prone to be spotted... Just a though Hope this helps a little bit even if with delay.
Ah, and if this answer does help you, please be so kind to mark it as solved and up vote it. Maybe I can get a point or two for it. My points are so low I can't even vote other posts that I like and that helped me.

Google Finance API Not Consistent

I'm writing some software to do charting and analysis of intraday stock data, and so far the only free (or even affordable) feed I've found which gives 15 minute data for the past week or so is Google Finance. But something I've noticed, which I don't understand and has caused many headaches, is that the responses from the API for 15 minute intervals seem to be very inconsistent.
So far I haven't seen this problem with the 30 minute interval, in this case the response is always correct. But if I specify an interval of 15 minutes (900 seconds), I get anywhere from 70 to 200 or more quotes back. The data is correct, but the responses seem to pretty much ignore the number of days I'm specifying. Also this happens for individual stocks, so it isn't a case of some stocks having missing data. Here's an example of an API request I'm sending:
https://www.google.com/finance/getprices?i=900&p=8d&f=d,o,h,l,c&q=INTC
If anyone could help I'd appreciate it, this API doesn't seem to be documented so it's been difficult to find any help with it.
Yes, google is not consistent in providing stock data. For the same reason i switched over to yahoo API, their data is pretty much consistent compared to google

Getting as much tweets associated to a day's trends as possible

I am storing in a database, every 30 minutes, Twitter's trending topics of a country Y. No problem with that.
Now, I want to get as much tweets as possible matching those trending topics for research purposes.
Since I would like to study the patterns of the trends, I would like continuous tweet data of at least 3 days centered in the day the trend peak was detected, for every trending topic. In order to achieve that, I thought of doing the following:
Suppose I am in day X. I could retrieve the unique trends of day X-2, and for every trend, look for tweets matching the trend in the interval [X-3, X-1], that is 3 days. However, the problem here is Twitter rate limitations. If I have 100 trending topics in day X-2, and I make 20 GET search requests/trend, I would end up doing a total of 2,000 requests, which overpasses Twitter's 350 hourly rate limit. If make 300 req/hour, it would take more than 6 hours to get the data for only one day...
Does anybody know any other (better) way for getting tweets associated with trends?
Thanks in advance
Twitter Streaming API?
Twitter Streaming API doesn't deliver any past tweets. You only receive tweets starting from the time the server connection is established. The search API will return tweets matching the current query up to 7 days old in theory, but that is entirely up to Twitter’s current load. (Note*-At times this interval has been as short as 24 hours. In addition, you are limited by the ability to only receive up to 1,500 tweets regardless of how old they are.)
Is there any way to get more tweets from the streaming?
None that I know. But, do refer the below mentioned information if you are considering to switch among search or streaming API.
Please choose your case:
If you need real time data and your number of requests are high:
Go for Streaming API
The streaming API requires that you keep the connection active. This requires a server process with an infinite loop, to get the latest tweets.
Advantage
1)Lag in retrieving results: Tweets delivered with this method are basically real-time, with a lag of a second or two at most between the time the tweet is posted and it is received from the API
2)Not rate limited.
If you need aggregate data regardless of its time range and your number of requests are not high:
Go for Search API
The search API is the easier of the two methods to implement but it is rate limited .Each request will return up to 100 tweets, and you can use a page parameter to request up to 15 pages, giving you a theoretical maximum of 1,500 tweets for a single query.
Advantage
1)Finding tweets in the past:The search API wins by default in this area, because the streaming API doesn’t deliver any past tweets
2)Easier to implement

Resources