GitHub Pull Request Search API
Search GitHub pull requests by keyword and filter by repository, state, author, labels, review status, draft state or merge date. Each result includes the title, state, author, merge status, labels and dates.
- Endpoint
- POST /github/search-pull-requests
- Price
- 1 credit per request
- SDK
- client.github.searchPullRequests()
- MCP tool
- github_search_pull_requests
curl -X POST "https://api.bridgly.app/github/search-pull-requests" \ -H "Authorization: Bearer $BRIDGLY_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "dark mode", "state": "open", "review": "required", "count": 10}'import osimport requestsresponse = requests.post( "https://api.bridgly.app/github/search-pull-requests", headers={"Authorization": f"Bearer {os.environ['BRIDGLY_KEY']}"}, json={ "query": "dark mode", "state": "open", "review": "required", "count": 10, },)data = response.json()const response = await fetch("https://api.bridgly.app/github/search-pull-requests", { method: "POST", headers: { Authorization: `Bearer ${process.env.BRIDGLY_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "query": "dark mode", "state": "open", "review": "required", "count": 10 }),});const data = await response.json();import { Bridgly } from "@bridgly/sdk";const client = new Bridgly({ apiKey: "bgly_YOUR_KEY" });const res = await client.github.searchPullRequests({ query: "dark mode", state: "open", review: "required", count: 10});if (res.type === "success") { console.log(res.data);}What does the GitHub Pull Request Search API return?
GitHub pull request search API: search PRs by keyword, repo, state, author, labels, review status, draft and merge date, with labels and merge status. Every response has the same envelope: the result in data, plus timeMs and the creditsCost of the call.
Request body
querystring- Free-text search terms, matched against the default fields for this search type, e.g. "web framework".
ownersstring[]- Limit to these owners (users or orgs). Maps to `user:`.
reposstring[]- Limit to these "owner/name" repositories. Maps to `repo:`.
languagestring- Language of the containing repo. Maps to `language:`.
stateenum- Issue/PR state. Maps to `state:`.
- open | closed
authorstring- Opened by this user. Maps to `author:`.
assigneestring- Assigned to this user. Maps to `assignee:`.
mentionsstring- Mentioning this user. Maps to `mentions:`.
labelsstring[]- Require each of these labels. Maps to `label:`.
commentsobject- Filter by comment count. Provide any of gt / gte / lt / lte; combine a lower and upper bound for a range.
comments.gtnumber · nullable- Strictly greater than this value.
comments.gtenumber · nullable- Greater than or equal to this value.
comments.ltnumber · nullable- Strictly less than this value.
comments.ltenumber · nullable- Less than or equal to this value.
createdobject- Filter by creation date. Provide any of gt / gte / lt / lte as YYYY-MM-DD dates; combine a lower and upper bound for a range.
created.gtstring · nullable- Strictly after this date (YYYY-MM-DD).
created.gtestring · nullable- On or after this date (YYYY-MM-DD).
created.ltstring · nullable- Strictly before this date (YYYY-MM-DD).
created.ltestring · nullable- On or before this date (YYYY-MM-DD).
updatedobject- Filter by last update date. Provide any of gt / gte / lt / lte as YYYY-MM-DD dates; combine a lower and upper bound for a range.
updated.gtstring · nullable- Strictly after this date (YYYY-MM-DD).
updated.gtestring · nullable- On or after this date (YYYY-MM-DD).
updated.ltstring · nullable- Strictly before this date (YYYY-MM-DD).
updated.ltestring · nullable- On or before this date (YYYY-MM-DD).
closedobject- Filter by closed date. Provide any of gt / gte / lt / lte as YYYY-MM-DD dates; combine a lower and upper bound for a range.
closed.gtstring · nullable- Strictly after this date (YYYY-MM-DD).
closed.gtestring · nullable- On or after this date (YYYY-MM-DD).
closed.ltstring · nullable- Strictly before this date (YYYY-MM-DD).
closed.ltestring · nullable- On or before this date (YYYY-MM-DD).
orderenum · default desc- Sort direction. Defaults to "desc".
- desc | asc
countinteger · 1–10 · default 10- Number of results to return (1–10). Defaults to 10.
cursorstring- The previous response's `nextCursor`, to fetch the next page. Omit it for the first page.
draftboolean- Filter by draft state. Maps to `draft:`.
mergedobject- Filter by merge date (only merged PRs). Provide any of gt / gte / lt / lte as YYYY-MM-DD dates; combine a lower and upper bound for a range.
merged.gtstring · nullable- Strictly after this date (YYYY-MM-DD).
merged.gtestring · nullable- On or after this date (YYYY-MM-DD).
merged.ltstring · nullable- Strictly before this date (YYYY-MM-DD).
merged.ltestring · nullable- On or before this date (YYYY-MM-DD).
reviewenum- Review status. Maps to `review:`.
- none | required | approved | changes-requested
sortenum · default best-match- Sort field. Defaults to relevance ("best-match").
- best-match | created | updated | comments
Example response
{ "timeMs": 1840, "creditsCost": 1, "data": { "nextCursor": "string", "query": "string", "totalCount": 0, "issues": [ { "id": "string", "number": 0, "title": "string", "state": "string", "url": "string", "isPullRequest": true, "isDraft": true, "merged": true, "authorLogin": "string", "repository": "string", "repositoryUrl": "string", "commentsCount": 0, "labels": [ "string" ], "createdAt": "string", "updatedAt": "string", "closedAt": "string" } ] }}What can you build with the GitHub Pull Request Search API?
Track contributions
List the pull requests a developer opened and merged across projects.
Review queues
Find open pull requests that still need a review.
Release notes
Collect merged pull requests in a date range to draft a changelog.
GitHub Pull Request Search API questions
How do I list the merged pull requests of a repository?
Set repos to it and merged to the date range you want. Each pull request comes back with title, state, author, merge status, labels and dates.
Can I find pull requests waiting for review?
Yes. Set state to open and review to required, and add repos or owners to limit it to your projects.
Can I see a developer’s open-source contributions?
Set author to their username and merged to a date range to list the pull requests they got merged, and in which repositories.
How do I get more than 10 results from a GitHub pull request search?
Each call returns up to 10 pull requests and a nextCursor. Send it back as cursor to get the next page; it is null when there are no more.
How do I distinguish merged work from pull requests that were only closed?
Use merged with a date or date range when collecting work that landed. A closed state can include an unmerged pull request, so state alone is insufficient for release reporting. Preserve the returned merged status alongside the title, repository and URL when preparing a changelog; the merged date filter selects the reporting period.
How can I build a queue of pull requests that need review?
Set state to open, review to required and draft to false, then restrict repos or owners to the projects you maintain. Draft status and review status describe different stages of work. Keep those filters when paging with after so each page belongs to the same review queue.
How do I use the GitHub Pull Request Search API?
Send a POST request to https://api.bridgly.app/github/search-pull-requests with the filters you want in the JSON body and your API key in the Authorization header. In the TypeScript SDK, call client.github.searchPullRequests(). AI agents connected to Bridgly over MCP can call the github_search_pull_requests tool.
How much does the GitHub Pull Request Search API cost?
Costs 1 credit per request. Credits cost $2.00 per 1,000 on pay-as-you-go and as low as $1.00 per 1,000 at volume. New accounts on a business email start with 100 free credits, and failed requests are never charged.
More GitHub endpoints
The same API key works on every endpoint. See all GitHub API endpoints.
- GitHub Discussion Search API→GitHub discussions API: search GitHub Discussions by keyword, repo, author, comment count, dates and answered status, with category and comment count.
- GitHub Commit Search API→GitHub commit search API: search commits across public repositories by message, author, committer, date or SHA, with message, author and repository.
- GitHub Issue Search API→GitHub issues API: search issues by keyword, repo, state, labels, author, assignee, comment count and dates, with title, state, labels and timestamps.
- GitHub User Search API→Find GitHub developers and organizations by location, language, followers and join date. Get bios and repository counts with the GitHub User Search API.
Try the GitHub Pull Request Search API
100 free credits on business email, no card. Your first call takes a minute.