How to use youtube api's in your application.
First of all, go to the google developer console site and add your google account.
Now, click on select a project on the navbar.
Now enter your project name and organization etc, then click on enter.
Then it will ask for 2 types of access,
1.OAuth 2.0,
2.API Key
you can use OAuth 2.0 if you want. Here i have selected API Key to get access
Now, you have the API Key to get access to google api's.
Note: Copy and paste the API Key in a notepad for further use.
Now go to the youtube for the developers site.
Then below screen shows up,
Here, click on samples from nav bar and select the language you are using and again select references from the navbar.
Then the below screen shows up.
Now, Here i want to show the most popular videos in my application so, I have selected videos and then list from side bar and then the below screen shows up.
Here, click on the list (most popular videos) link and you can see the changes on popup which is on right side. Now, scroll down the popup and select the Api key and click on show code like show below.
Then the below screen shows up.
Here select the HTTP and copy the URL.
By using this URL you can get the most popular videos.
sample URL:
https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&chart=mostPopular®ionCode=US&key=[YOUR_API_KEY] HTTP/1.1
remove HTTP/1.1 from last and url is
https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&chart=mostPopular®ionCode=US&key=[YOUR_API_KEY]
Here you need to paste the API KEY in place of [YOUR_API_KEY] which you got at first from the google developer console.
Then copy the total URL with your API Key and run it in google then you get the JSON response.
By using this json you can display the most popular videos in your application.
By using this json you can display the most popular videos in your application.
In this way, you can use youtube api's in your application.