5. Working on API integration
So far, we have learned everything about requests & responses. We also know how to make different API requests in Postman or using curl.
Well, it's time to test your skills! 💩
P1 - Search Videos on YouTube
Description - Search Videos on YouTube using YouTube Data API
API Documentation link - https://developers.google.com/youtube/v3/docs
Example - Let's say you search, "educational video". You need to find an api which accept search parameter and return result.
- Sign In on google developer console and get the API key.
- Query a term "How to learn fast" using the API.
- Get the correct endpoints, and run using postman.
- Find the details about a video using video ID (found in search result)
- Show the results on front-end ( if you want to show on app/website)
Solution - Steps
Since you don't know which Youtube API endpoint to get search results. The first step always is to do a find the official api documentation. Let's do a google search, "Youtube search api"
The first result would be this : https://developers.google.com/youtube/v3/docs/search/list
Now, you have the api reference. Let's read the api documentation and find out how to get our correct endpoint.
If you face any issue while creating YouTube data api key, check this out.
P2 - Get Current Weather Data
Description - Get Current Weather Data using Open Weather Map API
Documentation : https://openweathermap.org/current
- Get the API endpoint for current weather data based on city search.
- You need to register on the platform, generate an API key and use in the endpoint. If you try hitting the URL without API_KEY, it will return some error message in JSON.
P3 - Location from Zip code
Description - Explore and find an API to get location based on Zip code.
You are allowed to use any api service whether free or protected.