Skip to content Skip to navigation
Back to the main support

Get started with the SEOPress REST API

Request post metadata

Since SEOPress 5.0, you can request your post SEO metadata using our REST API.

2 routes are currently available:

  • /wp-json/seopress/v1/posts/[postId] : replace [postId] by the ID of your post
  • /wp-json/seopress/v1/posts/by-url?url=https://example.com/seopress-best-wordpress-seo-plugin/ replace the URL by the desired permalink

Available method: GET.

You will get in response a JSON with the following informations:

{ 
    "title": "SEOPress, Best WordPress SEO plugin", 
    "description": "My super meta description", 
    "canonical": "https://example.com/seopress-best-wordpress-seo-plugin/", 
    "og": { 
        "title": "My Facebook title", 
        "description": "My Facebook description", 
        "image": "https://example.com/seopress-best-wordpress-seo-plugin.jpg",
        "attachment_id": "1",
        "image_width": "1920",
        "image_height": "1080"
    }, 
    "twitter": { 
        "title": "My Twitter title", 
        "description": "My Twitter description", 
        "image": "https://example.com/seopress-best-wordpress-seo-plugin.jpg",
        "attachment_id": "1",
        "image_width": "1920",
        "image_height": "1080"
    },
    "robots": {
        "noindex": false, 
        "nofollow": false, 
        "noarchive": false, 
        "nosnippet": false, 
        "noimageindex": false 
    },
    "primarycat": "1",
    "breadcrumbs": "my custom breadcrumbs for current item",
    "redirections": {
        "enabled": true,
        "status":"both",
        "type":"301",
        "value":"https://example.com/destination-url/"
    }
}

To request your data, you can for example use the WordPress HTTP API.

Request term metadata

Since SEOPress 5.5, you can request your term SEO metadata using our REST API.

2 routes are currently available:

  • /wp-json/seopress/v1/terms/[termId] : replace [termId] by the ID of your term
  • /wp-json/seopress/v1/terms/[termId]?taxonomy=[yourCustomTaxonomy] similar to the previous route, with taxonomy argument (default: “category” if not provided)

Available method: GET.

You will get in response a JSON with the following informations:

{ 
    "title": "My super term title", 
    "description": "My super term meta description",
    "canonical": "https://example.com/seopress-best-wordpress-seo-plugin/",
    "og": { 
        "title": "My Facebook term title", 
        "description": "My Facebook term description", 
        "image": "https://example.com/term-seopress-best-wordpress-seo-plugin.jpg",
        "attachment_id": "1",
        "image_width": "1920",
        "image_height": "1080" 
    }, 
    "twitter": { 
        "title": "My Twitter term title", 
        "description": "My Twitter term description", 
        "image": "https://example.com/term-seopress-best-wordpress-seo-plugin.jpg",
        "attachment_id": "1",
        "image_width": "1920",
        "image_height": "1080"
    }, 
    "robots": { 
        "noindex": false, 
        "nofollow": false, 
        "noarchive": false, 
        "nosnippet": false, 
        "noimageindex": false 
    },
    "breadcrumbs": "my custom breadcrumbs for current item",
    "redirections": {
        "enabled": true,
        "status":"both",
        "type":"301",
        "value":"https://example.com/destination-url/"
    }
}

Request SEOPress’ settings

Since SEOPress 5.5, you can request your SEOPress’ global settings using our REST API.

Note that for security reasons, you must be logged in with a user having the manage_options capability.

10 routes are currently available:

  • /wp-json/seopress/v1/options/dashboard-settings: Dashboard settings
  • /wp-json/seopress/v1/options/titles-settings: Titles and metas settings
  • /wp-json/seopress/v1/options/social-settings: Social networks settings
  • /wp-json/seopress/v1/options/sitemaps-settings: Sitemaps settings
  • /wp-json/seopress/v1/options/analytics-settings: Analytics settings
  • /wp-json/seopress/v1/options/advanced-settings: Advanced settings
  • /wp-json/seopress/v1/options/bot-settings: Bot settings
  • /wp-json/seopress/v1/options/indexing-settings: Instant Indexing settings
  • /wp-json/seopress/v1/options/license-settings: License settings
  • /wp-json/seopress/v1/options/pro-settings: PRO settings

Available method: GET.

You will get in response a JSON with the following informations (eg. with Dashboard settings):

{
  "cards_order": [
    "seopress-page-list",
    "notice-insights-alert",
    "seopress-news-panel"
  ],
  "toggle-rich-snippets": "1",
  "toggle-404": "1",
  "toggle-bot": "1",
  "toggle-titles": "1",
  "toggle-white-label": "0",
  "toggle-social": "1",
  "toggle-xml-sitemap": "1",
  "toggle-google-analytics": "1",
  "toggle-advanced": "1",
  "toggle-woocommerce": "1",
  "toggle-edd": "1",
  "toggle-local-business": "1",
  "toggle-dublin-core": "1",
  "toggle-breadcrumbs": "1",
  "toggle-robots": "1",
  "toggle-news": "1",
  "toggle-rewrite": "1",
  "toggle-instant-indexing": "1",
  "notice-wizard": "1"
}

Request Search Console reports of your posts

Since SEOPress 5.7, you can request your Google Search Console reports of your posts using our REST API.

Note that for security reasons, you must be logged in with a user having the edit_posts capability.

1 route is currently available:

  • /wp-json/seopress/v1/posts/[postID]/inspect : replace [postID] by the ID of your post

Available method: GET, POST.

You will get in response a JSON with the following informations:

{
    "google_api_key_is_empty": false,
    "data": {
        "inspectionResult": {
            "inspectionResultLink": "https://search.google.com/search-console/inspect?resource_id=https://example.com/&id=xxxxxxxx&utm_medium=link&utm_source=api",
            "indexStatusResult": {
                "coverageState": "Indexed, not submitted in sitemap",
                "crawledAs": "MOBILE",
                "googleCanonical": "https://example.com/",
                "indexingState": "INDEXING_ALLOWED",
                "lastCrawlTime": "2022-04-29T13:25:27Z",
                "pageFetchState": "SUCCESSFUL",
                "referringUrls": [
                    "https://www.example.com/"
                ],
                "robotsTxtState": "ALLOWED",
                "sitemap": null,
                "userCanonical": "https://example.com/",
                "verdict": "PASS"
            },
            "mobileUsabilityResult": {
                "verdict": "PASS"
            },
            "richResultsResult": {
                "verdict": "PASS",
                "detectedItems": [
                {
                    "richResultType": "Logos",
                    "items": [
                    {
                        "name": "Unnamed item"
                    }
                    ]
                },
                {
                    "richResultType": "Sitelinks searchbox",
                    "items": [
                        {
                            "name": "Unnamed item"
                        }
                        ]
                    }
                ]
            }
        }
    }
}