简体   繁体   中英

How can I search only for issues in github repository through github rest api?

I want to get only issues and not pull requests from GitHub rest api in a specific repository, but https://api.github.com/repos/user/repo/issues endpoint returns both issues and pull requests. Github rest api docs don't say anything about searching in a specific repository. Adding q parameter to the above method does not do anything. I can't filter response to find only issues because my repository contains much more pull requests than issues. What is the way to get only issues?

You can use the search issues/PR API and filter with your repo path and is:issue :

GET https://api.github.com/search/issues?q=is:issue%20repo:owner/repo

For example

Note that type:issue also works, checkout this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM