Pull requests opened by a GitHub user
GET https://api.api.sh/github/v1/user/pull-requests
Every response includes credits_used: the credits this call cost.
Part of the GitHub API: 44 endpoints with prices, use cases and example responses.
Parameters
| name | type | description |
|---|---|---|
usernamerequired | string | Example: torvalds |
state | string | open, closed or all. Example: all |
page | string | Example: 1 |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/github/v1/user/pull-requests?username=torvalds" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/github/v1/user/pull-requests",
params={"username": "torvalds"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/github/v1/user/pull-requests");
url.searchParams.set("username", "torvalds");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
Example response (real call, trimmed: lists cut to 2 items, long text shortened, raw left out)
{"handle": "torvalds","total": 86,"incomplete_results": false,"page": 1,"next_page": null,"count": 86,"pull_requests": [{"id": 5912575820,"number": 5048,"title": "Use modern Linux bluez address type","url": "https://github.com/subsurface/subsurface/pull/5048","state": "closed","draft": false,"merged_at": "2026-10-19T20:13:36Z","repo": "subsurface/subsurface","comments": 6,"labels": [],"created_at": "2026-10-18T18:11:41Z","closed_at": "2026-10-19T20:13:36Z","body": "<!-- Lines like this one are comments and will not be shown in the final output. -->\n<!-- Make sure that you have read CONTRIBUTING.md and a…","node_id": "PR_kwDOACNkis8AAAABJMAipA","updated_at": "2026-10-19T20:13:36Z","locked": false,"active_lock_reason": null,"author_association": "COLLABORATOR","state_reason": null,"user": {"login": "torvalds","id": 1024025,"type": "User","avatar": "https://avatars.githubusercontent.com/u/1024025?v=4","url": "https://github.com/torvalds","node_id": "MDQ6VXNlcjEwMjQwMjU=","site_admin": false,"user_view_type": "public"},"assignees": [],"milestone": null,"label_details": [],"reactions": {"url": "https://api.github.com/repos/subsurface/subsurface/issues/5048/reactions","total_count": 96,"+1": 57,"-1": 0,"laugh": 0,"hooray": 5,"confused": 0,"heart": 14,"rocket": 10,"eyes": 10},"pull_request_urls": {"url": "https://api.github.com/repos/subsurface/subsurface/pulls/5048","html_url": "https://github.com/subsurface/subsurface/pull/5048","diff_url": "https://github.com/subsurface/subsurface/pull/5048.diff","patch_url": "https://github.com/subsurface/subsurface/pull/5048.patch","merged_at": "2026-10-19T20:13:36Z"},"repository_url": "https://api.github.com/repos/subsurface/subsurface","score": 1},{"id": 2760110089,"number": 69,"title": "Garmin: Report correct local time offset","url": "https://github.com/subsurface/libdc/pull/69","state": "closed","draft": false,"merged_at": "2024-12-26T23:18:29Z","repo": "subsurface/libdc","comments": 0,"labels": [],"created_at": "2024-12-26T20:13:25Z","closed_at": "2024-12-26T23:18:29Z","body": "We stupidly thought that the local time offset was in the \"DEVICE_SETTINGS\" message as the time_offset field. I'm pretty sure I've seen som…","node_id": "PR_kwDOBKvy_M6GRfue","updated_at": "2024-12-28T03:03:04Z","locked": true,"active_lock_reason": "resolved","author_association": "COLLABORATOR","state_reason": null,"user": {"login": "torvalds","id": 1024025,"type": "User","avatar": "https://avatars.githubusercontent.com/u/1024025?v=4","url": "https://github.com/torvalds","node_id": "MDQ6VXNlcjEwMjQwMjU=","site_admin": false,"user_view_type": "public"},"assignees": [],"milestone": null,"label_details": [],"reactions": {"url": "https://api.github.com/repos/subsurface/libdc/issues/69/reactions","total_count": 115,"+1": 32,"-1": 0,"laugh": 31,"hooray": 11,"confused": 0,"heart": 24,"rocket": 13,"eyes": 4},"pull_request_urls": {"url": "https://api.github.com/repos/subsurface/libdc/pulls/69","html_url": "https://github.com/subsurface/libdc/pull/69","diff_url": "https://github.com/subsurface/libdc/pull/69.diff","patch_url": "https://github.com/subsurface/libdc/pull/69.patch","merged_at": "2024-12-26T23:18:29Z"},"repository_url": "https://api.github.com/repos/subsurface/libdc","score": 1},"… 84 more"],"credits_used": 1,"cached": false} The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.