I want to get a list of repositories or files where the contents of the files contained in the repositories match the keywords I specify in the search. I tried doing a simple search using https GET request and it looks like the search is not possible without specifying the repository or organization name. I get the below error.
https://api.github.com/search/code?q=authorization+in:file
{
"message": "Validation Failed",
"errors": [
{
"message": "Must include at least one user, organization, or repository",
"resource": "Search",
"field": "q",
"code": "invalid"
}
],
"documentation_url": "https://developer.github.com/v3/search/#search-code"
}
I understand that searching without repository or organization name will be resource-intensive operation. Is there any work-around for this? I was assuming that since I am able to get results by using online search, I should be able to achieve the same using git search api.
So basically I am trying to simulate the below:
https://github.com/search?utf8=%E2%9C%93&q=authorization&type=Code&ref=searchresults