One alternative - using YouTube Data API - could be:
- Use the search:list endpoint for search channels that matches with the criteria - in this case, the name/handle of the channel.
Example:
Search channels named "AndreoBee" - you're getting this value in the channelUsername
variable in your code:
URL:
https://youtube.googleapis.com/youtube/v3/search?part=id%2Csnippet&maxResults=10&q=AndreoBee&type=channel&key=[YOUR_API_KEY]
Response:
{
"kind": "youtube#searchListResponse",
"etag": "K2G-sXJIFnrJFyMaoDvw4XMBym4",
"nextPageToken": "CAoQAA",
"regionCode": "CO",
"pageInfo": {
"totalResults": 6740,
"resultsPerPage": 10
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "oeyNublAqxB8TOEQbtwA4k0Oqgs",
"id": {
"kind": "youtube#channel",
"channelId": "UCjdjyjdcdmldCK5XuuWbn1A"
},
"snippet": {
"publishedAt": "2020-01-21T15:12:27Z",
"channelId": "UCjdjyjdcdmldCK5XuuWbn1A",
"title": "AndreoBee",
"description": "I am a Youtuber.",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJW_gCXDGAviuBWh0GwUO4V5Ia4JNYzC0Mp9bYhigA=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJW_gCXDGAviuBWh0GwUO4V5Ia4JNYzC0Mp9bYhigA=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJW_gCXDGAviuBWh0GwUO4V5Ia4JNYzC0Mp9bYhigA=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBee",
"liveBroadcastContent": "none",
"publishTime": "2020-01-21T15:12:27Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "iG8-NwZab0LLB245AY2MkJ6pexI",
"id": {
"kind": "youtube#channel",
"channelId": "UC2Xpzteb9hbamaeEHZRxPCw"
},
"snippet": {
"publishedAt": "2020-11-27T07:07:23Z",
"channelId": "UC2Xpzteb9hbamaeEHZRxPCw",
"title": "AndreoBee",
"description": "This is my backup channel guys ;)",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJVgMinAIKpEHBPjM2Os8fHFKcsxtTyTIflqTwVR=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJVgMinAIKpEHBPjM2Os8fHFKcsxtTyTIflqTwVR=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJVgMinAIKpEHBPjM2Os8fHFKcsxtTyTIflqTwVR=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBee",
"liveBroadcastContent": "none",
"publishTime": "2020-11-27T07:07:23Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "3X2zApHnPAW2p2awm4tIETn9ybI",
"id": {
"kind": "youtube#channel",
"channelId": "UCp6iawa7GPTszoJxOiG5d_Q"
},
"snippet": {
"publishedAt": "2021-03-15T16:19:39Z",
"channelId": "UCp6iawa7GPTszoJxOiG5d_Q",
"title": "AndreoBee",
"description": "Welcome my ARS GAMING YouTube channel I am uploading full movies or shorts and how to download movies on my YouTube ...",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/Z2CC1zWbsD3k-z9cX0RlPBstKELZw0_sUgFPggIt-DhVkJWL8iJG8pCLizxr3StB8lbZX9PT7U8=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/Z2CC1zWbsD3k-z9cX0RlPBstKELZw0_sUgFPggIt-DhVkJWL8iJG8pCLizxr3StB8lbZX9PT7U8=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/Z2CC1zWbsD3k-z9cX0RlPBstKELZw0_sUgFPggIt-DhVkJWL8iJG8pCLizxr3StB8lbZX9PT7U8=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBee",
"liveBroadcastContent": "none",
"publishTime": "2021-03-15T16:19:39Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "VHP4HsDcIiETPleAWN0cSC7fvbE",
"id": {
"kind": "youtube#channel",
"channelId": "UCWLY3sMMYHH3-9xQ2lhFj8g"
},
"snippet": {
"publishedAt": "2022-06-27T01:08:10Z",
"channelId": "UCWLY3sMMYHH3-9xQ2lhFj8g",
"title": "AndreoBee",
"description": "Hii guus i am Andreo I hope you like my videos and please support me guys thank you have a good day.",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/bHaKoA8QZnZSJXfmK7udtrzxmpCOOhpTHIoP_RQUD2KLv9qNXtLLKY_bewbaQGdfZGIPCcO9Ag=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/bHaKoA8QZnZSJXfmK7udtrzxmpCOOhpTHIoP_RQUD2KLv9qNXtLLKY_bewbaQGdfZGIPCcO9Ag=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/bHaKoA8QZnZSJXfmK7udtrzxmpCOOhpTHIoP_RQUD2KLv9qNXtLLKY_bewbaQGdfZGIPCcO9Ag=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBee",
"liveBroadcastContent": "none",
"publishTime": "2022-06-27T01:08:10Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "01NvBqsdnNimHwnwHnGkeVOhJ-8",
"id": {
"kind": "youtube#channel",
"channelId": "UC3yVv5tuR3tBcVf97j33mQQ"
},
"snippet": {
"publishedAt": "2020-12-12T14:31:22Z",
"channelId": "UC3yVv5tuR3tBcVf97j33mQQ",
"title": "Andreobee",
"description": "Describe the game All best game for play on Android in 2GB ram and 3GB phone.",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJXval25GhQFpbqoFgQXvWBol5aqf4ZCOluMMOe-=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJXval25GhQFpbqoFgQXvWBol5aqf4ZCOluMMOe-=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJXval25GhQFpbqoFgQXvWBol5aqf4ZCOluMMOe-=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "Andreobee",
"liveBroadcastContent": "none",
"publishTime": "2020-12-12T14:31:22Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "B5TOx4aFyuua9eQVa-QBbKDjIng",
"id": {
"kind": "youtube#channel",
"channelId": "UCBR0QlbTtbT52oFmmDZIamw"
},
"snippet": {
"publishedAt": "2022-02-01T14:44:18Z",
"channelId": "UCBR0QlbTtbT52oFmmDZIamw",
"title": "AndreoBee",
"description": "",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/TfGkwtvsAvJdWnMOdRLRn2HKRvnVj872dxLZdZ_ghFwpF4SrY2BqBwJ3syc1V6HLL3LyJiSABQ=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/TfGkwtvsAvJdWnMOdRLRn2HKRvnVj872dxLZdZ_ghFwpF4SrY2BqBwJ3syc1V6HLL3LyJiSABQ=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/TfGkwtvsAvJdWnMOdRLRn2HKRvnVj872dxLZdZ_ghFwpF4SrY2BqBwJ3syc1V6HLL3LyJiSABQ=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBee",
"liveBroadcastContent": "none",
"publishTime": "2022-02-01T14:44:18Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "t04J8v3aRhQhmFsyv54ddTXGDMQ",
"id": {
"kind": "youtube#channel",
"channelId": "UCBvdbv05Cb4Ulf_PlunMJtA"
},
"snippet": {
"publishedAt": "2021-08-12T06:59:40Z",
"channelId": "UCBvdbv05Cb4Ulf_PlunMJtA",
"title": "AndreoBee",
"description": "",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/S3J1R-s_P481lUpBULskSiQ0Pv-Z_iLnE_YrZ10OL1cydCFx6a1aOXvRJskMxY-gVpa8cqwuzQ=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/S3J1R-s_P481lUpBULskSiQ0Pv-Z_iLnE_YrZ10OL1cydCFx6a1aOXvRJskMxY-gVpa8cqwuzQ=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/S3J1R-s_P481lUpBULskSiQ0Pv-Z_iLnE_YrZ10OL1cydCFx6a1aOXvRJskMxY-gVpa8cqwuzQ=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBee",
"liveBroadcastContent": "none",
"publishTime": "2021-08-12T06:59:40Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "dmhfSWj6r1CzXr4yopXkorSsVL0",
"id": {
"kind": "youtube#channel",
"channelId": "UCvXV0HSenVdIpdAuogNPuOQ"
},
"snippet": {
"publishedAt": "2022-11-02T12:01:42Z",
"channelId": "UCvXV0HSenVdIpdAuogNPuOQ",
"title": "AndreoBee",
"description": "PLZ SUB.....",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/NfH1RxDcGEbLe8cOoi7VwFz-dfUcAToV-84rag4x1CIQM8GSnZirguR5SI30M3bZnMP80tA=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/NfH1RxDcGEbLe8cOoi7VwFz-dfUcAToV-84rag4x1CIQM8GSnZirguR5SI30M3bZnMP80tA=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/NfH1RxDcGEbLe8cOoi7VwFz-dfUcAToV-84rag4x1CIQM8GSnZirguR5SI30M3bZnMP80tA=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBee",
"liveBroadcastContent": "none",
"publishTime": "2022-11-02T12:01:42Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "c5Y3zUOZKiyJ-pI7mrLdi4WPegc",
"id": {
"kind": "youtube#channel",
"channelId": "UCmrR9PVxSVRLdp2HK_xP2yA"
},
"snippet": {
"publishedAt": "2021-09-13T06:16:47Z",
"channelId": "UCmrR9PVxSVRLdp2HK_xP2yA",
"title": "ANDREOBEE",
"description": "AndreoBee fan Club For business inquiries ANDREOBEEofficial.",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/CtsMEUKLJC5apm5bX7vEr_3g7nIJn-GfjLodWXLVLF-jFGfyXhFBTiLUvOU8l51e3kVPph5MUQ=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/CtsMEUKLJC5apm5bX7vEr_3g7nIJn-GfjLodWXLVLF-jFGfyXhFBTiLUvOU8l51e3kVPph5MUQ=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/CtsMEUKLJC5apm5bX7vEr_3g7nIJn-GfjLodWXLVLF-jFGfyXhFBTiLUvOU8l51e3kVPph5MUQ=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "ANDREOBEE",
"liveBroadcastContent": "none",
"publishTime": "2021-09-13T06:16:47Z"
}
},
{
"kind": "youtube#searchResult",
"etag": "-lb0jmjUJcQsLJDGHH7KVs14-nU",
"id": {
"kind": "youtube#channel",
"channelId": "UCvqm9nqHYYehmq7FcorjS4Q"
},
"snippet": {
"publishedAt": "2021-01-13T05:54:00Z",
"channelId": "UCvqm9nqHYYehmq7FcorjS4Q",
"title": "AndreoBEE",
"description": "",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJUIkodf8aTOx2ZcNoyycMHQqgqNvehuXN_iz9Ii=s88-c-k-c0xffffffff-no-rj-mo"
},
"medium": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJUIkodf8aTOx2ZcNoyycMHQqgqNvehuXN_iz9Ii=s240-c-k-c0xffffffff-no-rj-mo"
},
"high": {
"url": "https://yt3.ggpht.com/ytc/AL5GRJUIkodf8aTOx2ZcNoyycMHQqgqNvehuXN_iz9Ii=s800-c-k-c0xffffffff-no-rj-mo"
}
},
"channelTitle": "AndreoBEE",
"liveBroadcastContent": "none",
"publishTime": "2021-01-13T05:54:00Z"
}
}
]
}
N.B: for this case, I will accept that the first result is the channel I'm looking for, however, notice here that you might get more than one channel that matches the channel name.
For detect which one of the results of the search matches with the channel you're looking for, you could then, make a request to the channel:list endpoint - by passing the channel_id
of the search result - and see their customUrl
value and/or check the channel that has more videos/subscribers/etc.
Check my answer for more info.