---
title: "GitHub Pull Requests API"
method: GET
path: "/v1/github/pull-requests"
tags: ["GitHub"]
---

# GitHub Pull Requests API

`GET /v1/github/pull-requests`

## Request

- Base URL: `https://api.captapi.com`
- URL: `https://api.captapi.com/v1/github/pull-requests`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

List repo PRs — draft, labels, author{}, head/base, opaque Link cursor (state echoed).

List pull requests for a repository via GitHub REST /pulls. Default state=open (pass closed|all — the applied filter is echoed as data.state). Each row: number, title, state, draft, labels[], author{id,login,avatar,url}, head/base refs, assignees[], requestedReviewers[], closedAt/mergedAt. Empty labels / assignees / requestedReviewers are [] — GitHub told us the collection is empty, not that we failed to read it. Opaque nextCursor from GitHub's Link header (not a bare page number). Billing scales with results (~0.4/PR, min ~12 at default limit).

Docs: https://captapi.com/apis/github-pull-requests

## Query parameters

- `repo` string, required
- `state` string
- `limit` integer
- `cursor` string
- `cache` boolean

## Response `200`

Success. The data object for this endpoint.

- object
  - `success` unknown, required
  - `data` object, required
    - `repository` string: Repository. Example: "vercel/next.js".
    - `state` string: Top-level: filter echoed from the request (open|closed|all). On each PR: GitHub's PR state.
    - `totalReturned` integer: Number of items returned in this response.
    - `nextCursor` string: Opaque Link-header cursor (not a bare page number).
    - `hasMore` boolean: Whether more results are available beyond this page. When true, pass nextCursor to fetch the next page.
    - `pullRequests` object[]
      - `id` integer: Id of this pull requests item.
      - `number` integer: Number. Example: 100.
      - `title` string: Title of this pull requests item.
      - `state` string: Top-level: filter echoed from the request (open|closed|all). On each PR: GitHub's PR state.
      - `draft` boolean: true when the PR is a draft — exclude from review-throughput metrics.
      - `url` string: Canonical URL of the item.
      - `author` object: PR author card {id, login, avatar, url} — not a bare login string.
        - `id` integer: Id of this pull requests item.
        - `login` string
        - `url` string: Canonical URL of the item.
        - `avatar` string
      - `labels` object[]: Label objects [{name, color, description}]. Always an array — [] when the PR has none.
        - `name` string
        - `color` string
      - `head` object: Source branch {ref, sha, label}.
        - `ref` string
        - `sha` string
        - `label` string
      - `base` object: Target branch {ref, sha, label}.
        - `ref` string
        - `sha` string
        - `label` string
      - `createdAt` string: Creation date (ISO 8601).
      - `updatedAt` string: Last update date (ISO 8601).
      - `closedAt` string: When the PR was closed (ISO). Distinct from mergedAt.
      - `mergedAt` string: When the PR was merged (ISO). Null/omitted if not merged.

## Other responses

- `400`: Bad request: wrong platform URL, unknown endpoint, or an invalid parameter value. Not billed.
- `401`: Missing, invalid or revoked API key. Not billed.
- `402`: Not enough credits for this request. Not billed.
- `404`: The resource does not exist or is not public. Not billed.
- `422`: A required parameter is missing or has the wrong type. Not billed.
- `429`: Rate limit reached. Wait for Retry-After seconds. Not billed.
- `502`: The platform could not be reached or returned nothing usable. Retryable, not billed. 503 and 504 use the same envelope.

---

[API](https://skmtc.dev/captapi/apis/captapi-api.md) · [All operations](https://skmtc.dev/captapi/apis/captapi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/captapi/apis/captapi-api/revisions/c9b9ac5ff1bd?raw)
