Instance Methods
文章推薦指數: 80 %
YouTube Data API . search. Instance Methods. list(part=None, channelId=None, videoSyndicated=None, channelType=None, videoCaption=None, publishedAfter ... YouTubeDataAPI.search InstanceMethods list(part=None,channelId=None,videoSyndicated=None,channelType=None,videoCaption=None,publishedAfter=None,onBehalfOfContentOwner=None,forContentOwner=None,regionCode=None,type=None,topicId=None,publishedBefore=None,videoDimension=None,videoLicense=None,maxResults=None,videoType=None,videoDefinition=None,pageToken=None,relatedToVideoId=None,videoDuration=None,forMine=None,q=None,safeSearch=None,videoEmbeddable=None,videoCategoryId=None,order=None) ReturnsacollectionofsearchresultsthatmatchthequeryparametersspecifiedintheAPIrequest.Bydefault,asearchresultsetidentifiesmatchingvideo,channel,andplaylistresources,butyoucanalsoconfigurequeriestoonlyretrieveaspecifictypeofresource. list_next(previous_request,previous_response) Retrievesthenextpageofresults. MethodDetails list(part=None,channelId=None,videoSyndicated=None,channelType=None,videoCaption=None,publishedAfter=None,onBehalfOfContentOwner=None,forContentOwner=None,regionCode=None,type=None,topicId=None,publishedBefore=None,videoDimension=None,videoLicense=None,maxResults=None,videoType=None,videoDefinition=None,pageToken=None,relatedToVideoId=None,videoDuration=None,forMine=None,q=None,safeSearch=None,videoEmbeddable=None,videoCategoryId=None,order=None) ReturnsacollectionofsearchresultsthatmatchthequeryparametersspecifiedintheAPIrequest.Bydefault,asearchresultsetidentifiesmatchingvideo,channel,andplaylistresources,butyoucanalsoconfigurequeriestoonlyretrieveaspecifictypeofresource. Args: part:string,Thepartparameterspecifiesacomma-separatedlistofoneormoresearchresourcepropertiesthattheAPIresponsewillinclude.Thepartnamesthatyoucanincludeintheparametervalueareidandsnippet. Iftheparameteridentifiesapropertythatcontainschildproperties,thechildpropertieswillbeincludedintheresponse.Forexample,inasearchresult,thesnippetpropertycontainsotherpropertiesthatidentifytheresult'stitle,description,andsoforth.Ifyousetpart=snippet,theAPIresponsewillalsocontainallofthosenestedproperties.(required) channelId:string,ThechannelIdparameterindicatesthattheAPIresponseshouldonlycontainresourcescreatedbythechannel videoSyndicated:string,ThevideoSyndicatedparameterletsyoutorestrictasearchtoonlyvideosthatcanbeplayedoutsideyoutube.com. Allowedvalues any-Returnallvideos,syndicatedornot. true-Onlyretrievesyndicatedvideos. channelType:string,ThechannelTypeparameterletsyourestrictasearchtoaparticulartypeofchannel. Allowedvalues any-Returnallchannels. show-Onlyretrieveshows. videoCaption:string,ThevideoCaptionparameterindicateswhethertheAPIshouldfiltervideosearchresultsbasedonwhethertheyhavecaptions. Allowedvalues any-Donotfilterresultsbasedoncaptionavailability. closedCaption-Onlyincludevideosthathavecaptions. none-Onlyincludevideosthatdonothavecaptions. publishedAfter:string,ThepublishedAfterparameterindicatesthattheAPIresponseshouldonlycontainresourcescreatedafterthespecifiedtime.ThevalueisanRFC3339formatteddate-timevalue(1970-01-01T00:00:00Z). onBehalfOfContentOwner:string,USE_DESCRIPTION---channels:list:onBehalfOfContentOwner forContentOwner:boolean,TheforContentOwnerparameterrestrictsthesearchtoonlyretrieveresourcesownedbythecontentownerspecifiedbytheonBehalfOfContentOwnerparameter.TheusermustbeauthenticatedasaCMSaccountlinkedtothespecifiedcontentownerandonBehalfOfContentOwnermustbeprovided. regionCode:string,TheregionCodeparameterinstructstheAPItoreturnsearchresultsforthespecifiedcountry.TheparametervalueisanISO3166-1alpha-2countrycode. type:string,Thetypeparameterrestrictsasearchquerytoonlyretrieveaparticulartypeofresource. topicId:string,ThetopicIdparameterindicatesthattheAPIresponseshouldonlycontainresourcesassociatedwiththespecifiedtopic.ThevalueidentifiesaFreebasetopicID. publishedBefore:string,ThepublishedBeforeparameterindicatesthattheAPIresponseshouldonlycontainresourcescreatedbeforethespecifiedtime.ThevalueisanRFC3339formatteddate-timevalue(1970-01-01T00:00:00Z). videoDimension:string,ThevideoDimensionparameterletsyourestrictasearchtoonlyretrieve2Dor3Dvideos. Allowedvalues 2d-Restrictsearchresultstoexclude3Dvideos. 3d-Restrictsearchresultstoonlyinclude3Dvideos. any-Includeboth3Dandnon-3Dvideosinreturnedresults.Thisisthedefaultvalue. videoLicense:string,ThevideoLicenseparameterfilterssearchresultstoonlyincludevideoswithaparticularlicense.YouTubeletsvideouploaderschoosetoattacheithertheCreativeCommonslicenseorthestandardYouTubelicensetoeachoftheirvideos. Allowedvalues any-Returnallvideos,regardlessofwhichlicensetheyhave,thatmatchthequeryparameters. creativeCommon-OnlyreturnvideosthathaveaCreativeCommonslicense.Userscanreusevideoswiththislicenseinothervideosthattheycreate.Learnmore. youtube-OnlyreturnvideosthathavethestandardYouTubelicense. maxResults:integer,USE_DESCRIPTION---channels:list:maxResults videoType:string,ThevideoTypeparameterletsyourestrictasearchtoaparticulartypeofvideos. Allowedvalues any-Returnallvideos. episode-Onlyretrieveepisodesofshows. movie-Onlyretrievemovies. videoDefinition:string,ThevideoDefinitionparameterletsyourestrictasearchtoonlyincludeeitherhighdefinition(HD)orstandarddefinition(SD)videos.HDvideosareavailableforplaybackinatleast720p,thoughhigherresolutions,like1080p,mightalsobeavailable. Allowedvalues any-Returnallvideos,regardlessoftheirresolution. high-OnlyretrieveHDvideos. standard-Onlyretrievevideosinstandarddefinition. pageToken:string,USE_DESCRIPTION---channels:list:pageToken relatedToVideoId:string,TherelatedToVideoIdparameterretrievesalistofvideosthatarerelatedtothevideothattheparametervalueidentifies.TheparametervaluemustbesettoaYouTubevideoIDand,ifyouareusingthisparameter,thetypeparametermustbesettovideo. videoDuration:string,ThevideoDurationparameterfiltersvideosearchresultsbasedontheirduration. Allowedvalues any-Donotfiltervideosearchresultsbasedontheirduration.Thisisthedefaultvalue. long-Onlyincludevideoslongerthan20minutes. medium-Onlyincludevideosthatarebetweenfourand20minuteslong(inclusive). short-Onlyincludevideosthatarelessthanfourminuteslong. forMine:boolean,TheforMineparameterrestrictsthesearchtoonlyretrievevideosownedbytheauthenticateduser. q:string,Theqparameterspecifiesthequerytermtosearchfor. safeSearch:string,ThesafeSearchparameterindicateswhetherthesearchresultsshouldincluderestrictedcontentaswellasstandardcontent. Allowedvalues moderate-YouTubewillfiltersomecontentfromsearchresultsand,attheleast,willfiltercontentthatisrestrictedinyourlocale.Basedontheircontent,searchresultscouldberemovedfromsearchresultsordemotedinsearchresults.Note:ThedefaultvalueforthesafeSearchparameterismoderate. none-YouTubewillnotperformanyfilteringonthesearchresultset. strict-YouTubewilltrytoexcludeallrestrictedcontentfromthesearchresultset.Basedontheircontent,searchresultscouldberemovedfromsearchresultsordemotedinsearchresults. videoEmbeddable:string,ThevideoEmbeddableparameterletsyoutorestrictasearchtoonlyvideosthatcanbeembeddedintoawebpage. Allowedvalues any-Returnallvideos,embeddableornot. true-Onlyretrieveembeddablevideos. videoCategoryId:string,ThevideoCategoryIdparameterfiltersvideosearchresultsbasedontheircategory. order:string,TheorderparameterspecifiesthemethodthatwillbeusedtoorderresourcesintheAPIresponse. Allowedvalues date-Resourcesaresortedinreversechronologicalorderbasedonthedatetheywerecreated. rating-Resourcesaresortedfromhighesttolowestrating. relevance-Resourcesaresortedbasedontheirrelevancetothesearchquery.Thisisthedefaultvalueforthisparameter. title-Resourcesaresortedbasedontheirtitle. videoCount-Channelsaresortedfromhighesttolowestnumberofvideouploaded. viewCount-Resourcesaresortedfromhighesttolowestnumberofviews. Returns: Anobjectoftheform: {#Apaginatedlistofsearchresultsreturnedastheresponsetoayoutube.search.listcall. "eventId":"AString",#SerializedEventIdoftherequestwhichproducedthisresponse. "nextPageToken":"AString",#ThetokenthatcanbeusedasthevalueofthepageTokenparametertoretrievethenextpageintheresultset. "kind":"youtube#searchListResponse",#ThetypeoftheAPIresponse.Forthisoperation,thevaluewillbeyoutube#searchListResponse. "visitorId":"AString",#ThevisitorIdidentifiesthevisitor. "items":[#Alistofresultsthatmatchthesearchcriteria. {#AsearchresultcontainsinformationaboutaYouTubevideo,channel,orplaylistthatmatchesthesearchparametersspecifiedinanAPIrequest.Whileasearchresultpointstoauniquelyidentifiableresource,likeavideo,itdoesnothaveitsownpersistentdata. "snippet":{#Basicdetailsaboutasearchresult,includingtitle,descriptionandthumbnailsoftheitemreferencedbythesearchresult.#Thesnippetobjectcontainsbasicdetailsaboutasearchresult,suchasitstitleordescription.Forexample,ifthesearchresultisavideo,thenthetitlewillbethevideo'stitleandthedescriptionwillbethevideo'sdescription. "thumbnails":{#InternalrepresentationofthumbnailsforaYouTuberesource.#Amapofthumbnailimagesassociatedwiththesearchresult.Foreachobjectinthemap,thekeyisthenameofthethumbnailimage,andthevalueisanobjectthatcontainsotherinformationaboutthethumbnail. "default":{#AthumbnailisanimagerepresentingaYouTuberesource.#Thedefaultimageforthisresource. "url":"AString",#Thethumbnailimage'sURL. "width":42,#(Optional)Widthofthethumbnailimage. "height":42,#(Optional)Heightofthethumbnailimage. }, "high":{#AthumbnailisanimagerepresentingaYouTuberesource.#Thehighqualityimageforthisresource. "url":"AString",#Thethumbnailimage'sURL. "width":42,#(Optional)Widthofthethumbnailimage. "height":42,#(Optional)Heightofthethumbnailimage. }, "medium":{#AthumbnailisanimagerepresentingaYouTuberesource.#Themediumqualityimageforthisresource. "url":"AString",#Thethumbnailimage'sURL. "width":42,#(Optional)Widthofthethumbnailimage. "height":42,#(Optional)Heightofthethumbnailimage. }, "maxres":{#AthumbnailisanimagerepresentingaYouTuberesource.#Themaximumresolutionqualityimageforthisresource. "url":"AString",#Thethumbnailimage'sURL. "width":42,#(Optional)Widthofthethumbnailimage. "height":42,#(Optional)Heightofthethumbnailimage. }, "standard":{#AthumbnailisanimagerepresentingaYouTuberesource.#Thestandardqualityimageforthisresource. "url":"AString",#Thethumbnailimage'sURL. "width":42,#(Optional)Widthofthethumbnailimage. "height":42,#(Optional)Heightofthethumbnailimage. }, }, "title":"AString",#Thetitleofthesearchresult. "channelId":"AString",#ThevaluethatYouTubeusestouniquelyidentifythechannelthatpublishedtheresourcethatthesearchresultidentifies. "publishedAt":"AString",#Thecreationdateandtimeoftheresourcethatthesearchresultidentifies.ThevalueisspecifiedinISO8601(YYYY-MM-DDThh:mm:ss.sZ)format. "channelTitle":"AString",#Thetitleofthechannelthatpublishedtheresourcethatthesearchresultidentifies. "description":"AString",#Adescriptionofthesearchresult. }, "kind":"youtube#searchResult",#Thekind,fixedto"youtube#searchResult". "etag":"AString",#Etagofthisresource. "id":{#AresourceidisagenericreferencethatpointstoanotherYouTuberesource.#Theidobjectcontainsinformationthatcanbeusedtouniquelyidentifytheresourcethatmatchesthesearchrequest. "kind":"AString",#ThetypeoftheAPIresource. "channelId":"AString",#TheIDthatYouTubeusestouniquelyidentifythereferredresource,ifthatresourceisachannel.ThispropertyisonlypresentiftheresourceId.kindvalueisyoutube#channel. "playlistId":"AString",#TheIDthatYouTubeusestouniquelyidentifythereferredresource,ifthatresourceisaplaylist.ThispropertyisonlypresentiftheresourceId.kindvalueisyoutube#playlist. "videoId":"AString",#TheIDthatYouTubeusestouniquelyidentifythereferredresource,ifthatresourceisavideo.ThispropertyisonlypresentiftheresourceId.kindvalueisyoutube#video. }, }, ], "etag":"AString",#TheETagfortheresponse. "prevPageToken":"AString",#ThetokenthatcanbeusedasthevalueofthepageTokenparametertoretrievethepreviouspageintheresultset. "pageInfo":{#Pagingdetailsforlistsofresources,includingtotalnumberofitemsavailableandnumberofresourcesreturnedinasinglepage.#ThepageInfoobjectencapsulatespaginginformationforthesearchresultset. "totalResults":42,#Thetotalnumberofresultsintheresultset. "resultsPerPage":42,#ThenumberofresultsincludedintheAPIresponse. }, } list_next(previous_request,previous_response) Retrievesthenextpageofresults. Args: previous_request:Therequestforthepreviouspage.(required) previous_response:Theresponsefromtherequestforthepreviouspage.(required) Returns: Arequestobjectthatyoucancall'execute()'ontorequestthenext page.ReturnsNoneiftherearenomoreitemsinthecollection.
延伸文章資訊
- 1Youtube Data API 教學- 頻道資料我都要search.list - iT 邦幫忙
Youtube Data API 教學- 頻道資料我都要search.list. Python - 數位行銷分析與Youtube API 教學系列第7 篇. juck30808. 8 個月前‧ ...
- 2Search: list | YouTube Data API - Google Developers
Search: list ... Returns a collection of search results that match the query parameters specified...
- 3How To Get a YouTube API Key (in 7 Simple Steps) - RapidAPI
- 4Search: list | YouTube Data API - Google Developers
- 5Instance Methods
YouTube Data API . search. Instance Methods. list(part=None, channelId=None, videoSyndicated=None...