how to get total issues count of repository from github api ? #61508
-
Select Topic AreaQuestion BodyHey there Everyone 👋🏻Recently i tried to fetch a repository's total issues count without getting those issues itself, i tried many methods to get that count but in the end i got frustated. This is what i get after calling issues
But when we look at the repository's issue block we can see the numbers are indicated like this I don't get this about how this site only getting the count perfectly but i can't get these values from the API ? I tried to used several methods on javascript like I want to know that the API has the support to just return the total count of issues and PR's. Your thoughts and feedbacks are highly appreciated! Thank you for your attention regarding this matter. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
gh api /search/issues?q="repo:pranjay-poddar/Dev-Geeks+is:issue" --jq .total_count
# 2131
gh api /search/issues?q="repo:pranjay-poddar/Dev-Geeks+is:issue+is:closed" --jq .total_count
# 1521
gh api /search/issues?q="repo:pranjay-poddar/Dev-Geeks+is:issue+is:open" --jq .total_count
# 610 |
Beta Was this translation helpful? Give feedback.
-
@LangLangBart Hi thanks for the detailed explanation! will this work if the number of issues (open or closed) is huge? or are there any limits like the rest api (number of items per page or pagination)? |
Beta Was this translation helpful? Give feedback.
REST API
andGraphQL API
have no parity, they are a Venn Diagram, feature-wise.GraphQL API
has nocontributors
object, only acollabrators
object and this info is only accessible when you have some kind of access to the repo, you should receive an error messagecollaborators
!=contributors