Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

HN comment scores are not public, so I am unsure how you find the "most upvoted comments"


Algolia's API show votes for older comments (not sure how old is the line when it stops showing).

Edit: naturally, there is a strong bias for older comments in the list.

Code I use:

    <script>
		
		  $(document).ready(function() {
  var lasthours = "";
    
    $("#refresh").on("click", function() {
      
      var html = "";
      var url = "https://hn.algolia.com/api/v1/search?tags=comment&numericFilters=points>120&page=";
      var page = Math.floor(Math.random() * (20)) + 1;
      url += page.toString();
       
      var position = 0;
      position = Math.floor(Math.random() * 20);
   
      
    $.getJSON(url, function(json) {
      
        var hits = json.hits;
        
        var html = "<p>"+hits[position].comment_text+"</p><p>Story: <a  target='_blank'  href='"+hits[position].story_url+"'>"+hits[position].story_title+"</a><br><a  target='_blank'  href='https://news.ycombinator.com/item?id="+hits[position].story_id+"'>comment by "+hits[position].author+"</a></p>";
        
    $("#quote-text").html(html);
    });
    });
  });
		
		</script>


The Algolia API cutoff for comment scores is October 2014. (which I know because it was cut off after I made a blog post on the subject: http://minimaxir.com/2014/10/hn-comments-about-comments/)

There have been quite a few good comments since then.

It is worse to make an incredibly biased list than no list at all.


It is just a learning project. Feel free to not access it and downvote my comment advertising it if you think it is dangerous.


My comment was not a criticism, but a warning. It is very important to note where the data is coming from and any associated caveats which may influence the results.



Been using HN regularly for about two years now, and have just figured out two of the features from this topic: /bestcomments and /favorites?id=<USERNAME>.


You might want to check out "Lists" link at the bottom of the page; there's a bunch of things there.


top of every story probably


That is a very bad metric because comment rankings are a function of score and time.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: