Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can try your query here:</p> <p><a href="https://developers.google.com/youtube/v3/docs/search/list#try-it" rel="nofollow">https://developers.google.com/youtube/v3/docs/search/list#try-it</a></p> <p>I believe that the following query is the way in what you want to search and retrieve only the video id:</p> <p><a href="https://www.googleapis.com/youtube/v3/search?part=id&amp;q=" rel="nofollow">https://www.googleapis.com/youtube/v3/search?part=id&amp;q=</a>{NAME}&amp;type=video&amp;fields=items%2Fid&amp;key={YOUR_API_KEY}</p> <p>If for example {NAME} is psy, then this call returns the following data, from where you can retrieve the videoId of one of the items;</p> <pre><code>{ "items": [ { "id": { "kind": "youtube#video", "videoId": "9bZkp7q19f0" } }, { "id": { "kind": "youtube#video", "videoId": "Ecw4O5KgvsU" } }, { "id": { "kind": "youtube#video", "videoId": "o443b2rfFnY" } }, { "id": { "kind": "youtube#video", "videoId": "WOyo7JD7hjo" } }, { "id": { "kind": "youtube#video", "videoId": "QZmkU5Pg1sw" } } ] } </code></pre> <p>if you modify the example included in the python client library:</p> <p><a href="https://developers.google.com/api-client-library/python/" rel="nofollow">https://developers.google.com/api-client-library/python/</a></p> <p>you can do that in this way:</p> <pre><code>search_response = service.search().list( q="google", part="id", type="video", fields="items/id" ).execute() videos = [] for search_result in search_response.get("items", []): videos.append("%s" % (search_result["id"]["videoId"])) print "Videos:\n", "\n".join(videos), "\n" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload