Skip to main content

Search Issues

Search for issues across GitHub using GitHub’s search syntax.
GET /api/search-issues

Query Parameters

q
string
required
Search query using GitHub search syntaxThe is:issue qualifier is automatically added to your query.Examples:
  • repo:owner/repo - Search in a specific repository
  • author:username - Issues by a specific author
  • assignee:username - Issues assigned to a user
  • is:open - Only open issues
  • is:closed - Only closed issues
  • label:bug - Issues with the “bug” label
  • created:>2024-01-01 - Issues created after a date
  • in:title - Search in titles only
  • in:body - Search in issue body
page
number
default:"1"
Page number for pagination (minimum: 1)
per_page
number
default:"30"
Number of results per page (minimum: 1, maximum: 100)

Response

Returns the standard GitHub search response object.
total_count
number
Total number of issues matching the search
incomplete_results
boolean
Whether the search results are incomplete
items
object[]
Array of issue objects matching GitHub’s issue format

Example Request

curl "https://yourdomain.com/api/search-issues?q=repo:octocat/Hello-World+is:open+label:bug&per_page=10"

Example Response

{
  "total_count": 156,
  "incomplete_results": false,
  "items": [
    {
      "id": 9876543210,
      "number": 42,
      "title": "Bug in user authentication",
      "state": "open",
      "user": {
        "login": "octocat",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif"
      },
      "assignees": [
        {
          "login": "developer1",
          "avatar_url": "https://github.com/developer1.png"
        }
      ],
      "created_at": "2024-01-10T08:15:00Z",
      "updated_at": "2024-01-15T16:30:00Z",
      "closed_at": null,
      "html_url": "https://github.com/octocat/Hello-World/issues/42",
      "labels": [
        {
          "name": "bug",
          "color": "d73a4a"
        },
        {
          "name": "priority:high",
          "color": "ff0000"
        }
      ],
      "comments": 8,
      "body": "Users are experiencing login failures when..."
    }
  ]
}

Error Responses

Search Query Examples

Here are some common search patterns:
GET /api/search-issues?q=is:open+label:bug

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
The GitHub integration in /lib/github.ts includes rate limit error handling via GitHubRateLimitError which provides:
  • resetAt - Unix timestamp when the rate limit resets
  • limit - Maximum requests allowed
  • used - Number of requests used

Notes

  • Results are automatically sorted by updated date in descending order
  • The is:issue qualifier is automatically prepended to your search query to exclude pull requests
  • 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
  • The search matches both open and closed issues unless specified otherwise