Search Pull Requests
Search for pull requests across GitHub using GitHub’s search syntax.Query Parameters
Search query using GitHub search syntaxThe
is:pr qualifier is automatically added to your query.Examples:repo:owner/repo- Search in a specific repositoryauthor:username- PRs by a specific authoris:open- Only open PRsis:closed- Only closed PRsstate:merged- Only merged PRslabel:bug- PRs with the “bug” labelcreated:>2024-01-01- PRs created after a date
Page number for pagination (minimum: 1)
Number of results per page (minimum: 1, maximum: 100)
Response
Returns the standard GitHub search response object.Total number of pull requests matching the search
Whether the search results are incomplete
Array of pull request objects matching GitHub’s PR format
Example Request
Example Response
Error Responses
Search Query Examples
Here are some common search patterns:Rate Limiting
This endpoint is subject to GitHub API rate limits:- Authenticated requests: 5,000 requests per hour
- Search API specific: 30 requests per minute
/lib/github.ts includes rate limit error handling via GitHubRateLimitError which provides:
resetAt- Unix timestamp when the rate limit resetslimit- Maximum requests allowedused- Number of requests used
Notes
- Results are automatically sorted by
updateddate in descending order - The
is:prqualifier is automatically prepended to your search query - Maximum 100 results per page
- Page numbers start at 1 (values < 1 are normalized to 1)
- All timestamps are in ISO 8601 format (UTC)
- Authentication is required and managed via session cookies