title: How to access YouTube view count with Java API
body: <p>I found <a href="https://stackoverflow.com/a/26129580/1799985">this answer</a> that shows how to get a video's view count with the Java YouTube API but clearly some things must have changed over the last 7 years or so because I can't figure out the code.</p>
  <p>This line</p>
  <pre><code>YouTube.Videos.List list = youtube.videos().list(&quot;statistics&quot;);
  </code></pre>
  <p>produces an error in Eclipse because the <code>list</code> method from the class <code>Videos</code>(at least in the current API version) has a parameter of type <code>List&lt;String&gt;</code>not <code>String</code>...so can someone show me how to achieve my goal using the current API seeing as the code linked above is invalid due to changes to the API?</p>
  <p>EDIT: Here is how I have defined my dependency for the YouTube API in my <code>pom.xml</code> file</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
      &lt;artifactId&gt;google-api-services-youtube&lt;/artifactId&gt;
    &lt;version&gt;v3-rev20201202-1.31.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>