โš™๏ธ YouTube Search -> Video Details Workflow Formula By steve


Run searches on YouTube for content via API, returning up to 1,000 results per search term (this workflow will do the pagination for you). You can also provide an “input collection” to the search query to process a list of search terms. E.g. if you have a list of 10 search terms, you can get back 10,000 results.

This will then look up the video details (including the view counts) for each video. This is great for content research… you can schedule a daily run and track the day-to-day view count changes of videos matching your search query.

Getting Started

Import this formula to add the workflows to your account. Then enter your search term and your YouTube API key when prompted, and this will run the needed API calls for you and combine all the data together into a single file for easy consumption.

โš™๏ธ  YouTube Search -> Video Details (1/2)

YouTube Search Pagination Token (Self-Loop) Pagination Limit: Unlimited โžก๏ธ Pagination Token

Pagination token from the previous response. Leave this blank at first and then look for the nextPageToken value in the response’s root collection to get the next page of results.

Region Code Example: US

Restrict results to videos that can only be viewed in certain countries. See country codes here: http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm

Type Example: video,channel,playlist

Type of results to return:

  • channel
  • playlist
  • video

IMPORTANT Many advanced search functions only work with type video, so if you get a strange error then try changing this to video.

Video Category ID Example: 1

Execute https://developers.google.com/youtube/v3/docs/videoCategories/list and provide your country in the regionCode to see a list of possible categories.

Part Example: snippet

Parts to return in the response. Just enter in snippet per the documentation: https://developers.google.com/youtube/v3/docs/search/list

Channel Type Example: any

Restrict the search to a specific channel type of either:

  • any All channels
  • show Only shows
Event Type Example: live

Set this if you want to search for live events.

NOTE: You must change the “type” parameter to video when using this option

  • completed
  • live
  • upcoming
Location Radius Example: 1m

When searching by location, also provide a radius in m, km, ft. Be sure to set “Type” to video.

Published After Example: 2021-01-01T00:00:00Z

Taken from https://developers.google.com/youtube/v3/docs/search/list

The publishedAfter parameter indicates that the API response should only contain resources created at or after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).

Published Before Example: 2021-02-01T00:00:00Z

Taken from https://developers.google.com/youtube/v3/docs/search/list

The publishedBefore parameter indicates that the API response should only contain resources created before or at the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).

Related To Video ID Example: Bie32IZlMtY

Provide this value to return back a list of videos that are related to this one.

IMPORTANT You need to set the type to video for this to work.

Topic ID Example: /m/07c1v

Restrict results to the provided topic. You can get topic IDs by querying for channel details: https://stevesie.com/apps/youtube-api/channel-details and then add topicDetails to the part input.

Safe Search Example: moderate

Whether to moderate the content returned. Default is moderate, other possible values are:

  • none Show all the results, may be inappropriate
  • strict Exclude all restricted content (“safe search”)
Video Caption Example: any

Specify which types of videos to return based on their captions. Possible values are:

  • any - Return all videos (default)
  • closedCaption - Only return videos with captions
  • none - Only return videos without captions
Language Example: en

Return results that are most relevant to the provided language. See here for language codes: http://www.loc.gov/standards/iso639-2/php/code_list.php

Location Coordinates Example: 37.42307,-122.08427

Restrict the search to videos tagged in a specific location. These must be coordinates and you must also supply a “Location Radius”.

Pagination Limit Example: 50

Pagination Limit

Channel ID Example: UCArmutk8nAbYQdaYzgqKOwA

Restrict the video search to a specific channel.

Query Example: boating|sailing -fishing

From https://developers.google.com/youtube/v3/docs/search/list

The q parameter specifies the query term to search for.

Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either “boating” or “sailing”, set the q parameter value to boating|sailing. Similarly, to search for videos matching either “boating” or “sailing” but not “fishing”, set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C.

Pagination Token Example: QWRTSl9pMXBPTTB4Ulk1VVNxMFtPQjFrVEdMRFowbjhTdHFfaWdpUlBYVFBNLWFpc0M5Q3pPaXRTYXhKU1JKbDFsVjgxVDRQTjVYbUgxdw==

Pagination token from the previous response. Leave this blank at first and then look for the nextPageToken value in the response’s root collection to get the next page of results.

Order Example: relevance

Sort order of the results. From the official YouTube API:

The order parameter specifies the method that will be used to order resources in the API response. The default value is relevance.

Acceptable values are:

  • date โ€“ Resources are sorted in reverse chronological order based on the date they were created.
  • rating โ€“ Resources are sorted from highest to lowest rating.
  • relevance โ€“ Resources are sorted based on their relevance to the search query. This is the default value for this parameter.
  • title โ€“ Resources are sorted alphabetically by title.
  • videoCount โ€“ Channels are sorted in descending order of their number of uploaded videos.
  • viewCount โ€“ Resources are sorted from highest to lowest number of views. For live broadcasts, videos are sorted by number of concurrent viewers while the broadcasts are ongoing.

Extractors

  • YouTube Search Results .items
โš™๏ธ  YouTube Search -> Video Details (2/2)

YouTube Search -> Video Details (1/2) (External Trigger) Extractor: YouTube Search Results items.id.videoId โžก๏ธ Video ID

The video ID to look up. For example, in the URL https://www.youtube.com/watch?v=qRv7G7WpOoU the video ID would be qRv7G7WpOoU.

Part Example: id,snippet,contentDetails,statistics,status,topicDetails

Parts to return in the response.

  • contentDetails
  • fileDetails
  • id
  • liveStreamingDetails
  • localizations
  • player
  • processingDetails
  • recordingDetails
  • snippet
  • statistics
  • status
  • suggestions
  • topicDetails

Extractors

  • YouTube Video Details .
Posted by steve on Dec. 3, 2020, 8:22 p.m. ๐Ÿšฉ  Report