Github API sorting search results by the created_at field

前端 未结 2 384
长情又很酷
长情又很酷 2021-01-13 03:43

How can I create a search query sorted by the created_at field? I\'ve tried:

https://api.github.com/search/repositories?q=blog&sort=created_         


        
相关标签:
2条回答
  • 2021-01-13 04:07

    The sort parameter only takes one of three values: stars, forks or updated:

    The sort field. One of stars, forks, or updated. Default: results are sorted by best match.

    It doesn't appear to be possible to sort by creation date, but you could read the response of the search query into an array and sort from there.

    0 讨论(0)
  • 2021-01-13 04:18

    In addition to what was written till now I found out here another way. That is:

    https://api.github.com/users/<user name>/repos?sort=created&direction=desc
    

    For example:

    https://api.github.com/users/nadar71/repos?sort=created&direction=desc
    
    0 讨论(0)
提交回复
热议问题