GraphQL Get list of repos by name #24558
-
Using githubs GraphQL, I am trying to get a list of all repos (created after 01/01/2019) whose name or description contain any of the following strings: [“covid”, “coronavirus”, “Wuhan”]. I only really want the name of the repo, the date of creation, and whether it’s a fork or not, as I have specified below. Right now I have,
I’m having trouble figuring out how to use the ‘OR’ operator in the query name field. I also don’t know how to search through the description of a repo. I would also like to get the entire list of repos that match my search, not just the first five. Doing a quick search on github for ‘covid’ shows there are ~50k repos with covid in the name. I know there are rate limits, will I be allowed to download the entire list that my query returns? Any help is appreciated, Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Not sure regarding the GraphQL API, but you can run a very simliar search using the REST search API. I don’t think that there is an “OR” option in the search, but you use the following to search a specific string in the name and description: https://api.github.com/search/repositories?q=coronavirus+fork:false+created:%3E2019-01-01 Regarding downloading all the results, you should use the pagination mechanism. You have 10 reqeusts per minute for an unauthenticated user, and 30 per minute for an authentication one, so you should build your “downloading script” accordingly. Hope that helps. |
Beta Was this translation helpful? Give feedback.
Not sure regarding the GraphQL API, but you can run a very simliar search using the REST search API.
I don’t think that there is an “OR” option in the search, but you use the following to search a specific string in the name and description:
https://api.github.com/search/repositories?q=coronavirus+fork:false+created:%3E2019-01-01
Regarding downloading all the results, you should use the pagination mechanism.
You have 10 reqeusts per minute for an unauthenticated user, and 30 per minute for an authentication one, so you should build your “downloading script” accordingly.
Hope that helps.