C# - YouTube API v3, Get likes count












0














I'm trying to get likes count using Google API v3 in C#.



SearchResource.ListRequest listRequest = service.Search.List("snippet");
listRequest.Q = args;
listRequest.MaxResults = 5;
IList<SearchResult> searchListResponse = (await listRequest.ExecuteAsync()).Items;


But that only give me generic information (like video ID, snippet, etc...)



I found some similar questions like this one
Get comment or likes count for YouTube video using API 3.0
But they only tell how to do it using HTTP request and not using the .NET library



I tried adding the statistic keyword in the Search.List thing like that



service.Search.List("snippet,statistics");


But it return me a 400 error



Google.Apis.Requests.RequestError
snippet statistics [400]
Errors [
Message[snippet statistics] Location[part - parameter]
Reason[unknownPart] Domain[youtube.part]
]


So my question is how do I get likes count using Google API v3 in C# ?










share|improve this question





























    0














    I'm trying to get likes count using Google API v3 in C#.



    SearchResource.ListRequest listRequest = service.Search.List("snippet");
    listRequest.Q = args;
    listRequest.MaxResults = 5;
    IList<SearchResult> searchListResponse = (await listRequest.ExecuteAsync()).Items;


    But that only give me generic information (like video ID, snippet, etc...)



    I found some similar questions like this one
    Get comment or likes count for YouTube video using API 3.0
    But they only tell how to do it using HTTP request and not using the .NET library



    I tried adding the statistic keyword in the Search.List thing like that



    service.Search.List("snippet,statistics");


    But it return me a 400 error



    Google.Apis.Requests.RequestError
    snippet statistics [400]
    Errors [
    Message[snippet statistics] Location[part - parameter]
    Reason[unknownPart] Domain[youtube.part]
    ]


    So my question is how do I get likes count using Google API v3 in C# ?










    share|improve this question



























      0












      0








      0







      I'm trying to get likes count using Google API v3 in C#.



      SearchResource.ListRequest listRequest = service.Search.List("snippet");
      listRequest.Q = args;
      listRequest.MaxResults = 5;
      IList<SearchResult> searchListResponse = (await listRequest.ExecuteAsync()).Items;


      But that only give me generic information (like video ID, snippet, etc...)



      I found some similar questions like this one
      Get comment or likes count for YouTube video using API 3.0
      But they only tell how to do it using HTTP request and not using the .NET library



      I tried adding the statistic keyword in the Search.List thing like that



      service.Search.List("snippet,statistics");


      But it return me a 400 error



      Google.Apis.Requests.RequestError
      snippet statistics [400]
      Errors [
      Message[snippet statistics] Location[part - parameter]
      Reason[unknownPart] Domain[youtube.part]
      ]


      So my question is how do I get likes count using Google API v3 in C# ?










      share|improve this question















      I'm trying to get likes count using Google API v3 in C#.



      SearchResource.ListRequest listRequest = service.Search.List("snippet");
      listRequest.Q = args;
      listRequest.MaxResults = 5;
      IList<SearchResult> searchListResponse = (await listRequest.ExecuteAsync()).Items;


      But that only give me generic information (like video ID, snippet, etc...)



      I found some similar questions like this one
      Get comment or likes count for YouTube video using API 3.0
      But they only tell how to do it using HTTP request and not using the .NET library



      I tried adding the statistic keyword in the Search.List thing like that



      service.Search.List("snippet,statistics");


      But it return me a 400 error



      Google.Apis.Requests.RequestError
      snippet statistics [400]
      Errors [
      Message[snippet statistics] Location[part - parameter]
      Reason[unknownPart] Domain[youtube.part]
      ]


      So my question is how do I get likes count using Google API v3 in C# ?







      c# youtube-api youtube-api-v3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 15:06







      Xwilarg

















      asked Nov 12 '18 at 13:03









      XwilargXwilarg

      1525




      1525
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I'm not familiar with .NET but I can tell you the likeCount is in statistics but that is not available through the Search endpoint. You must use the Videos endpoint and request statistics that way. Hopefully that will point you in the right direction.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262781%2fc-sharp-youtube-api-v3-get-likes-count%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I'm not familiar with .NET but I can tell you the likeCount is in statistics but that is not available through the Search endpoint. You must use the Videos endpoint and request statistics that way. Hopefully that will point you in the right direction.






            share|improve this answer


























              0














              I'm not familiar with .NET but I can tell you the likeCount is in statistics but that is not available through the Search endpoint. You must use the Videos endpoint and request statistics that way. Hopefully that will point you in the right direction.






              share|improve this answer
























                0












                0








                0






                I'm not familiar with .NET but I can tell you the likeCount is in statistics but that is not available through the Search endpoint. You must use the Videos endpoint and request statistics that way. Hopefully that will point you in the right direction.






                share|improve this answer












                I'm not familiar with .NET but I can tell you the likeCount is in statistics but that is not available through the Search endpoint. You must use the Videos endpoint and request statistics that way. Hopefully that will point you in the right direction.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 14 '18 at 21:15









                johnh10johnh10

                2,6121720




                2,6121720






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262781%2fc-sharp-youtube-api-v3-get-likes-count%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Full-time equivalent

                    Bicuculline

                    さくらももこ