Skip to main content
GET
/
github
/
pull-request
/
:owner
/
:repo
/
:pull_number
Get Pull Request
curl --request GET \
  --url https://api.example.com/github/pull-request/:owner/:repo/:pull_number
{
  "401": {},
  "403": {},
  "404": {},
  "id": 123,
  "number": 123,
  "title": "<string>",
  "body": "<string>",
  "state": "<string>",
  "html_url": "<string>",
  "diff_url": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "commits": 123,
  "additions": 123,
  "deletions": 123,
  "changed_files": 123,
  "user": {
    "login": "<string>",
    "id": 123
  },
  "head": {},
  "base": {}
}

Authentication

This endpoint requires JWT authentication. Include your JWT token in the Authorization header:
Authorization: Bearer <your-jwt-token>

Path Parameters

owner
string
required
The GitHub username or organization name that owns the repository
repo
string
required
The name of the repository
pull_number
number
required
The pull request number (not the pull request ID)

Response

Returns a GitHub pull request object with detailed information about the pull request.
id
number
The unique identifier for the pull request
number
number
The pull request number
title
string
The title of the pull request
body
string
The description/body of the pull request
state
string
The state of the pull request (e.g., “open”, “closed”)
html_url
string
The URL to view the pull request on GitHub
diff_url
string
The URL to view the diff of the pull request
created_at
string
ISO 8601 timestamp when the pull request was created
updated_at
string
ISO 8601 timestamp when the pull request was last updated
commits
number
The number of commits in the pull request
additions
number
The number of lines added in the pull request
deletions
number
The number of lines deleted in the pull request
changed_files
number
The number of files changed in the pull request
user
object
Information about the pull request author
login
string
The GitHub username of the author
id
number
The GitHub user ID of the author
head
object
Information about the head branch of the pull request
base
object
Information about the base branch of the pull request

Example Request

cURL
curl -X GET "https://api.diffy.ai/github/pull-request/octocat/Hello-World/1" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"
JavaScript
const response = await fetch(
  'https://api.diffy.ai/github/pull-request/octocat/Hello-World/1',
  {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    }
  }
);

const pullRequest = await response.json();
console.log(pullRequest);
Python
import requests

url = "https://api.diffy.ai/github/pull-request/octocat/Hello-World/1"
headers = {
    "Authorization": "Bearer YOUR_JWT_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
pull_request = response.json()
print(pull_request)

Example Response

{
  "id": 1234567890,
  "number": 1,
  "title": "Add new feature",
  "body": "This PR adds a new feature to the application",
  "state": "open",
  "html_url": "https://github.com/octocat/Hello-World/pull/1",
  "diff_url": "https://github.com/octocat/Hello-World/pull/1.diff",
  "created_at": "2026-03-01T12:00:00Z",
  "updated_at": "2026-03-02T15:30:00Z",
  "commits": 3,
  "additions": 125,
  "deletions": 42,
  "changed_files": 5,
  "user": {
    "login": "octocat",
    "id": 123456,
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "type": "User"
  },
  "head": {
    "label": "octocat:new-feature",
    "ref": "new-feature",
    "sha": "abc123def456"
  },
  "base": {
    "label": "octocat:main",
    "ref": "main",
    "sha": "def456abc123"
  },
  "mergeable": true,
  "mergeable_state": "clean"
}

Error Responses

401
error
Unauthorized - Invalid or missing JWT token
404
error
Not Found - Pull request, repository, or owner does not exist
403
error
Forbidden - User does not have access to the repository

Build docs developers (and LLMs) love