Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github API sorting search results by the created_at field

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
like image 665
Iwko Czerniawski Avatar asked Nov 23 '16 10:11

Iwko Czerniawski


1 Answers

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.

like image 132
kfb Avatar answered Nov 15 '22 09:11

kfb