---
title: SEO Title & Meta Description Generator API | APIkit
description: Automate CMS metadata creation with an AI endpoint enforcing strict title length, keyword inclusion, and slug rules.
canonical: "https://apikit.ai/j/generate-seo-metadata-endpoint"
modified: 2026-11-14
author: apikit.ai editorial team
source: "https://apikit.ai"
category: Prompt-to-API Endpoints
category_url: "https://apikit.ai/j#group-prompt-to-api-endpoints"
---

# Build an SEO title and meta description generator API

> Turn raw CMS article drafts into character-bounded meta titles, Open Graph copy, and clean URL slugs via webhook or API call.

## Prepared starting prompt

We publish 200 landing pages a week and want an API that turns page markdown into 55-char SEO titles, 145-char descriptions, and clean slugs.

### Quick scenarios
- **Hard character limits:** Enforce max 60 chars on titles and 155 chars on descriptions with automatic trim checks.
- **Target keyword inclusion:** Accept a primary keyword input and weave it naturally near the start of the title.
- **CMS webhook trigger:** Call the endpoint automatically whenever a draft status changes inside Sanity or Webflow.

- [Join the APIkit waitlist](https://apikit.ai/#waitlist-f73a0d)

## Checklist for CMS-ready SEO metadata APIs

1. **Enforce pixel and character caps** — Constrain title and description fields in the output schema so CMS imports never truncate mid-word.
2. **Strip clickbait and fluff** — Add negative style rules banning hyperbolic adjectives and repetitive brand boilerplate.
3. **Include primary keyword inputs** — Pass target_keyword and page_type fields so product pages and guides follow distinct templates.
4. **Return normalized ASCII slugs** — Generate lowercase hyphenated URL slugs ready for direct database persistence.

## Frequently Asked Questions

### Can the endpoint guarantee titles stay under 60 characters?

Yes. Schema constraints and post-validation rules check character length before returning JSON, retrying automatically if a title runs long.

### Does it work directly with headless CMS platforms?

Any headless CMS capable of firing an HTTP webhook or build script—such as Sanity, Contentful, or Strapi—can call the endpoint directly.

### Can we enforce different formats for guides vs product pages?

Pass a page_template enum field so one endpoint adapts copy style across blog articles, feature pages, and docs.

## Related tasks in this category

- [Turn a raw prompt into a live REST endpoint](https://apikit.ai/j/turn-prompt-into-rest-endpoint.md)
- [Bind typed request variables into prompt templates](https://apikit.ai/j/parameterize-dynamic-prompt-variables.md)
- [Deploy a configurable text summarization API](https://apikit.ai/j/build-text-summarization-microservice.md)
- [Ship a glossary-aware translation API endpoint](https://apikit.ai/j/create-multilingual-translation-endpoint.md)
- [Expose a fast sentiment and urgency scoring API](https://apikit.ai/j/launch-sentiment-classification-api.md)
- [Create a brand-tuned support reply drafting API](https://apikit.ai/j/automate-support-reply-drafting-api.md)

---

*Published by **Wondel.ai sp. z o.o.** · [apikit.ai](https://apikit.ai) · [About](https://apikit.ai/about) · [Editorial Guidelines](https://apikit.ai/editorial) · [Contact](https://apikit.ai/contact) · [Wondel.ai Products](https://wondel.ai/products)*