-
-
Save usametov/af8f13a351a66fb05a9895f11417dd9d to your computer and use it in GitHub Desktop.
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}' | |
I'm able to search GitHub like
topic:go topic:ecs
and I seem to get only results that include both topics. I got the tip from your gist, thanks! 👍
thanks, that's a good idea!
Awesome . Thanks !
thanks
@chmac This is great.
This is how it looks like
And this is the matching url https://github.com/search?q=topic%3Agui+topic%3Aterminal+topic%3Acurses
Your answers are AND operator between topics.
How about the OR operator between topics? any ideas on that?
I'd like to use the OR operator for topics @behnam7171, but I haven't found a way yet
OR operator is not supported in REST API, you have to issue multiple calls and combine the result. @behnam7171 @arivasnxt
seems like there is a better way of calling github api. check this out:
https://github.com/octokit/octokit.js
it works with github graphql
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
I'm able to search GitHub like
topic:go topic:ecs
and I seem to get only results that include both topics. I got the tip from your gist, thanks! 👍