Skip to content

API Search Repositories with no duplicate repos. it's possible? #24361

Discussion options

You must be logged in to vote

Thanks for sharing the URL. I tried the following and, at least in the first 100 results, there are no duplicate repositories:

$ http -pb "https://api.github.com/search/repositories?q=language:python&sort=stars&order=desc&per_page=100" | jq .items[].html_url | wc -l
     100
$ http -pb "https://api.github.com/search/repositories?q=language:python&sort=stars&order=desc&per_page=100" | jq .items[].html_url | uniq | wc -l
     100

Are you certain you’re collating or parsing the results correctly? It might also be that, depending on how you paginate, that the sorted results could shift between requests and that might be the cause of the duplicates.

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment