GitHub pull request
One pull request: title, state (open, closed or merged), author, description, labels, assignees and requested reviewers, head and base branches, merge details (merged by, merge commit, mergeable state), commit, comment and review-comment counts, additions and deletions, the files changed (up to the first 100, each with status, additions, deletions and patch) and the reviews (reviewer, state, text, time).
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
urlrequired | string | Pull request URL (https://github.com/owner/repo/pull/123), or owner/repo together with number. Example: https://github.com/facebook/react/pull/28000 |
number | integer | Pull request number, when url is only the repository. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/github/v1/repository/pull?url=https%3A%2F%2Fgithub.com%2Ffacebook%2Freact%2Fpull%2F28000" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/github/v1/repository/pull",
params={"url": "https://github.com/facebook/react/pull/28000"},
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/repository/pull");
url.searchParams.set("url", "https://github.com/facebook/react/pull/28000");
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).