Skip to main content

REST API Reference

The Minorank SEO plugin exposes a REST API under /wp-json/minorank/v1/. The platform uses this API to manage meta tags, redirections, 404 logs, and settings on connected WordPress sites. You can also use it to build your own integrations.


Base URL​

https://yoursite.com/wp-json/minorank/v1/

Authentication​

Two methods are accepted:

MethodHow to use
API KeyAdd the header X-Minorank-Key: your-api-key to every request. Generate the key in Minorank SEO → Settings → API Key.
WordPress admin sessionLog in to WordPress and include the X-WP-Nonce header. No API key needed for logged-in administrators.

The API key is the recommended method for external integrations. Admin session authentication is useful for browser-based tools and the Minorank Platform when using application passwords.


Endpoints​

GET /scan​

Bulk-scan all posts, pages, products, and product categories on the site. Returns current SEO meta for each item, with automatic detection of which SEO plugin (Minorank, RankMath, or Yoast) is providing the data.

This is the endpoint the Minorank Platform uses to power the Meta Manager and the AI Writer's internal linking feature.

GET /wp-json/minorank/v1/scan
X-Minorank-Key: your-api-key

The key can also be passed as a query parameter instead of a header:

GET /wp-json/minorank/v1/scan?mnrk_key=your-api-key

Response:

{
"total": 142,
"seo_plugin": "minorank-seo",
"items": [
{
"id": 42,
"post_type": "post",
"title": "My Blog Post",
"url": "https://yoursite.com/my-blog-post/",
"meta_title": "My Blog Post – Site Name",
"meta_description": "A short description under 160 characters.",
"is_product": false,
"is_category": false
},
{
"id": 88,
"post_type": "product",
"title": "Blue Widget",
"url": "https://yoursite.com/product/blue-widget/",
"meta_title": "Buy Blue Widget – Shop Name",
"meta_description": "The best blue widget on the market.",
"is_product": true,
"is_category": false
}
]
}

Notes:

  • Returns up to 500 items per request. Larger sites can have this limit raised.
  • seo_plugin reflects which plugin's meta data is being read: minorank-seo, rank-math, yoast-seo, or none.
  • WooCommerce products and product categories are included automatically when WooCommerce is active.
  • is_product and is_category flags allow callers to apply relevance boosts (as the AI Writer does for internal linking).

GET /status​

Returns plugin version, site URL, and a list of active SEO plugins.

GET /wp-json/minorank/v1/status
X-Minorank-Key: your-api-key

Response:

{
"plugin_version": "1.2.4",
"site_url": "https://yoursite.com",
"active_seo_plugins": ["minorank-seo"]
}

GET /meta​

Read SEO meta for a post or taxonomy term.

GET /wp-json/minorank/v1/meta?object_type=post&object_id=42
X-Minorank-Key: your-api-key

Query parameters:

ParameterValuesDescription
object_typepost, termpost covers posts, pages, and custom post types. term covers categories, tags, and custom taxonomies.
object_idintegerThe WordPress post ID or term ID

Response:

{
"object_type": "post",
"object_id": 42,
"meta_title": "My Page Title",
"meta_description": "Description under 160 characters.",
"focus_keywords": ["keyword one", "keyword two"],
"robots_noindex": false,
"robots_nofollow": false,
"canonical": null,
"og_title": "",
"og_description": "",
"og_image": "",
"twitter_title": "",
"twitter_description": "",
"schema_type": "Article"
}

POST /meta​

Write SEO meta for a post or taxonomy term.

POST /wp-json/minorank/v1/meta
X-Minorank-Key: your-api-key
Content-Type: application/json

{
"object_type": "post",
"object_id": 42,
"meta_title": "Updated Page Title",
"meta_description": "Updated description under 160 characters.",
"focus_keywords": ["primary keyword"],
"robots_noindex": false,
"robots_nofollow": false,
"canonical": null,
"og_title": "",
"og_description": "",
"schema_type": "Article"
}

Response: 200 OK with the updated meta object (same format as GET /meta).


GET /redirections​

List all redirections, with optional filtering.

GET /wp-json/minorank/v1/redirections?group=migration&per_page=100&page=1
X-Minorank-Key: your-api-key

Query parameters:

ParameterDefaultDescription
group,Filter by group name
per_page20Results per page (max 100)
page1Page number

Response:

{
"total": 38,
"redirections": [
{
"id": 12,
"source": "/old-page/",
"target": "/new-page/",
"type": 301,
"group_name": "migration",
"enabled": 1,
"created_at": "2025-03-15T10:22:00Z"
}
]
}

POST /redirections​

Create a new redirection.

POST /wp-json/minorank/v1/redirections
X-Minorank-Key: your-api-key
Content-Type: application/json

{
"source": "/old-page/",
"target": "/new-page/",
"type": 301,
"group_name": "migration",
"enabled": 1
}

Response: 201 Created with the created redirection object.


GET /redirections/:id​

Get a single redirection by ID.

GET /wp-json/minorank/v1/redirections/12
X-Minorank-Key: your-api-key

PUT /redirections/:id​

Update an existing redirection.

PUT /wp-json/minorank/v1/redirections/12
X-Minorank-Key: your-api-key
Content-Type: application/json

{
"target": "/updated-destination/",
"type": 301,
"enabled": 1
}

Response: 200 OK with the updated redirection object.


DELETE /redirections/:id​

Delete a redirection by ID.

DELETE /wp-json/minorank/v1/redirections/12
X-Minorank-Key: your-api-key

Response: 204 No Content


GET /redirections/groups​

List all distinct group names in use.

GET /wp-json/minorank/v1/redirections/groups
X-Minorank-Key: your-api-key

Response:

["migration", "homepage", "shop"]

POST /redirections/bulk​

Batch-create multiple redirections in one request.

POST /wp-json/minorank/v1/redirections/bulk
X-Minorank-Key: your-api-key
Content-Type: application/json

{
"redirections": [
{ "source": "/a/", "target": "/b/", "type": 301 },
{ "source": "/c/", "target": "/d/", "type": 301 },
{ "source": "/deleted/", "target": null, "type": 410 }
]
}

Response: 201 Created with an array of created redirection objects and a count of successes/failures.


GET /404s​

List 404 log entries, paginated.

GET /wp-json/minorank/v1/404s?per_page=50&page=1
X-Minorank-Key: your-api-key

Response:

{
"total": 23,
"entries": [
{
"id": 7,
"url": "/deleted-post/",
"referrer": "https://externalsite.com/link",
"hits": 41,
"last_seen": "2025-06-12T08:14:22Z"
}
]
}

DELETE /404s/:id​

Delete a specific 404 log entry.

DELETE /wp-json/minorank/v1/404s/7
X-Minorank-Key: your-api-key

Response: 204 No Content


GET /settings​

Read all plugin settings.

GET /wp-json/minorank/v1/settings
X-Minorank-Key: your-api-key

Response: JSON object with all plugin settings (sitemap toggles, IndexNow status, LLMs.txt status, etc.).


POST /settings​

Write plugin settings.

POST /wp-json/minorank/v1/settings
X-Minorank-Key: your-api-key
Content-Type: application/json

{
"sitemap_enabled": true,
"sitemap_posts": true,
"sitemap_pages": true,
"indexnow_enabled": true,
"llmstxt_enabled": true
}

Response: 200 OK with the updated settings object.


GET /schema/settings​

Read schema settings and local business data.

GET /wp-json/minorank/v1/schema/settings
X-Minorank-Key: your-api-key

POST /schema/settings​

Write schema settings and local business data.

POST /wp-json/minorank/v1/schema/settings
X-Minorank-Key: your-api-key
Content-Type: application/json

{
"schema_types": {
"post": "Article",
"page": "WebPage"
},
"local_business": {
"name": "My Business",
"phone": "+30 2810 000000",
"email": "info@mybusiness.com",
"address": "123 Main Street",
"city": "Heraklion",
"country": "GR"
}
}

GET /sitemap/status​

Read current sitemap configuration and WooCommerce status.

GET /wp-json/minorank/v1/sitemap/status
X-Minorank-Key: your-api-key

POST /sitemap/settings​

Update sitemap configuration.

POST /wp-json/minorank/v1/sitemap/settings
X-Minorank-Key: your-api-key
Content-Type: application/json

{
"sitemap_enabled": true,
"sitemap_posts": true,
"sitemap_pages": true,
"sitemap_categories": false,
"sitemap_tags": false
}

POST /indexnow/ping​

Ping a specific URL or the homepage.

POST /wp-json/minorank/v1/indexnow/ping
X-Minorank-Key: your-api-key
Content-Type: application/json

{ "url": "https://yoursite.com/my-post/" }

Omit the url field to ping the homepage.

Response: 200 OK with ping status.


Error responses​

All errors return a consistent JSON format:

{
"code": "invalid_object_id",
"message": "No post found with ID 999.",
"data": { "status": 404 }
}

Common error codes: unauthorized, not_found, invalid_object_type, invalid_redirect_type, invalid_meta_title, missing_required_field.