Я использую пакет googleapi.
Я хочу получить «insightTrafficSourceDetail» из API аналитики YouTube.
Вот мой код:
google.youtubeAnalytics('v2').reports.query({
metrics: 'estimatedMinutesWatched,views',
dimensions: 'insightTrafficSourceDetail',
filter: 'video==[some_video_id];insightTrafficSourceType==YT_SEARCH',
startDate: '2019-01-01',
endDate: '2019-02-12',
ids: 'channel==MINE',
sort: '-estimatedMinutesWatched',
maxResults: 25,
});
Вот ответ, который я получаю:
code: 400,
errors:
[ { message:
'The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v2/available_reports for a list of supported queries.',
domain: 'global',
reason: 'badRequest' } ] }
Хотя в документах Google они дали тот же запрос, что и образец запроса 10 лучших — внешние веб-сайты, генерирующие наибольшее количество трафика для видео