Skip to main content

Scenario

Pull keyword suggestions from Ahrefs’ Keywords Explorer, cluster them by parent topic, then generate SEO-optimized content at scale — titles, meta descriptions, and outlines for each cluster — using Mavera with a consistent brand voice. This job uses the OpenAI SDK pattern for some Mavera calls to demonstrate compatibility.

Architecture

Code

Example Output

Error Handling

The seed keywords may be too specific or the country database too small. Try broader seeds or a larger market (us, uk, de). Ahrefs requires a minimum of 50 units per request even for empty results.
Not all keywords have a parent_topic assigned in Ahrefs’ database. The code falls back to the first word of the keyword — for production, implement proper NLP-based clustering or use Ahrefs’ built-in clustering when available.