Google Analytics API Data Age? - google-analytics-api

I'm using the Core Reporting API (Reporting API V4).
Is there any way for me to determine the last time the data my query is returning was updated?
I'd like to be able to indicate whether the data being displayed was last updated several hours ago versus several minutes ago.

The API does respond with isDataGolden which tells you if the data will change again, if your website is small the data processing latency could be almost nothing.
From your question it sounds like you are more interested in not just if the data is stale but how stale. You could request the the ga:hour and ga:minute to find out when the last processed hit was recorded.
Note there is also the Realtime API which gives you a read of what is happening instantaneously.

Related

Is there a way to prevent the same alert from firing repeatedly in Azure Application Insights if the conditions haven't changed?

We are using Azure Application Insights for a project, and I want to stop App Insights from detecting the same problem multiple times in a row, if it's the same piece of data causing the same issue repeatedly:
E.G when posting a data item to a third party API, the data is an incorrect format so the API will reject it, and an Alert will be flagged. The item will return to the top of the queue, only to attempt this again an hour later, resulting in continuous alerts unless the system is shut down.
I don't want to have to answer an alert at every hour of the day, and whilst I understand a code solution would be possible to resolve this, I am hoping that there is a simpler fix that can be made in Application Insights to prevent this from occurring in a more blanket solution.

Flutter: Show data in the real time

I'm developing an app that shows the score of sports-related matches in real-time. I'm using an API (JSON format) to fetch the score and to do this, I'm using a stream builder to stream the score and using a timer to call the API after every 5 seconds, so I can always show the updated score without user-initiated refresh
But I think this is not an efficient way from the perspective of the server and secondly, if I go with a paid API that provides limited no. of requests, then I would exceed the no. of API requests very shortly. So what is the better way to do it?
and one last question, this question may sound silly, so pardon me. If I go with a paid API that provides limited no. of request (Let's say 1000 API requests per hour)
and assume, 10 users are using my application to see the score, does that mean 10 API request would be deducted after a specified time period (5 seconds), or would it be considered only one?

Firestore, pagination, loaded data are called again?

I saw the best reply after watching this video(https://www.youtube.com/watch?v=poqTHxtDXwU&feature=emb_title) and there was a comment like this.
"So there is a read charge even clients app cached the same document data" (currently 24 thumbs up)
And in the comment of another comment, Todd Kerpelman wrote this comment.
"Great question! The answer is that yes, you really will fetch those first 20 documents all the time. Note that this is different than when you have a realtime listener set up and a document changes in a query you're currently listening to - in that case, only the changed doc will be sent up. But if you're making a series of separate get calls that just happen to overlap, the database will send up the entire data set each time."
I am confused now. My question is, when you load the next list with startAfter, do you load the lists that have already been loaded again? Will you be paid?
when you load the next list with startAfter, do you load the lists that have already been loaded again?
No, for pagination, each query is completely different than the last. It does not re-fetch all the prior documents again, and you will not be charged for those prior documents. The query uses the document specified in startAfter() to determine exactly where the query should start reading results, and you will be charged for only the documents that are returned by the query.

How to get tweets of a year for data mining using twitter API

I like to retrieve 2014-2015 tweets based on some search key for data mining.
I am using twitter4j(java) and calling API GET search/tweets.I am getting only last week tweets.Can anyone please suggest me the solution?
gnip
You got to pay for data older than about a week.
Via Gnip, you can order a one-time data pull (called a Historical PowerTrack One-Time Job). You provide the rule, and a data file will be sent back to you with download directions.
You can learn more about Historical PowerTrack here and here

Fetching 1 minute bars from Yahoo Finance

I'm trying to download 1 minute historical stock prices from Yahoo Finance, both for the current day and the previous ones.
Yahoo (just like Google) supports up to 15 days worth of data, using the following API query:
http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv
The thing is that data keeps on changing even when the markets are closed! Try refreshing every minute or so and some minute bars change, even from the beginning of the session.
Another interesting thing is that all of these queries return slightly different data for the same bars:
http://chartapi.finance.yahoo.com/instrument/2.0/AAPL/chartdata;type=quote;range=1d/csv
Replace the bold number with 100000 and it will still work but return slightly different data.
Does anyone understand this?
Is there a modern YQL query that can fetch historical minute data instead of this API?
Thanks!
Historical minute data is not as easily accessible as we all would like. I have found that the most affordable way to gather Intraday Stock Price data is to develop automated scripts that log price information for whenever the markets are open.
Similar to the Yahoo data URL that you shared, Bloomberg maintains 1-Day Intraday Price information in JSON format like this : https://www.bloomberg.com/markets/api/bulk-time-series/price/AAPL%3AUS?timeFrame=1_DAY
The URL convention appears easy to input on your own once you have a list of Ticker Symbols and an understanding of the consistent syntax.
To arrive at that URL initially though, without having any idea for guessing / reverse-engineering it, I simply went here https://www.bloomberg.com/quote/AAPL:US and used Developer Tools on my browser and tracked a background GET request which led me to that URL. I wouldn't be surprised if you could employ similar methods on other Price Data-related websites.
You can also write scripts to track price data as fast as your internet goes. One python package that I find pretty handy and is ystockquote
You can have it request price data every couple of seconds and log that into a daily time series database.
Yes there is other APIs.
I don't know if it can still help but if you need intraday data, there is a API on rapidapi called (Quotient) which allows to pull intraday (at 1-min level), EOD market (FX, Crypto, Stocks (US, CANADIAN, UK, AUSTRALIA, EUROPE), ETFs and Futures. It also provides earnings, dividends, splits and a lot others informations.