Not seeing snippet.customUrl in results for /youtube/v3/channels

Viewed 449

Per the YouTube Data API V3 at https://developers.google.com/youtube/v3/docs/channels#snippet.customUrl, I was expecting to see something like

    { ... "snippet": { ...  "customUrl": ... } ... }

if I supply a channel ID that have a corresponding custom URL.

For example, I randomly found https://www.youtube.com/c/KinoCheck at YouTube. The channel ID for this custom channel URL is UCOL10n-as9dXO2qtjjFUQbQ.

Passing

part=snippet,status
id=UCOL10n-as9dXO2qtjjFUQbQ

to the Google's API's Explorer at

Services > YouTube Data API v3 > youtube.channels.list

that result in this URL

https://www.googleapis.com/youtube/v3/channels?part=snippet%2Cstatus&id=UCOL10n-as9dXO2qtjjFUQbQ&key={YOUR_API_KEY}

I get the following results

   {
      "kind": "youtube#channelListResponse",
     "etag": "\"q5k97EMVGxODeKcDgp8gnMu79wM/3Ikdg3dfpT2WyGrGi-SpJDtdsxE\"",
     "pageInfo": {
      "totalResults": 1,
      "resultsPerPage": 1
     },
     "items": [
      {
        "kind": "youtube#channel",
       "etag": "\"q5k97EMVGxODeKcDgp8gnMu79wM/vFtLxXdyyYVC8raK8eQzs_B8My0\"",
       "id": "UCOL10n-as9dXO2qtjjFUQbQ",
       "snippet": {
        "title": "KinoCheck",
        "description": "Täglich die neuesten Film Trailer, News und Kritiken in bester Qualität! KinoCheck ist Deutschlands größter Movie-Entertainment Channel.\nEgal ob Blockbuster wie X-Men Apocalypse, Star Trek 3, Batman v. Superman, Suicide Squad, Angry Birds, Warcraft, Captain America 3 oder Indie-Film Trailer, wir haben sie alle! Zusätzlich produzieren wir original Inhalte wie Filmkritiken, Mashup's & Gewinnspiele, damit ihr wisst welcher Film ein wahrer KinoKinoFilm ist!\n\nBesuche unsere brandneue Seite https://KinoCheck.de und finde spielend leicht den richtigen Film für dich und deine Freunde.\n\nProjektleitung: Jan Pfriem | KinoCheck ein Format der some.marketing GmbH & Co. KG",
        "publishedAt": "2012-06-28T10:49:44.000Z",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/-grf9lrD03u4/AAAAAAAAAAI/AAAAAAAAAAA/nUMotu3xp38/s88-c-k-no/photo.jpg"
         },
         "medium": {
            "url": "https://yt3.ggpht.com/-grf9lrD03u4/AAAAAAAAAAI/AAAAAAAAAAA/nUMotu3xp38/s240-c-k-no/photo.jpg"
         },
         "high": {
            "url": "https://yt3.ggpht.com/-grf9lrD03u4/AAAAAAAAAAI/AAAAAAAAAAA/nUMotu3xp38/s240-c-k-no/photo.jpg"
         }
        },
        "defaultLanguage": "de",
        "localized": {
          "title": "KinoCheck",
         "description": "Hot new movie trailer, news and reviews in highest quality on a daily basis! KinoCheck is Germany’s largest movie-entertainment channel.\nWhether blockbusters like X-Men Apocalypse, Star Trek 3, Batman v. Superman, Suicide Squad, Angry Birds, Warcraft, Captain America 3, or indie movie trailers — we’ve got them all. In addition, we create original content like reviews, mashup’s and contest, so you’ll always be up to date on the really good movies!\n\nDon’t miss to visit our brand-new website https://KinoCheck.de\n\nKinoCheck is a project of some.marketing GmbH & Co. KG"
        }
       },
       "status": {
        "privacyStatus": "public",
        "isLinked": true,
        "longUploadsStatus": "longUploadsUnspecified"
       }
      }
     ]
   }

I was expecting but did not see something like

    { ... "snippet": { ...  "customUrl": "https://www.youtube.com/c/KinoCheck/" ... } ... }

What am I missing? Do I need to use a different API?

Thanks.

Disclaimers

  • I have experience integrating with Facebook, etc.
  • I just started integrating with Google and YouTube two weeks ago.
  • I have googled for a few hours, but cannot seem to find an answer.
1 Answers

The Youtube API and the relationships between Users, Brand Accounts and Channels (ID and customUrl) has been evolving and somewhat challenging.

From what I can see from your code, your query looks like it should work. I just went to YouTube Data API documentation and tried your query. Here is a Javascript example:

buildApiRequest('GET',
            '/youtube/v3/channels',
            {'id': 'UCOL10n-as9dXO2qtjjFUQbQ',
             'part': 'snippet,contentDetails,statistics'});

That did produce a snippet with customUrl:

/**
 * API response
 */
{
  "kind": "youtube#channelListResponse",
  "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/m5Bxsm15vXTSZAmr8YPFDtFxsSk\"",
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 1
  },
  "items": [
    {
      "kind": "youtube#channel",
      "etag": "\"DuHzAJ-eQIiCIp7p4ldoVcVAOeY/bedKOF-LSDR5WBICufJner6bNMQ\"",
      "id": "UCOL10n-as9dXO2qtjjFUQbQ",
      "snippet": {
        "title": "KinoCheck",
        "description": "KinoCheck ist Deutschlands größtes Movie-Entertainment Netzwerk und die Plattform für neue Film Trailer, News und Kritiken in bester Qualität. Wir sind Tag und Nacht für euch im Büro, um sicher zu stellen, dass ihr keine Trailer mehr verpasst. Egal ob Blockbuster wie Deadpool, Star Wars, Fast and Furious oder Indie-Film Trailer, wir haben sie alle! Zusätzlich produzieren wir Original-Inhalte wie Filmkritiken, Mashups, Compilations & Film-Events, damit ihr wisst welcher Film ein wahrer KinoKinoFilm ist.\n\nBesuche unsere offizielle Webseite https://KinoCheck.de und finde spielend leicht den richtigen Film für dich und deine Freunde.\n\nDu sucht nach bestimmten Inhalten, dann checke unsere anderen Kanäle.\nKinoCheck International - Englische Trailer und News\nKinoCheck Home - Home Entertainment Filme auf DVD & Blu-Ray\nKinoCheck Kids - Kinderfreundliche Inhalte und Filme\nuvm.\n\nGründer: Jan Pfriem | KinoCheck™ eine Marke der some.marketing GmbH & Co. KG",
        "customUrl": "kinocheck",
        "publishedAt": "2012-06-28T10:49:44.000Z",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/a-/AJLlDp0Hm30XcDoxdITElTIgqJbcRrWTQtrGX2q86w=s88-mo-c-c0xffffffff-rj-k-no",
            "width": 88,
            "height": 88
          },
          "medium": {
            "url": "https://yt3.ggpht.com/a-/AJLlDp0Hm30XcDoxdITElTIgqJbcRrWTQtrGX2q86w=s240-mo-c-c0xffffffff-rj-k-no",
            "width": 240,
            "height": 240
          },
          "high": {
            "url": "https://yt3.ggpht.com/a-/AJLlDp0Hm30XcDoxdITElTIgqJbcRrWTQtrGX2q86w=s800-mo-c-c0xffffffff-rj-k-no",
            "width": 800,
            "height": 800
          }
        },
        "defaultLanguage": "de",
        "localized": {
          "title": "KinoCheck",
          "description": "KinoCheck is Germany’s largest movie-entertainment network and your destination for movie trailers, news and reviews in highest quality on a daily basis! Whether blockbusters like Deadpool, Star Wars, Fast and Furious or indie movie trailers — we’ve got them all. In addition, we create original-content like reviews, mashups and compilations, so you’ll always be up to date on the most awesome movies!\n\nDon’t miss our official website https://KinoCheck.de\n\nIf you're searching a specific type of content, don't forget to check our other channels\n\nKinoCheck International - English trailers and news\nKinoCheck Home - German home entertainment DVD & Blu-Ray movie \nKinoCheck Kids - German child-friendly content and movies\netc.\n\nFounder: Jan Pfriem | KinoCheck™ a Brand of some.marketing GmbH & Co. KG"
        }
      },
      "contentDetails": {
        "relatedPlaylists": {
          "likes": "LLOL10n-as9dXO2qtjjFUQbQ",
          "uploads": "UUOL10n-as9dXO2qtjjFUQbQ",
          "watchHistory": "HL",
          "watchLater": "WL"
        }
      },
      "statistics": {
        "viewCount": "1411292351",
        "commentCount": "0",
        "subscriberCount": "1569200",
        "hiddenSubscriberCount": false,
        "videoCount": "3058"
      }
    }
  ]
}

So I can only assume it was a feature that was documented and not implemented at the time of your query as @parn had suggested.

WARNING: I have found that even though the API will return the customUrl value (e.g. "kinocheck"), you cannot depend on the fact that "https://www.youtube.com/c/kinocheck" will actually take you to a valid page. We've noticed this for some channels for Users and for some corporate channels that have had their "handles" changed.

Related