Last active
November 18, 2018 16:17
-
-
Save productioncoder/fcfa30ca70ccbd4fb978bb0614beab94 to your computer and use it in GitHub Desktop.
Youtube in React: building a search request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function buildSearchRequest(query, nextPageToken, amount = 12, ) { | |
return buildApiRequest('GET', | |
'/youtube/v3/search', | |
{ | |
part: 'id,snippet', | |
q: query, | |
type: 'video', | |
pageToken: nextPageToken, | |
maxResults: amount, | |
}, null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment