Obsidian SDK

Diff

Auto-generated API documentation.

Diff Service

Compare file versions and see changes between versions.

Service Overview

The Diff service provides endpoints to compare current file content with historical versions, showing what changed between versions.

Base URL

/api/utilities/diff

Endpoints


GET /api/utilities/diff

Compare current content with a historical version.

CLI Command: obsidian diff

Query Parameters:

ParameterTypeRequiredDescription
filestringNoTarget file
pathstringNoFull path
fromstringNoStart timestamp or version
tostringNoEnd timestamp or version
formatstringNoOutput format
vaultstringNoTarget vault name

Example Request:

curl "http://localhost:3000/api/utilities/diff?file=Notes.md&vault=youtube"

Example Response:

{
  "success": true,
  "data": {
    "type": "message",
    "data": "- Removed old line\n+ Added new line"
  }
}

Compare specific versions:

curl "http://localhost:3000/api/utilities/diff?file=Notes.md&from=2026-05-08&to=2026-05-09&vault=youtube"

Python (specific versions):

response = requests.get("http://localhost:3000/api/utilities/diff", params={
    "file": "Notes.md",
    "from": "2026-05-08",
    "to": "2026-05-09",
    "vault": "youtube"
})

GET /api/utilities/diff/compare

Compare two specific versions (explicit endpoint).

CLI Command: obsidian diff

Query Parameters:

ParameterTypeRequiredDescription
filestringNoTarget file
pathstringNoFull path
fromstringYesStart version/timestamp
tostringYesEnd version/timestamp
formatstringNoOutput format
vaultstringNoTarget vault name

Example Request:

curl "http://localhost:3000/api/utilities/diff/compare?file=Notes.md&from=2026-05-08T10:00:00&to=2026-05-08T16:00:00&vault=youtube"
# Show all changes since yesterday
curl -s "http://localhost:3000/api/utilities/diff?file=Notes.md&vault=youtube" \
  | jq -r '.data.data'
# Show changes between two timestamps
curl -s "http://localhost:3000/api/utilities/diff/compare?file=Notes.md&from=2026-05-08T09:00:00&to=2026-05-08T17:00:00&vault=youtube" \
  | jq -r '.data.data'
# Create a simple change log
FILES=("Notes.md" "Projects/Overview.md" "Archive/Legacy.md")
for file in "${FILES[@]}"; do
  echo "=== $file ==="
  curl -s "http://localhost:3000/api/utilities/diff?file=$file&vault=youtube" \
    | jq -r '.data.data'
  echo ""
done

On this page