9. Schema API | SEO Forge - Rank Higher with AI-Powered SEO
Download Log in

9. Schema API

Developer Guide

Endpoints for reading and generating JSON-LD structured data.

GET /seoforge/v1/schema/{post_id}

Get the generated JSON-LD schema for a post. Returns the fully resolved schema that would be output in wp_head.

bash
curl -u "admin:ABCD 1234 EFGH 5678 IJKL 9012" 
  https://example.com/wp-json/seoforge/v1/schema/42
Response (200 OK):
json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "name": "WordPress SEO Guide",
    "url": "https://example.com/wordpress-seo-guide/",
    "datePublished": "2024-01-10T08:00:00+00:00",
    "dateModified": "2024-01-12T14:30:00+00:00",
    "headline": "WordPress SEO Guide",
    "author": {
        "@type": "Person",
        "name": "John Doe"
    },
    "publisher": {
        "@type": "Organization",
        "name": "My Blog"
    },
    "image": "https://example.com/wp-content/uploads/seo-guide.jpg",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://example.com/wordpress-seo-guide/"
    }
}

POST /seoforge/v1/schema/detect/{post_id}

Force AI schema detection and generation for a post. PRO only.

bash
curl -X POST -u "admin:ABCD 1234 EFGH 5678 IJKL 9012" 
  https://example.com/wp-json/seoforge/v1/schema/detect/42
Response (200 OK):
json
{
    "success": true,
    "detected_types": ["Article", "FAQ"],
    "json_ld": [
        {
            "@context": "https://schema.org",
            "@type": "Article",
            "headline": "WordPress SEO Guide"
        },
        {
            "@context": "https://schema.org",
            "@type": "FAQPage",
            "mainEntity": [
                {
                    "@type": "Question",
                    "name": "What is SEO?",
                    "acceptedAnswer": { "@type": "Answer", "text": "SEO stands for Search Engine Optimization..." }
                }
            ]
        }
    ],
    "source": "ai",
    "generated_at": "2024-01-15 10:30:00"
}

Forge AI Assistant Online

Hi! I'm the SEO Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs