Search PRs with a specific repository topic

Hacktoberfest and GitHub announced that only repos that have the hacktoberfest topic are eligible for participation. There is an online tool that check the status for a GitHub user by using the v3 issues search API and constructing a query, e.g.

+created:2020-09-30T00:00:00-12:00..2020-10-31T23:59:59-12:00+type:pr+is:public+draft:false+author:freak4pc

Unfortunately, doesn’t seem like there’s a way to filter by repo topic (only by label for the PR itself but that’s not too helpful).

Any thoughts?
Thank you :slight_smile:

FWIW, PRs labelled with hacktoberfest-accepted are also eligible even without the hacktoberfest repository tag (retroactively labeling already merged PRs doesn’t work though).

The repository search API does support topics:

But a request like yours to find pull requests:

https://api.github.com/search/issues?q=created:2020-09-30T00:00:00-12:00..2020-10-31T23:59:59-12:00+type:pr+is:public+draft:false+author:freak4pc

… is an issue search, with doesn’t support topic:hacktoberfest - the context is issues, not repositories, and the results don’t include any repository information other than a URL to the repo.

You could make secondary requests however to determine the topics of the respective repositories:

In Windows cmd you can get the unique repositories like so:

curl "https://api.github.com/search/issues?q=created:2020-09-30T00:00:00-12:00..2020-10-31T23:59:59-12:00+type:pr+is:public+draft:false+author:freak4pc" | jq "[.items[].repository_url] | unique_by(.) | .[]"

And test for the Hacktoberfest topic like:

curl -H "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/repos/GettEngineering/Prism/topics" | jq ".names | contains([\"hacktoberfest\"])"