Reputation: 375
I'm trying to do some machine learning on API usage. For that, I want to find some instances of GitHub repos that contain plain Java (non-Android) projects that match certain keywords. Let's say my query is sth like this:
https://api.github.com/search/repositories?q=foobar&language:Java&sort=stars&order=desc
which should show me all (or the top 30) projects containing the word "foobar" written in Java sorted by number of stars. However, "language:Java" also lets all JavaScript project through. Is there a better way to say that I want "Java" and not something that contains "Java" as a language?
Beyond that, I'd like to exclude android projects which is a bit trickier, I guess. But is there a way to say, e.g. exclude everything that has "android" in the description/readme?
Upvotes: 0
Views: 321
Reputation: 136910
This endpoint only supports three parameters: q
, sort
, and order
. The language should be submitted as part of the q
parameter, i.e. joined to it with +
instead of separated with &
:
https://api.github.com/search/repositories?q=foobar+language:Java&sort=stars&order=desc
See the example query for another example.
Upvotes: 1