Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/better-auth/better-hub/llms.txt

Use this file to discover all available pages before exploring further.

Search Pull Requests

Search for pull requests across GitHub using GitHub’s search syntax.
GET /api/search-prs

Query Parameters

q
string
required
Search query using GitHub search syntaxThe is:pr qualifier is automatically added to your query.Examples:
  • repo:owner/repo - Search in a specific repository
  • author:username - PRs by a specific author
  • is:open - Only open PRs
  • is:closed - Only closed PRs
  • state:merged - Only merged PRs
  • label:bug - PRs with the “bug” label
  • created:>2024-01-01 - PRs created after a date
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 pull requests matching the search
incomplete_results
boolean
Whether the search results are incomplete
items
object[]
Array of pull request objects matching GitHub’s PR format

Example Request

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

Example Response

{
  "total_count": 42,
  "incomplete_results": false,
  "items": [
    {
      "id": 1234567890,
      "number": 123,
      "title": "Add new feature",
      "state": "open",
      "user": {
        "login": "octocat",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif"
      },
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-16T14:20:00Z",
      "html_url": "https://github.com/octocat/Hello-World/pull/123",
      "labels": [
        {
          "name": "enhancement",
          "color": "84b6eb"
        }
      ],
      "draft": false
    }
  ]
}

Error Responses

Search Query Examples

Here are some common search patterns:
GET /api/search-prs?q=repo:owner/name+is:open

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:pr qualifier 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

Build docs developers (and LLMs) love