Authentication
This endpoint requires JWT authentication. Include your JWT token in the Authorization header:
Authorization: Bearer <your-jwt-token>
Path Parameters
The GitHub username or organization name that owns the repository
The name of the repository
The pull request number (not the pull request ID)
Response
Returns a GitHub pull request object with detailed information about the pull request.
The unique identifier for the pull request
The title of the pull request
The description/body of the pull request
The state of the pull request (e.g., “open”, “closed”)
The URL to view the pull request on GitHub
The URL to view the diff of the pull request
ISO 8601 timestamp when the pull request was created
ISO 8601 timestamp when the pull request was last updated
The number of commits in the pull request
The number of lines added in the pull request
The number of lines deleted in the pull request
The number of files changed in the pull request
Information about the pull request authorThe GitHub username of the author
The GitHub user ID of the author
Information about the head branch of the pull request
Information about the base branch of the pull request
Example Request
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"
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);
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
Unauthorized - Invalid or missing JWT token
Not Found - Pull request, repository, or owner does not exist
Forbidden - User does not have access to the repository