Is it possible to get url of first YouTube video from search?

beannshie

I'm trying to make an app which will give you the url of the first video that comes up when you search something on youtube.

for example :
you write "c#" into a textbox and it outputs "https://www.youtube.com/watch?v=GhQdlIFylQ8" (link of the first video that comes up)

This is basically how I want the code to look like :

private async void button1_Click(object sender, EventArgs e)
{
    output_textbox.Text = GetUrl(input_textbox);
}

string GetUrl(string input)
{
            // ???
}
Jakob Schwarz

Read the documentation of the youtube api.

To solve your problem you can use the code from "Search by keyword" and change the value of the MaxResults variable to 1.

Youtube Data API .NET Code Samples

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

scrape YouTube video from a specific channel and search?

How do I get the YouTube video ID from a URL?

How to get youtube video id from URL with java?

How to Get Youtube Video URL Programmatically

Extract the video ID from youtube url in .net

How can I get direct video url from YouTube video URL?

How can I get a Youtube video ID from the Youtube API given the video url?

How to get the data of a video from youtube in javascript

How to get thumbnail of youtube video from url using php and API

How to get direct url of video from youtube url?

Creating an ImportXML to get individual YouTube video views from the video page on any content creator, for the last 30 videos. Possible?

I tried to get the URL from a youtube video and play it with mediaplayer but it immediately ends

How to return the link to the first Youtube video after a search in Selenium Python?

Get youtube video id from youtube url in smarty template?

GET YouTube Video URL - Data API 3.0

Fetch YouTube Video Id from youtube URL in zend framework

Get length of YouTube video from page source?

How to get video tags from youtube video?

Embed Youtube video from URL

Stream YouTube video from extracted url

Get youtube video Id from shared video Url

how to get video id from clicking youtube search page link in a webview

Get first result from google search and its URL's with javascript

How do I parse YouTube URLs to get the video ID from a URL using Dart?

I need some help in correcting my codes in php - How to get the video id from a YouTube URL

Youtube-DL Search Return URL of Video

Get *all* Youtube video ids from a chosen channel without using search query

Is there solution "get youtube video ID from url" contains mobile web url?

Hello. Explain why I get such a url. I'm trying to pull a video from YouTube