Endpoints for running SEO analysis and reading scores.
GET /seoforge/v1/analyze/{post_id}
Run a full SEO analysis on a post. This recalculates the score, identifies issues, and updates the cached result in the database.
bash
curl -u "admin:ABCD 1234 EFGH 5678 IJKL 9012"
https://example.com/wp-json/seoforge/v1/analyze/42json
{
"score": 72,
"issues": [
{
"severity": "error",
"message": "Meta description is missing",
"deduction": 15
},
{
"severity": "warning",
"message": "Focus keyword not in title",
"deduction": 8
},
{
"severity": "info",
"message": "No images in content",
"deduction": 2
}
],
"suggestions": [
"Meta description is missing",
"Focus keyword not in title"
]
}json
{
"code": "rest_post_invalid_id",
"message": "Invalid post ID.",
"data": { "status": 404 }
}GET /seoforge/v1/score/{post_id}
Lightweight endpoint returning only the cached SEO score. Does not trigger a re-analysis.
bash
curl -u "admin:ABCD 1234 EFGH 5678 IJKL 9012"
https://example.com/wp-json/seoforge/v1/score/42json
{
"score": 72
}If the post has never been analyzed, score will be 0.
—