Contents
  1. Overview
  2. Authentication
  3. Errors and limits
  4. Endpoints
  5. Write and publish an article
  6. Webhook signatures
  7. Connect an agent
  8. Tools
  9. Example prompt
Developers

API and MCP

Plan, write, approve and publish articles, and read analytics, AI visibility and the site health fix plan, from your scripts and AI agents. Included in Growth and Agency; read-only during the free trial.

Base URL
https://searchlark.com/api/v1
AuthBearer keyread-only or read/write
Rate limit120 / minper key
PlansGrowth, AgencySee pricing

Authentication

Create a key under Workspace settings, API and MCP. Keys are shown once, can be read-only or read/write, and can be revoked at any time. Send the key as a bearer token on every request.

Keys start with sl_live_. Keys created before Oct 16, 2026 start with kst_live_ and keep working; you don't need to replace them.

curl
curl https://searchlark.com/api/v1/sites \
  -H "Authorization: Bearer sl_live_…"
Response · 200
{
  "data": [{
    "id": "site_7Hq2…",
    "name": "Harbour Bakery",
    "url": "https://harbourbakery.example"
  }]
}

Response shape is illustrative. The OpenAPI schema is the reference.

Errors and limits

Errors share one shape: an error object with a machine-readable code and a sentence you can show a person. Each key can make 120 requests a minute.

StatusMeaning
400The body isn't valid JSON (invalid_json)
401Missing, wrong or revoked key (unauthorized)
402The plan doesn't allow it right now (plan_limit): for example the articles this period are used, or the trial has ended
403The plan doesn't include this call (plan_required: no API on Starter, read-only during the trial), or the key lacks the write scope (insufficient_scope)
404Not found, or not in this workspace. Unknown paths also answer 404 (not_found)
405Method not supported for this path (method_not_allowed). The Allow header lists the ones that are
409Wrong state, for example approving an article that is not in review
422Invalid body or query. The message names each field; details lists them
429Over 120 requests a minute for this key (rate_limited), a site health problem re-checked less than 10 minutes ago (rate_limited), or 500 jobs already waiting for this workspace (queue_full)
500Something failed on our side (internal). Retry later; tell us if it persists
503Searchlark is busy. Wait for the Retry-After header, then send the same request again
Error · 409
{
  "error": {
    "code": "…",
    "message": "…"
  }
}

Endpoints

Base path /api/v1. Full schema: OpenAPI 3.1.

The article list comes in pages of up to 200 (limit, default 200). When more remain, the response has a next_cursor; pass it back as cursor until it is null.

  • GET/sitesList sites
  • GET/sites/{siteId}/keywordsTop keyword opportunities (?limit=)
  • GET/sites/{siteId}/contentList articles, paged (?status=&limit=&cursor=)
  • POST/sites/{siteId}/contentPlan an article for a keyword
  • GET/content/{id}Article, current draft, publication
  • POST/content/{id}/generateWrite the draft (returns a job id)
  • POST/content/{id}/approveApprove a draft in review
  • POST/content/{id}/publishPublish now (returns a job id)
  • GET/jobs/{id}Job status
  • GET/sites/{siteId}/analyticsSearch Console summary
  • GET/sites/{siteId}/ai-visibilityAI mention rates per engine
  • GET/sites/{siteId}/health/planSite health fix plan, biggest wins first (?limit=)
  • GET/sites/{siteId}/health/problems/{problemId}One problem: its pages, steps and an agent prompt
  • POST/sites/{siteId}/health/problems/{problemId}/recheckRe-check a problem's pages (returns a job id)
  • GET/sites/{siteId}/journeysJourneys overview: visits, goals, pages, sources (?days=)
  • GET/sites/{siteId}/journeys/dropoffsBiggest drop-offs, ranked by visits lost (?days=)
  • GET/sites/{siteId}/journeys/pageHow visitors use one page (?path=)

Write and publish an article

  1. Plan it. Post a keyword to the site's content list. You get an article id back.
  2. Write it. Ask for a draft. Writing runs in the background and returns a job id.
  3. Wait for the job. Poll the job until it finishes. The draft then waits in review.
  4. Approve and publish. Approve the draft, then publish it to the site's connected CMS.
Shell
# 1. plan
curl -X POST $BASE/sites/$SITE/content \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"keyword":"wedding cake order timeline"}'

# 2. write (returns a job id)
curl -X POST $BASE/content/$ID/generate -H …

# 3. wait
curl $BASE/jobs/$JOB -H …

# 4. approve, then publish
curl -X POST $BASE/content/$ID/approve -H …
curl -X POST $BASE/content/$ID/publish -H …

Optional fields when planning: title, content_type and scheduled_for (a date like 2026-11-02). The OpenAPI schema lists every field.

Webhook signatures

A site that publishes through a webhook gets a signing secret when you connect it. Every request carries an X-Searchlark-Signature header: t=<unix seconds>,v1=<hex HMAC-SHA256 of "t.body">. Recompute the HMAC over the raw body, compare it in constant time, and reject timestamps more than five minutes old.

The Idempotency-Key header is the same for every delivery and update of one article: create the post the first time, update it afterwards. What to build, every payload field, what to answer and starter receivers are in Publish with a webhook.

Request
POST https://yoursite.com/hooks/searchlark
Content-Type: application/json
X-Searchlark-Signature: t=1760600000,v1=5f2c…
Idempotency-Key: 7a1e…
X-Searchlark-Delivery: 0c4b…

{"event":"article.publish","data":{…}}
Node.js
import { createHmac, timingSafeEqual } from "node:crypto";

// header = request.headers["x-searchlark-signature"]
// body   = the raw request body, before JSON parsing
export function verify(secret, body, header) {
  const parts = Object.fromEntries(
    header.split(",").map((p) => p.trim().split("=", 2)),
  );
  const t = Number(parts.t);
  if (!parts.v1 || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const mac = createHmac("sha256", secret).update(`${t}.${body}`).digest("hex");
  return (
    mac.length === parts.v1.length &&
    timingSafeEqual(Buffer.from(mac), Buffer.from(parts.v1))
  );
}
MCP

Connect an agent

The same operations are MCP tools. Most apps connect to the hosted server by signing in (OAuth): https://searchlark.com/mcp. Step-by-step setup for Claude, ChatGPT, Cursor, VS Code and your own agents is in Connect AI apps. OAuth access tokens also work on this API as bearer tokens.

To run the server on your computer with an API key instead, download one file that runs with Node.js 20 or later and add it to your client's config.

Download searchlark-mcp.mjs

The server reads SEARCHLARK_API_KEY and, optionally, SEARCHLARK_API_BASE. Configs that still use the older KESTREL_API_KEY, KESTREL_API_BASE and KESTREL_API_URL names keep working.

claude_desktop_config.json
{
  "mcpServers": {
    "searchlark": {
      "command": "node",
      "args": ["/path/to/searchlark-mcp.mjs"],
      "env": {
        "SEARCHLARK_API_KEY": "sl_live_…",
        "SEARCHLARK_API_BASE": "https://searchlark.com"
      }
    }
  }
}

Tools

17 tools, one per API operation. Use a read-only key if the agent should only look.

Two prompts hand site health work to a coding agent in your site's repository: fix_health_problem (one problem, ending with a re-check) and fix_health_plan (the plan, one problem at a time). Claude Code lists them as slash commands.

  • list_sitesSites in the workspace
  • list_keywordsKeyword opportunities
  • list_articlesArticles, by status, 200 per page
  • create_articlePlan an articlewrite
  • generate_articleWrite the draftwrite
  • get_jobJob status
  • get_articleArticle and draft
  • approve_articleApprove a draftwrite
  • publish_articlePublish nowwrite
  • get_analyticsSearch Console summary
  • get_ai_visibilityAI mention rates
  • get_health_planSite health fix plan
  • get_health_problemOne problem, with an agent prompt
  • recheck_health_problemRe-check a problem's pageswrite
  • get_journeysJourneys overview
  • get_journey_dropoffsWhere visitors drop off
  • get_journey_pageHow visitors use one page
Example prompt

“Plan an article on month-end close checklists for my site, write it, show me the draft, and publish it if the fact-check is clean.”