YouTube analytics API missing data for last 3 Days - youtube-api

We are calling the metrics endpoint to retrieve likes, dislikes, comments, shares and avg watch time for specific
https://www.googleapis.com/v2/reports?ids=channel==MINE&dimensions=video&metrics=likes,dislikes,comments,shares,averageViewDuration&startDate=${startDate}&endDate=${endDate}&filters=video==${video_id}
Which works and correctly returns data - however the data for the last 3 days is always empty rows. See the below screenshot with the dates and the empty row property
The value for the 14th of November is correct - but when we fetch for the 15th, 16th or 17th we get empty rows. We have tested this all week and it is always the last 3 days. Tomorrow we will have valid data for the 15th but not the 16th, 17th or 18th.
We also know there is valid data for these dates - see the image below for the values on YouTube analytics
The dip in the graph is the 14th at 3 likes. But we should have 4 for the 15th and 1 for the 16th.
Any ideas how we retrieve the correct data for the last 3 days?

Related

Google Sheets Advanced Query

I am trying to extract value for a given Month, Day, and Time of the year. I am trying to find the distribution of Demand for a possible outcome of Demand for the next year (24 hours * 365 days = 8760 data points)
For example, if I want to find the distribution of past demand on January 1st then I want to extract the demand value for the January 1st in every year at a specific time of the day within the data frame.
I provided a picture below on what I am trying to achieve.
Let's call the past demand "Past Demand SS" and the Expected Demand "E_Demand SS".
"Past Demand SS" has 3 columns and 35041 rows.
"E_Demand SS" has 3 columns and 8760 rows.
Any ideas on how I can achieve this instead of entering it in manually?

How to Link custom week numbers with an existing time tree graph up to minutes in Neo4J?

I already have a graph (time tree) that contains Year, Month, Day, Hour and Minutes. It is something like that of what Mark Needham shows in his blog link but it goes until Minutes instead of days. So the link looks something like this :
2017-[:HAS_MONTH]-2-[:HAS_DAY]-25-[:HAS_HOUR]-16-[:HAS_MINUTE]-45
I also have Year to week number relation. The starting and ending dates of the Workweek are custom. For eg my week 2 in 2017 starts from 2017-01-05 19:00 (yyyy-mm-dd hh:mm) and ends on 2017-01-12 18:59. I have all the nodes between those 2 dates in my time tree but I am not able link them to week 2 node. Is there a way to do this? I am not using graphaware. I managed to do something for this one week by collecting all the days from 5th to 12th and then removing the hours 0 to 18 from 5th and 20th to 23rd on 12. But I need to do this for a couple of years and this method may be very cumbersome. Is there a better way for this?
You can use apoc plugin already :)
apoc.date.format uses JAVA simpledateformat under the hood I think. Looking at http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html this is already possible. But you have to first parse it into unix and then back.
with "2017-01-05 19:00" as date
with apoc.date.parse(date,"s","yyyy-MM-dd HH:mm") as unix
return apoc.date.format(unix,"s","yyyy ww")

Get a set of the next 7 given days

I allow teachers to set schedules for days they're working. Saved in the DB with their week days 0..6. Now what I want to achieve is to give a method a date, often todays date and retrieve the next 7 days they'll be able to work. Take note that for example if their TimeSlot only have a week_day column stored as 1 then the 7 next Mondays should be retrieved.
If it's Mondays and Wednesdays then they'll be returned until 7 days have been stored and returned.
Do anybody have experience in how I might handle this. I struggeling with how to find a good solution to iterate over dates.

How to achive pagination for array of array in ios?

I am sure this is not duplicate question, please read completely and share your ideas.
I am getting data from server,on calling API(example API1) first time , I am getting 20 records , based on “events” count.
In Jan 5 events, in Feb 6 events, March 5 events ,Apr 8 events
But API not returning all the events of April in first call as I have to retrieve only 20 records at a time.
I second time calling API, I am getting remaining records of April month(example API2).
I have to add remaining three records to previous array to show all the April months events under same section.
I am creating a view based on the event’s array and sub viewing to the cell content, I didn't take any custom cell because of critical UI design as shown below.
In the above image, Dec 2016 created twice, as first few records comes in first call of API and next few records comes in second API call.
How do I achieve this..?
You store an array somewhere with the meaning "this is the data that I currently know about". Your tableview uses this array as its source for all its operation.
When more data arrives, you do the following on the main thread: Modify the array so that it contains the new data, then call reloadData for the view that is modified.
Now if you get data for the month april twice, then the "modify the array" is slightly more complicated: For every month arriving, you check if that month is already there; that month would have an array of data associated with it, so you add the new data to that array. If the month isn't there already, you add a new month.

get minute bar historical data from Google finance?

I can get daily data easily using this link:
https://www.google.com/finance/getprices?q=LHA&x=ETR&i=60&p=1d&f=d,c,h,l,o,v
But when I try to change "1d" to "1y" I still get 1 day's data.
I am trying to get 2 years' worth.
Is there a way to do this? yahoo or bing finance would be fine too.
You need to use '1Y', not '1y' on your query to get a time period stretching back 1 year. However, you will also need to change the granularity of your query, as minute data is only available for the previous 5 days.
This query will provide you with minute data for the previous 5 days.
https://www.google.com/finance/getprices?q=LHA&x=ETR&i=60&p=5d&f=d,c,h,l,o,v
The following query will provide you with the last two years of prices at the close.
https://www.google.com/finance/getprices?q=LHA&x=ETR&i=86400&p=2Y&f=d,c,h,l,o,v
google API "getprices" is NO more fetching intraday data of any interval (say 1 minute or 5 minute or 60 minutes .....). It is now fetching data in 1 day interval only irrespective of interval set.
I tried getting intraday data before, the furthest back I can get is 15 days, i.e. 15d
Using 2w or 1y did not work for me.
references:
http://www.mathworks.com/matlabcentral/fileexchange/32745-get-intraday-stock-price/content/getHistoricalIntraDayStockPrice.m
http://www.codeproject.com/Articles/221952/Simple-Csharp-DLL-to-download-data-from-Google-Fin
Update [2020]
Google and Yahoo deprecated their APIs so only direct website access works. However, the max resolution you can get is 1 day (end-of-day).
For historical high-resolution data Tickdata.com is a good source for tick-level data.
If 1-min bars are sufficient FirstRateData.com has 1-min data for most stocks and fx going back 20 years.

Resources