"Focus keyphrase" and "SEO title" is not available as variable of Surfaces API
Open
Nobody has claimed this yet.
featurerequest
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 975
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 36
Description
Cannot retrieve all Yoast information with Surfaces API
At least the following attributes are missing from the possible results
- Focus keyphrase
- SEO title
Add these fields to available variables
The simplest solution is to to add
- focus_keyphrase
- seo_title
The importance to be consistent
It's important to offer a consistent interface with your data, so there will be no need to add some plugins to retrieve few fields.
Actual documented Variables
from https://developer.yoast.com/customization/apis/surfaces-api
| Variable | Type | Description |
|---|---|---|
| canonical | string | The canonical URL for the current page. |
| description | string | The meta description for the current page, if set. |
| title | string | The SEO title for the current page. |
| id | string | The requested object ID. |
| site_name | string | The site name from the Yoast SEO settings. |
| wordpress_site_name | string | The site name from the WordPress settings. |
| site_url | string | The main URL for the site. |
| company_name | string | The company name from the Knowledge Graph settings. |
| company_logo_id | int | The attachment ID for the company logo. |
| site_user_id | int | If the site represents a 'person', this is the ID of the accompanying user profile. |
| site_represents | string | Whether the site represents a 'person' or a 'company'. |
| site_represents_reference | array | false |
| breadcrumbs_enabled | bool | Whether breadcrumbs are enabled or not. |
| schema_page_type | string | The Schema page type. |
| main_schema_id | string | Schema ID that points to the main Schema thing on the page, usually the webpage or article Schema piece. |
| page_type | string | The Schema page type. |
| meta_description | string | The meta description for the current page, if set. |
| robots | array | An array of the robots values set for the current page. |
| googlebot | array | The meta robots values we specifically output for Googlebot on this page. |
| rel_next | string | The next page in the series, if any. |
| rel_prev | string | The previous page in the series, if any. |
| open_graph_enabled | bool | Whether OpenGraph is enabled on this site. |
| open_graph_publisher | string | The OpenGraph publisher reference. |
| open_graph_type | string | The og:type. |
| open_graph_title | string | The og:title. |
| open_graph_description | string | The og:description. |
| open_graph_images | array | The array of images we have for this page. |
| open_graph_url | string | The og:url. |
| open_graph_site_name | string | The og:site_name. |
| open_graph_article_publisher | string | The article:publisher value. |
| open_graph_article_author | string | The article:author value. |
| open_graph_article_published_time | string | The article:published_time value. |
| open_graph_article_modified_time | string | The article:modified_time value. |
| open_graph_locale | string | The og:locale for the current page. |
| schema | array | The entire Schema array for the current page. |
| twitter_card | string | The Twitter card type for the current page. |
| twitter_title | string | The Twitter card title for the current page. |
| twitter_description | string | The Twitter card description for the current page. |
| twitter_image | string | The Twitter card image for the current page. |
| twitter_creator | string | The Twitter card author for the current page. |
| twitter_site | string | The Twitter card site reference for the current page. |
| source | array | The source object for most of this page data. |
| breadcrumbs | array | The breadcrumbs array for the current page. |
| estimated_reading_time_minutes | int | The estimated reading time in minutes for the content. |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Surfaces API implementation and its documented variable list, then trace how page metadata is exposed through the API. Done means focus_keyphrase and seo_title are available in API results and included in the documented variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wordpress
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100