Search issues and pull requests
Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/[email protected]/rest/overview/resources-in-the-rest-api#pagination). When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/[email protected]/rest/reference/search#text-match-metadata). For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. `q=windows+label:bug+language:python+state:open&sort=created&order=asc` This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)."
/search/issues- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Query Parameters
- q stringrequired
The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/[email protected]/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://docs.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers.
- sort stringoptional
Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/[email protected]/rest/reference/search#ranking-search-results)
- order stringoptional
Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`.
- per_page integeroptional
Results per page (max 100)
- page integeroptional
Page number of the results to fetch.
Responses
Response
items array[Issue Search Result Item object]required
items Issue Search Result Item objectIssue Search Result Item
Issue Search Result Item
assignee Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
How the author is associated with the repository.
Example: OWNER
milestone Milestone objectrequirednullable A collection of related issues and pull requests.
A collection of related issues and pull requests.
Example: 2013-02-12T13:22:01Z
Example: 8
Example: 2011-04-10T20:09:31Z
Simple User
Example: Tracking milestone for version 1.0
Example: 2012-10-09T23:39:01Z
Example: https://github.com/octocat/Hello-World/milestones/v1.0
Example: 1002604
Example: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels
Example: MDk6TWlsZXN0b25lMTAwMjYwNA==
The number of the milestone.
Example: 42
Example: 4
The state of the milestone.
Example: open
The title of the milestone.
Example: v1.0
Example: 2014-03-03T18:58:10Z
Example: https://api.github.com/repos/octocat/Hello-World/milestones/1
performed_via_github_app GitHub app objectoptionalnullable GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
Example: "Iv1.25b5d1e65ffc4022"
Example: "1d4b2097ac622ba702d19de498f005747a8b21d3"
Example: 2017-07-08T16:18:44-04:00
Example: The description of the app.
The list of events for the GitHub app
[
"label",
"deployment"
]Example: https://example.com
Example: https://github.com/apps/super-ci
Unique identifier of the GitHub app
Example: 37
The number of installations associated with the GitHub app
Example: 5
The name of the GitHub app
Example: Probot Owners
Example: MDExOkludGVncmF0aW9uMQ==
Simple User
"-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEArYxrNYD/iT5CZVpRJu4rBKmmze3PVmT/gCo2ATUvDvZTPTey\nxcGJ3vvrJXazKk06pN05TN29o98jrYz4cengG3YGsXPNEpKsIrEl8NhbnxapEnM9\nJCMRe0P5JcPsfZlX6hmiT7136GRWiGOUba2X9+HKh8QJVLG5rM007TBER9/z9mWm\nrJuNh+m5l320oBQY/Qq3A7wzdEfZw8qm/mIN0FCeoXH1L6B8xXWaAYBwhTEh6SSn\nZHlO1Xu1JWDmAvBCi0RO5aRSKM8q9QEkvvHP4yweAtK3N8+aAbZ7ovaDhyGz8r6r\nzhU1b8Uo0Z2ysf503WqzQgIajr7Fry7/kUwpgQIDAQABAoIBADwJp80Ko1xHPZDy\nfcCKBDfIuPvkmSW6KumbsLMaQv1aGdHDwwTGv3t0ixSay8CGlxMRtRDyZPib6SvQ\n6OH/lpfpbMdW2ErkksgtoIKBVrDilfrcAvrNZu7NxRNbhCSvN8q0s4ICecjbbVQh\nnueSdlA6vGXbW58BHMq68uRbHkP+k+mM9U0mDJ1HMch67wlg5GbayVRt63H7R2+r\nVxcna7B80J/lCEjIYZznawgiTvp3MSanTglqAYi+m1EcSsP14bJIB9vgaxS79kTu\noiSo93leJbBvuGo8QEiUqTwMw4tDksmkLsoqNKQ1q9P7LZ9DGcujtPy4EZsamSJT\ny8OJt0ECgYEA2lxOxJsQk2kI325JgKFjo92mQeUObIvPfSNWUIZQDTjniOI6Gv63\nGLWVFrZcvQBWjMEQraJA9xjPbblV8PtfO87MiJGLWCHFxmPz2dzoedN+2Coxom8m\nV95CLz8QUShuao6u/RYcvUaZEoYs5bHcTmy5sBK80JyEmafJPtCQVxMCgYEAy3ar\nZr3yv4xRPEPMat4rseswmuMooSaK3SKub19WFI5IAtB/e7qR1Rj9JhOGcZz+OQrl\nT78O2OFYlgOIkJPvRMrPpK5V9lslc7tz1FSh3BZMRGq5jSyD7ETSOQ0c8T2O/s7v\nbeEPbVbDe4mwvM24XByH0GnWveVxaDl51ABD65sCgYB3ZAspUkOA5egVCh8kNpnd\nSd6SnuQBE3ySRlT2WEnCwP9Ph6oPgn+oAfiPX4xbRqkL8q/k0BdHQ4h+zNwhk7+h\nWtPYRAP1Xxnc/F+jGjb+DVaIaKGU18MWPg7f+FI6nampl3Q0KvfxwX0GdNhtio8T\nTj1E+SnFwh56SRQuxSh2gwKBgHKjlIO5NtNSflsUYFM+hyQiPiqnHzddfhSG+/3o\nm5nNaSmczJesUYreH5San7/YEy2UxAugvP7aSY2MxB+iGsiJ9WD2kZzTUlDZJ7RV\nUzWsoqBR+eZfVJ2FUWWvy8TpSG6trh4dFxImNtKejCR1TREpSiTV3Zb1dmahK9GV\nrK9NAoGAbBxRLoC01xfxCTgt5BDiBcFVh4fp5yYKwavJPLzHSpuDOrrI9jDn1oKN\nonq5sDU1i391zfQvdrbX4Ova48BN+B7p63FocP/MK5tyyBoT8zQEk2+vWDOw7H/Z\nu5dTCPxTIsoIwUw1I+7yIxqJzLPFgR2gVBwY1ra/8iAqCj+zeBw=\n-----END RSA PRIVATE KEY-----\n"The set of permissions for the GitHub app
{
"deployments": "write",
"issues": "read"
}The slug name of the GitHub app
Example: probot-owners
Example: 2017-07-08T16:18:44-04:00
Example: "6fba8f2fc8a7e8f2cca5577eddd82ca7586b3b6b"
pull_request objectoptional
reactions Reaction Rollup objectoptional
repository Repository objectoptionalA git repository
A git repository
Whether to allow forking this repo
Whether to allow merge commits for pull requests.
Example: true
Whether to allow rebase merges for pull requests.
Example: true
Whether to allow squash merges for pull requests.
Example: true
Example: http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}
Whether the repository is archived.
Example: http://api.github.com/repos/octocat/Hello-World/assignees{/user}
Example: http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/branches{/branch}
Example: https://github.com/octocat/Hello-World.git
Example: http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}
Example: http://api.github.com/repos/octocat/Hello-World/comments{/number}
Example: http://api.github.com/repos/octocat/Hello-World/commits{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}
Example: http://api.github.com/repos/octocat/Hello-World/contents/{+path}
Example: http://api.github.com/repos/octocat/Hello-World/contributors
Example: 2011-01-26T19:01:12Z
The default branch of the repository.
Example: master
Whether to delete head branches when pull requests are merged
Example: false
Example: http://api.github.com/repos/octocat/Hello-World/deployments
Example: This your first repo!
Returns whether or not this repository disabled.
Example: http://api.github.com/repos/octocat/Hello-World/downloads
Example: http://api.github.com/repos/octocat/Hello-World/events
Example: 9
Example: http://api.github.com/repos/octocat/Hello-World/forks
Example: octocat/Hello-World
Example: http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}
Example: http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}
Example: git:github.com/octocat/Hello-World.git
Whether downloads are enabled.
Example: true
Whether issues are enabled.
Example: true
Whether projects are enabled.
Example: true
Whether the wiki is enabled.
Example: true
Example: https://github.com
Example: http://api.github.com/repos/octocat/Hello-World/hooks
Example: https://github.com/octocat/Hello-World
Unique identifier of the repository
Example: 42
Whether this repository acts as a template that can be used to generate new repositories.
Example: true
Example: http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}
Example: http://api.github.com/repos/octocat/Hello-World/issues/events{/number}
Example: http://api.github.com/repos/octocat/Hello-World/issues{/number}
Example: http://api.github.com/repos/octocat/Hello-World/keys{/key_id}
Example: http://api.github.com/repos/octocat/Hello-World/labels{/name}
Example: http://api.github.com/repos/octocat/Hello-World/languages
License Simple
Example: http://api.github.com/repos/octocat/Hello-World/merges
Example: http://api.github.com/repos/octocat/Hello-World/milestones{/number}
Example: git:git.example.com/octocat/Hello-World
The name of the repository.
Example: Team Environment
Example: MDEwOlJlcG9zaXRvcnkxMjk2MjY5
Example: http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}
Example: 0
Simple User
Simple User
Whether the repository is private or public.
Example: http://api.github.com/repos/octocat/Hello-World/pulls{/number}
Example: 2011-01-26T19:06:43Z
Example: http://api.github.com/repos/octocat/Hello-World/releases{/id}
Example: 108
Example: [email protected]:octocat/Hello-World.git
Example: 80
Example: http://api.github.com/repos/octocat/Hello-World/stargazers
Example: "2020-07-09T00:17:42Z"
Example: http://api.github.com/repos/octocat/Hello-World/statuses/{sha}
Example: http://api.github.com/repos/octocat/Hello-World/subscribers
Example: http://api.github.com/repos/octocat/Hello-World/subscription
Example: https://svn.github.com/octocat/Hello-World
Example: http://api.github.com/repos/octocat/Hello-World/tags
Example: http://api.github.com/repos/octocat/Hello-World/teams
Example: http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}
Example: 2011-01-26T19:14:43Z
Example: https://api.github.com/repos/octocat/Hello-World
The repository visibility: public, private, or internal.
Example: 80
user Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
Not modified
Forbidden
Validation failed
errors array[object]optional
items object
Service unavailable