YouTube API

Practice Http requests by rebuilding the YouTube landing page.

Challenge:

Summary

  • Create a Google Developer account, then retrieve and activate your API key.

  • Use the Sample Request Tool to practice using the search-list API.

  • Create a new angular project and begin making request to the API as practiced above.

  • Build a UI that resembles the YouTube landing page, but iterating over your response objects.

Create account, Google Developer project and retrieve API Key

Follow the instructions located here: https://developers.google.com/youtube/v3/getting-started

You can stop after step 3.

Follow these instructions to create your api key

Review the documentation and practice with with try API tool.

Required and optional parameters are on the left, The APITester is on the right.

A successful response will look like the following:

Note the 200 status code and the shape of the response

Pressing the show code button circled above will allow you to inspect the URL that was used to make the request. Use it as a model for your own requests.

Making the App

Project setup: Use the Angular Cheat Sheet as a reference

  • Navigate to your project directory and start a new project. Use the Angular Cheat Sheet for reference.

  • Navigate into the newly created directory.

  • Create a Github repo.

  • Follow the instructions on Github to link your project with the new repo.

  • Create a service to handle your requests to the api.

Installing HTTP Module

Following the same process as the SWAPI project add the HTTP Module to your project. Use the below walk through or the SWAPI project as a guide.

Key Concepts

  • Making Http requests using an api key.

  • Using Angular's HttpClient.

  • Subscribing to Observables.

  • using a third party API.

Last updated