Yoast Surfaces API

The Yoast Surfaces API provides a PHP interface for retrieving SEO metadata programmatically within WordPress. It exposes the YoastSEO() surface with methods to get metadata for the current page, a specific post by ID, or a given URL. Returns titles, descriptions, Schema arrays, canonical URLs, robots directives, OpenGraph, and Twitter card data.

API entry from apis.yml

apis.yml Raw ↑
aid: yoast:yoast-surfaces-api
name: Yoast Surfaces API
description: The Yoast Surfaces API provides a PHP interface for retrieving SEO metadata programmatically
  within WordPress. It exposes the YoastSEO() surface with methods to get metadata for the current page,
  a specific post by ID, or a given URL. Returns titles, descriptions, Schema arrays, canonical URLs,
  robots directives, OpenGraph, and Twitter card data.
humanURL: https://developer.yoast.com/customization/apis/surfaces-api/
baseURL: https://{your-site}
tags:
- SEO
- PHP API
- Metadata
- WordPress
properties:
- type: Documentation
  url: https://developer.yoast.com/customization/apis/surfaces-api/