I’m trying to fetch all files of a particular extension (in this case, *.zip files) across all repositories in an organization using the GitHub API.
If I use the GitHub web search directly in the browser, this works perfectly:
https://github.com/search?q=org:ORGNAME+path:*.zip&type=code
I can see 27 results on the web UI.
However, when I try to use the API:
curl -H "Authorization: Bearer <MY_GITHUB_TOKEN>" "https://api.github.com/search/code?q=org:ORGNAME+path:*.zip"
I get:
{ "total_count": 0, "incomplete_results": false, "items": [] }
The token has all required scopes, and I am authenticated.
?q=org%3AORGNAME+path%3A%2A.zip?path:*.wasm.