Skip to content

Instantly share code, notes, and snippets.

@usametov
Created February 16, 2021 01:50
Show Gist options
  • Save usametov/af8f13a351a66fb05a9895f11417dd9d to your computer and use it in GitHub Desktop.
Save usametov/af8f13a351a66fb05a9895f11417dd9d to your computer and use it in GitHub Desktop.
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
@sryabkov
Copy link

With GitHub CLI, it looks like this can be done with:

gh search repos --topic ecs --topic go

or if you want JSON and/or additional fields:

gh search repos --topic ecs --topic go --json url,description,stargazersCount,createdAt,updatedAt

AND is implied with multiple --topic parameters and the default sort order is the number of stars

@vednig
Copy link

vednig commented Nov 28, 2024

I built a web tool specifically for multi topic searches, using this gist githubtopics.cloudninelabs.site .

Thanks a lot 🌿.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment