REST API

RankKit SEO's REST routes under /wp-json/speedrank/v1, how they authenticate and check permissions, and examples for reading and saving SEO fields.

Updated 5 min read
On this page

RankKit SEO registers its REST routes in the speedrank/v1 namespace, under https://example.com/wp-json/speedrank/v1/. The RankKit SEO admin screens use these routes, and you can call them from your own code.

For automation and AI agents, the MCP server is usually the better choice: it has scoped tokens, dry runs, approval mode and a stable, documented tool list. The REST routes exist to power the admin app, so they are not a versioned public API and may change between releases.

Authentication

All routes except the MCP and OAuth endpoints need a logged-in WordPress user:

  • From wp-admin or the block editor: cookie authentication with a REST nonce (the X-WP-Nonce header). wp.apiFetch adds it for you.
  • From outside WordPress: a WordPress Application Password with HTTP Basic auth, as for any WordPress REST route.

RankKit SEO agent tokens (sr_…) only work on the /mcp endpoint.

Permissions

Each route checks the RankKit SEO permission for its area, as set in the role manager (RankKit SEO → Settings → Roles). For example, /posts needs SEO fields, /redirects needs Redirects, /settings needs Settings and /agents needs AI Agents. A request without the permission gets a rest_forbidden error (HTTP 401 or 403).

Pro routes exist only in RankKit SEO Pro. Called without an active license, they return speedrank_pro_required (HTTP 403) with "… is part of RankKit SEO Pro. Start a 14-day free trial or upgrade to use it."

Routes

Route Methods Purpose Edition
/mcp POST MCP server (JSON-RPC 2.0). GET returns 405. Free
/oauth/register, /oauth/token, /oauth/revoke POST OAuth for claude.ai, ChatGPT and other connectors (public). Free
/dashboard GET Dashboard data Free
/settings GET, POST Read and save settings Free
/audit, /audit/fix POST Run the audit, apply a setting fix Free
/posts, /posts/{id} GET, POST Content table, read and save a post's SEO fields Free
/analyze POST Content analysis Free
/ai/suggest, /ai/keywords, /ai/alt, /ai/test, /ai/explain POST AI suggestions Free
/ai/brief, /ai/briefs, /ai/briefs/{id}, /ai/draft POST, GET, DELETE AI writer Free
/ai/faq, /ai/bulk POST AI FAQ, bulk AI Pro
/images, /images/{id} GET, POST Images and alt text Free
/redirects, /redirects/{id} GET, POST, DELETE Redirect manager Free
/redirects/catch-all GET, POST 404 catch-all Pro
/404 GET, DELETE 404 monitor Pro
/changes, /changes/{id}/{approve|reject|revert}, /changes/batch/{uuid}/{action} GET, POST Change Log Free
/agents, /agents/tokens, /agents/tokens/{id} GET, POST, DELETE Agent tokens and activity Free
/google, /google/oauth, /google/service-account, /google/disconnect, /google/select, /google/refresh, /google/search, /google/analytics GET, POST Google connection and reports Free
/google/post/{id}, /google/inspect GET, POST Per-post performance, URL inspection Pro
/ai-crawlers GET AI crawler report Free
/ai-visibility, /ai-visibility/{start|step|suggest|clear} GET, POST AI visibility Pro
/recovery, /recovery/brief, /recovery/briefs, /recovery/briefs/{key} GET, POST, DELETE Traffic Recovery Pro
/import, /import/deactivate GET, POST Import from other SEO plugins Free
/tools/indexnow, /tools/export, /tools/import-settings POST, GET Tools Free
/transfer/export, /transfer/preview, /transfer/import GET, POST Export and import Free
/backups, /backups/{id}, /backups/{id}/download, /backups/{id}/restore GET, POST, DELETE Backups Free
/roles, /roles/reset GET, POST Role manager Free
/schema/types, /schema/validate, /schema/import-url GET, POST Schema Free
/competitor, /duplicates, /pagespeed, /pagespeed/run, /pagespeed/{key} GET, POST, DELETE Reports Free
/report, /report/preview, /report/test GET, POST Email report Free
/content/{id}, /editor/{id}/seo, /keywords/conflicts GET, POST Editor helpers Free
/links/suggest POST AI internal link suggestions Pro
/broken-links, /broken-links/scan, /broken-links/step, /broken-links/settings, /broken-links/{id}/fix GET, POST Broken link checker Pro
/locations and related routes various Business locations Pro
Schema template routes various Schema templates Pro

Examples

List posts missing a meta description

From JavaScript in wp-admin:

wp.apiFetch( { path: '/speedrank/v1/posts?missing=description&per_page=20' } )
	.then( ( result ) => console.log( result.items ) );

/posts accepts post_type, search, missing (title, description, focus_keyword or image), noindex, page and per_page (up to 100).

Save a post's SEO title and description

From a terminal, with an Application Password:

curl -s -X POST https://example.com/wp-json/speedrank/v1/posts/42 \
  -u "admin:abcd efgh ijkl mnop qrst uvwx" \
  -H "Content-Type: application/json" \
  -d '{"fields":{"title":"Trail running shoes %sep% %sitename%","description":"Lightweight trail running shoes with a grippy sole, tested on rocky and muddy routes."}}'

fields takes any of the SEO field names: title, description, focus_keywords, noindex, nofollow, canonical, og_title, og_description, og_image, schema_type, cornerstone, primary_term. The response lists each change with its old and new value and a change_id. The change is applied at once and recorded in the Change Log, where you can revert it. (Approval mode applies to AI agents, not to logged-in users.)

Create a redirect

curl -s -X POST https://example.com/wp-json/speedrank/v1/redirects \
  -u "admin:abcd efgh ijkl mnop qrst uvwx" \
  -H "Content-Type: application/json" \
  -d '{"source":"/old-page","target":"/new-page","type":301,"match_type":"exact"}'

Free supports type 301, 302 and 307 with match_type exact. RankKit SEO Pro adds 308, 410 and 451 and the prefix and regex match types. See Create and manage redirects.

SEO fields through the core WordPress API

RankKit SEO registers its post and term fields as WordPress meta with show_in_rest, under the prefix _speedrank_ (for example _speedrank_title, _speedrank_description, _speedrank_focus_keywords). You can read and write them through the core /wp/v2/posts, /wp/v2/pages and term routes:

curl -s -X POST https://example.com/wp-json/wp/v2/posts/42 \
  -u "admin:abcd efgh ijkl mnop qrst uvwx" \
  -H "Content-Type: application/json" \
  -d '{"meta":{"_speedrank_description":"Lightweight trail running shoes with a grippy sole, tested on rocky and muddy routes."}}'

Writing needs permission to edit that post or term and the SEO fields permission. Writes to post fields this way are also recorded in the Change Log.

FAQ

Can I use an agent token with these routes?

No. Agent tokens only authenticate the /mcp endpoint. Use the MCP server with a token, or the REST routes with a logged-in user or an Application Password.

Do REST writes go through approval mode?

No. Approval mode applies to AI agents connected over MCP or the Abilities API. Writes from logged-in users, including through REST, apply at once and are logged so you can revert them.

Is there a WP-CLI interface?

No. RankKit SEO doesn't register WP-CLI commands.

Was this page helpful?

Still need help?

Email us with your WordPress and RankKit SEO versions and what you tried. Pro customers get priority replies.

Contact support