Sunday, Jul 26, 2026
How to Get All Your Merged Pull Requests Across GitHub Using One REST Endpoint
A direct GitHub REST API endpoint to fetch every merged pull request you've ever opened, across all repositories, in one call — useful for building a contributions section on your portfolio.

How to Get All Your Merged Pull Requests Across GitHub Using One REST Endpoint
I was rebuilding my portfolio site and wanted a section that shows off my open-source contributions — every PR I've had merged, across every repo, not just the ones in my own account. Sounded like a simple thing to fetch.
It wasn't.
I went looking for a direct REST endpoint that would just hand me this data so I could hit it from my portfolio's backend and render it on the page. GitHub's docs have endpoints for issues, for repo pulls, for user activity — but nothing labeled clearly as "give me every merged PR this user has ever opened, anywhere." I ended up digging through several API references before I found the one that actually does it, tucked inside GitHub's search API rather than anywhere I expected.
So this post exists mainly so the next person doesn't have to go digging like I did. Here's the endpoint, straight up.
The endpoint
GET https://api.github.com/search/issues?q=author:<username>+type:pr+is:merged
Swap <username> for a GitHub handle, hit it with curl, fetch, or paste it into the browser, and it returns every merged pull request tied to that account — across all repositories.
For me that meant:
https://api.github.com/search/issues?q=author:Vishesh-Verma-07+type:pr+is:merged
Why it's search/issues and not a pulls endpoint
This tripped me up at first. GitHub treats pull requests as a special type of issue internally, so the cross-repo search for them lives under /search/issues, not /search/pulls — there isn't one. The query qualifiers are what actually filter it down to just PRs:
author:<username>— only PRs opened by this usertype:pr— pull requests only, issues excludedis:merged— only PRs that were actually merged, not just closed
You can layer on more qualifiers if you want to narrow it further — repo:owner/name, created:>2025-01-01, is:open instead of merged — the same search syntax GitHub uses on their website works here.
What came back for me
Running it against my own account returned 5 merged PRs, spread across repos including ones I'd genuinely forgotten I'd contributed to:
- Two in better-auth/better-auth — a fix for a default storage strategy bug around OAuth state, and a CI workflow patch so forked repos don't hang waiting on a private runner
- A spinner animation fix merged into heroui-inc/heroui
- A couple of early ones from repos I contributed to while first learning git and PR workflows
That's exactly the kind of data I wanted for a "Contributions" section — repo name, PR title, merge date, all sitting right there in the JSON.
Wiring it into a portfolio
Since it's a plain REST call, you can fetch it directly from a Next.js server component, an API route, or a static build script:
const res = await fetch(
"https://api.github.com/search/issues?q=author:<username>+type:pr+is:merged",
{ headers: { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } }
);
const { items } = await res.json();
Adding a token isn't required for public data, but it's worth doing anyway — unauthenticated search requests are capped at 10 per minute, and an authenticated request bumps that to 30. If your portfolio rebuilds often or you're testing locally, you'll hit that unauthenticated limit fast.
Each item in items gives you the repo, PR title, merge timestamp, and a link straight to the PR — enough to map directly into cards on a page without any extra API calls.
That's really it
No SDK, no wrapper library, no scraping your own profile page. Just the one endpoint, sitting under GitHub's search API instead of where you'd expect to find it. Hopefully this saves someone else the same digging.