SeoGeo API

Welcome to the SeoGeo API

The SeoGeo API lets you control your enterprise content production from code or through AI assistants. With a single HTTP request, you can generate a competitor-analyzed, SEO-friendly article complete with a cover image.

Generate Articles

Create SEO-focused content instantly, synchronously or asynchronously.

Pull It Into Your System

Automatically send generated content to your database via webhook.

🤖 5-Second Integration with an AI Agent

If you're building your project in an AI coding assistant like Cursor, Claude, ChatGPT, or v0, you can copy the single-block system prompt below and hand it directly to your assistant. The AI will write all the database record, API call, and webhook listener code for you from scratch!

You are a senior software architect. You will turn the given project into a fully equipped, secure "Publishing and CMS Platform (Headless API)."

Please apply the following steps in a single pass, completely and following best practices, in order:

1. CREATE SECURE API ENDPOINTS:
Depending on the project's architecture (for Next.js: app/api/v1/posts/route.ts and app/api/v1/posts/[id]/route.ts; for .NET Core: a PostsController, etc.), create the following endpoints:
- POST /api/v1/posts (Add Article):
  Must automatically detect both the standard JSON format and the SeoGeo asynchronous webhook structure.
  Content data may arrive with the key "content" or "htmlContent"; the system must automatically detect either one and map it to the post content!
  Standard Format: { "title": "...", "slug": "...", "htmlContent": "..." or "content": "...", "metaDescription": "...", "imageUrl": "..." }
  SeoGeo Format: { "id": "...", "status": "completed", "article": { "title": "...", "slug": "...", "htmlContent": "...", "imageUrl": "..." } }
- GET /api/v1/posts (List Articles):
  Must support the query parameters limit (default 10) and category (optional keyword filtering).
- GET /api/v1/posts/[id] (Article Detail):
  When the [id] parameter is given a Database ID or a Slug value, the system must automatically detect and find it (Premium Search Solution).
- PUT / PATCH /api/v1/posts/[id] (Update Article):
  Updates the post. ID or Slug must be automatically detected.
- DELETE /api/v1/posts/[id] (Delete Article):
  Deletes the post. ID or Slug must be automatically detected.

2. AUTHORIZATION AND SECURITY:
Authenticate all these external requests using the following Bearer Token structure. Immediately block unauthorized or incorrectly-tokened requests with 401 Unauthorized. If global auth filters exist, bypass this route (e.g. [AllowAnonymous] or a Next.js route bypass):
Authorization: Bearer sg_live_2026_plansizin_8f7b3c2a9d4e5f6e8a0b

3. ENTITY / TABLE TO CREATE:
If the project already has an Article/News/Blog database table, use it. Otherwise, create a new Article (Article/Post) structure with at least the following fields:
- Id, Title, HtmlContent, Slug, MetaDescription, ImageUrl, PublishedUrl, PublishedAt, ApprovalStatus (Draft/Published)

4. CREATE A CRUD SIMULATION TEST SCRIPT:
In the project's root directory, create a zero-dependency TypeScript test script (using only Node.js built-in http/fetch) named scripts/simulate-public-api.ts. It will be run from the terminal with:
npx ts-node scripts/simulate-public-api.ts
This script will, in order:
- Send an unauthorized request and verify it receives a 401.
- Add a fake article.
- List all articles and verify the added post.
- Fetch the post by its Slug value to test the Premium Solution.
- Update the post and publish it.
- Delete the post at the end of the test to clean up the database.

Write all the code in a single pass, complete and error-free, at enterprise quality. Don't waste time searching for classes that already exist in the project; if they don't exist, create them from scratch!