0
channel_id=['UCiT9RITQ9PW6BhXK0y2jaeg',
'UC7cs8q-gJRlGwj4A8OmCmXg',
'UC2UXDak6o7rBm23k3Vv5dww']

request = youtube.search().list(
        part='id',
        channelId="UCiT9RITQ9PW6BhXK0y2jaeg",
        type='video',
        order='date',
        maxResults=10
    )

I am able to see all videoId if i choose one channelId.In keyword parameter (channelId) take string not list so i did this

request = youtube.search().list(
        part='id',
        channelId=','.join(channel_ids),
        type='video',
        order='date',
        maxResults=10
    )

{'kind': 'youtube#searchListResponse', 'etag': 'O3-nwicpOKLtnp0e6OBdRVSWFTA', 'regionCode': 'IN', 'pageInfo': {'totalResults': 0, 'resultsPerPage': 0}, 'items': []}

Can you please check what's the issue.

arpit
  • 555
  • 1
  • 7
  • 25
  • YouTube authorization is channel based. You only have access to the channel that was selected when the user authorized the app. – Linda Lawton - DaImTo Sep 08 '22 at 09:21
  • I have to fetch data from 10 different channel and that is not dynamic. I guess for ytdata API there is no need to authorization. The main issue is that i want to pass list into channelId – arpit Sep 08 '22 at 09:30

1 Answers1

0

YouTube Data API v3 Search: list endpoint can only filter for a single given YouTube channel id.

channelId
string
The channelId parameter indicates that the API response should only contain resources created by the channel.

Source: Search: list#channelId documentation.

So you are obliged to list video ids channel by channel and then regroup them.

Instead of using the 100 quota cost Search: list endpoint, you can use for a 1 quota cost Playlists: list to retrieve the uploads playlist id and then pass it to PlaylistItems: list, as described more precisely here.

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33