Skip to content

Instantly share code, notes, and snippets.

@ptesser
Last active February 25, 2020 22:52
Show Gist options
  • Save ptesser/db02d14e46da6da13d762a99aa3f1ed0 to your computer and use it in GitHub Desktop.
Save ptesser/db02d14e46da6da13d762a99aa3f1ed0 to your computer and use it in GitHub Desktop.
// Youtube Keys
YOUTUBE_API_KEY: 'AIzaSyBSnGWkvGIBpXONyAKv5Gt3OofBv0IaHkw',
// (angular-courses project in p.tesser921 account) AIzaSyDF0QpmbBwnZsNCCZeBln2hFjqD2KiSGkk
YOUTUBE_API_URL: 'https://www.googleapis.com/youtube/v3',
// Trending params
const params: string = [
'chart=mostPopular',
'regionCode=IT',
'part=snippet,contentDetails,statistics',
'maxResults=10',
'type=video',
`key=${this.apiKey}`,
].join('&');
// Search params
const params: string = [
`part=snippet,id`,
`maxResults=20`,
`type=video`,
`q=${keyword}`,
`safeSearch=moderate`,
`key=${this.apiKey}`
].join('&');
// Related params
const params: string = [
`part=snippet`,
`maxResults=20`,
`type=video`,
`relatedToVideoId=${videoId}`,
`key=${this.ytApiKey}`
].join('&');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment