Page Optimization: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

Optimize a page for its focus keyword

A site owner picked a focus keyword for their services page and wants the page's text rewritten to rank for it. Your app runs an optimization job and presents each suggested change for approval.

Prerequisite: The page has a focus keyword set in its SEO settings, for example with the Item SEO Tags API.

To optimize a page:

  1. Call Trigger Page Optimization with the page's pageId and its URL path in pagePath, for example /services. Keep the returned predictionId.
  2. Poll Get Page Optimization Results with ?predictionId=<predictionId> every few seconds. While status is IN_PROGRESS, keep polling. Generation typically takes under 2 minutes.
  3. When status is COMPLETED, read pageOptimization. Present metaTitle, metaDescription, h1, h2OrH3, and each entry of content as a before/after pair the owner can accept or reject.
  4. For each accepted pair, locate the element on the page by its before text and replace it with after. Apply the title tag and description tag through the page's SEO settings, for example with the Item SEO Tags API.
  5. If status is FAILED, call Trigger Page Optimization again to retry.

Optimize the homepage

Your app offers a one-click SEO boost for the homepage. The homepage represents the whole site rather than one topic, so it has its own trigger method with homepage-specific guidance.

To optimize the homepage:

  1. Call Trigger Home Page Optimization with the homepage's pageId and / as pagePath. Keep the returned predictionId.
  2. Poll Get Page Optimization Results with ?predictionId=<predictionId> until status is COMPLETED.
  3. Present the suggestions and apply the accepted changes to the homepage, as in the previous flow.
  4. If the owner comes back later, call Get Page Optimization Results with ?pageId=<pageId> instead. It returns the homepage's latest suggestion set even after the predictionId expired.

Last updated: 9 September 2026

Did this help?