1

I am trying to retrieve earnings from a channel in my CMS using the YouTube API. When I execute my query the response only contains the metrics datatype and not the actual value. How do I return the earnings from the API?

stdClass Object (
    [kind] => youtubeAnalytics#resultTable [columnHeaders] => Array (
        [0] => stdClass Object (
            [name] => earnings [columnType] => METRIC [dataType] => FLOAT
        )
        [1] => stdClass Object (
            [name] => grossRevenue [columnType] => METRIC [dataType] => FLOAT
        )
    )
)
JAL
  • 41,701
  • 23
  • 172
  • 300

1 Answers1

1

Are you getting the metrics from a Content owner report? To run a content owner report, make sure that you're authenticated as your YouTube CMS account, then set ids=contentOwner==CMS_ID and filters=channel==CHANNEL_ID or filters=video==VIDEO_ID.

not_a_bot
  • 2,332
  • 2
  • 19
  • 33