Skip to content

Commit 13a97ea

Browse files
committed
developer key should be added before making the request. I was getting following error without it.
There was a service error: 403 : Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.
1 parent 351782d commit 13a97ea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

java/src/main/java/com/google/api/services/samples/youtube/cmdline/data/GeolocationSearch.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ public void initialize(HttpRequest request) throws IOException {
140140
// Call the YouTube Data API's youtube.videos.list method to
141141
// retrieve the resources that represent the specified videos.
142142
YouTube.Videos.List listVideosRequest = youtube.videos().list("snippet, recordingDetails").setId(videoId);
143+
144+
// Set your developer key
145+
listVideosRequest.setKey(apiKey);
146+
143147
VideoListResponse listResponse = listVideosRequest.execute();
144148

145149
List<Video> videoList = listResponse.getItems();

0 commit comments

Comments
 (0)