Skip to content
APISeeker

JavaScript integration

Text Diff with JavaScript

Use this JavaScript example to call GET /v1/diff with an API key. This page contains a language-specific snippet, auth notes and links back to full docs — not a thin doorway duplicate.

What you need

  • An API Seeker key (Free plan is enough to start)
  • Base URL https://textdiff.apiseeker.com
  • Path /v1
  • Header authentication via X-SEEKER-Key

JavaScript example

JavaScript
const res = await fetch("https://textdiff.apiseeker.com/v1/diff", {
  method: "GET",
  headers: {
    "X-SEEKER-Key": "YOUR_API_KEY",
  },
});
const data = await res.json();
console.log(data);

Expected response shape

JSON
{
  "success": true,
  "data": {
    "changes": [
      {
        "op": "equal",
        "line": "a"
      },
      {
        "op": "remove",
        "line": "b"
      },
      {
        "op": "add",
        "line": "x"
      },
      {
        "op": "equal",
        "line": "c"
      }
    ]
  },
  "request_id": "req_example"
}

Other languages