Github API sorting search results by the created_at field

泪湿孤枕 提交于 2019-12-20 00:20:11

问题


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_at&order=desc

and

https://api.github.com/search/repositories?q=blog&sort=created&order=desc

But I get the same results as this query:

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

回答1:


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.



来源:https://stackoverflow.com/questions/40762518/github-api-sorting-search-results-by-the-created-at-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!