APIs / GitHub / Repository Compare Files

GitHub: Repository Compare Files

Repository Compare Files from GitHub as JSON. 1 credit per successful call.

GET /v1/github/repository-compare-files

Parameters

Send parameters in the query string.

ParameterTypeRequiredAllowed values
ownerstringRequiredUp to 39 characters
repostringRequiredUp to 100 characters
basestringRequiredUp to 255 characters
headstringRequiredUp to 255 characters

Example request

GitHub
GET/v1/github/repository-compare-files?owner=laravel&repo=framework&base=12.x&head=13.x
{
  "search_parameters": {
    "engine": "github_compare_files",
    "owner": "laravel",
    "repo": "framework",
    "base": "12.x",
    "head": "13.x"
  },
  "repository": "laravel/framework",
  "range": "12.x...13.x",
  "files": [
    {
      "path": ".agents/resume",
      "additions": 0,
      "deletions": 0,
      "lines": [
        "@@ -0,0 +1,7 @@",
        "#!/usr/bin/env bash",
        "set -euo pipefail"
      ]
    },
    {
      "path": ".agents/setup",
      "additions": 0,
      "deletions": 0,
      "lines": [
        "@@ -0,0 +1,86 @@",
        "#!/usr/bin/env bash",
        "set -euo pipefail"
      ]
    },
    {
      "path": ".amp/services.yaml",
      "additions": 0,
      "deletions": 0,
      "lines": [
        "@@ -0,0 +1,7 @@",
        "services:",
        "redis:"
      ]
    }
  ],
  "file_count": 8
}
200 OKJSONX-Credits-Used: 1
Recorded 12 Nov 2026 and shortened.

Run this endpoint in the playground with your own parameters. 1 credit per successful call; failed calls are free.

Response fields

The response has these 5 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

FieldType
search_parametersobject
repositorystring
rangestring
filesobject[]
file_countinteger