Searching all repositories in my org with filename

Hi all!

In the Github api I want to pull all repositories in my organization only containing filename:main.js

I tried this but I can’t get it to work:

curl \
   -H "Accept: application/vnd.github.mercy-preview+json" \
   -H "Authorization: token myToken" \
    https://api.github.com/search/repositories?q=user:abadgirl97+filename:main.js

Here’s something similar that does work, but once I narrow by filename it no longer works:

curl \
   -H "Accept: application/vnd.github.mercy-preview+json" \
   -H "Authorization: token myToken" \
    https://api.github.com/search/repositories?q=topic:cheltest

Any help is appreciated. Thank you.

1 Like

Hello, maybe I’m late but I made small npm package for Node.js, which can return files of any repo you want, so you can get info about all repos you want and then just filter an array of them

I hope, it will help: