Developer Docs

Connect anything to StackSerp

REST API, webhooks, CMS connectors, and a ready-made AI agent prompt — everything you need to pipe StackSerp content into your product.

Quick Start

You can be pulling live blog content from StackSerp in under 5 minutes. Here's the fastest path:

1

Create a free StackSerp account

Go to stackserp.com/register and create your account. No credit card required.

2

Add your website

In your dashboard, click Add Website. Enter your domain and niche. StackSerp will create a website workspace for you.

3

Generate your API key

Go to Account → API Keys and create a new key. Copy the key — it's shown only once.

4

Find your Website ID

Open your website in the dashboard. The URL will look like /dashboard/websites/YOUR_WEBSITE_ID. Copy that UUID.

5

Make your first API call

Fetch your published posts:

bash
curl https://stackserp.com/api/v1/websites/YOUR_WEBSITE_ID/posts \
  -H "Authorization: Bearer YOUR_API_KEY"

API Keys

Every API request requires a Bearer token. Keys are created per account and have configurable scopes.

posts:readList and fetch blog posts
posts:writeCreate, update, and delete posts
websites:readRead website settings and metadata
*Full access to all endpoints
API keys are shown once at creation. Store them securely in environment variables — never commit them to source control.
bash
# All API requests use Bearer authentication
curl https://stackserp.com/api/v1/websites/WEBSITE_ID/posts \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxx"

REST API Reference

Base URL: https://stackserp.com/api/v1

Posts

GET
/websites/{websiteId}/posts

List posts. Query params: page, limit, status (DRAFT|PUBLISHED|READY).

GET
/websites/{websiteId}/posts/{slug}

Get a single post by slug. Returns full content in Markdown and HTML.

POST
/websites/{websiteId}/posts

Create a new post. Requires posts:write scope.

PATCH
/websites/{websiteId}/posts/{slug}

Partially update a post. Only include fields you want to change.

DELETE
/websites/{websiteId}/posts/{slug}

Delete a post permanently.

json
// GET /api/v1/websites/{websiteId}/posts response
{
  "posts": [
    {
      "id": "clx123...",
      "title": "How to Scale Your SaaS Blog",
      "slug": "how-to-scale-saas-blog",
      "excerpt": "A practical guide to...",
      "content": "## Introduction\n\n...",
      "contentHtml": "<h2>Introduction</h2>...",
      "metaTitle": "How to Scale Your SaaS Blog | StackSerp",
      "metaDescription": "Learn how to...",
      "focusKeyword": "saas blog scaling",
      "featuredImage": "https://cdn.stackserp.com/...",
      "tags": ["saas", "content marketing"],
      "category": "Marketing",
      "status": "PUBLISHED",
      "publishedAt": "2026-02-21T10:00:00.000Z",
      "wordCount": 1842,
      "readingTime": 9
    }
  ],
  "total": 48,
  "page": 1,
  "limit": 20
}

Content Generation

bash
# Trigger AI content generation for a keyword
curl -X POST https://stackserp.com/api/v1/websites/WEBSITE_ID/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "keyword": "best project management tools 2026",
    "options": {
      "tone": "professional",
      "wordCount": 2000,
      "includeImages": true
    }
  }'

# Response
{ "jobId": "job_abc123", "status": "queued" }

# Poll job status
curl https://stackserp.com/api/v1/websites/WEBSITE_ID/jobs/job_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

# Response when done
{ "id": "job_abc123", "status": "completed", "postId": "clx456..." }

Feed & Sitemap

GET
/websites/{websiteId}/feed.xml

RSS 2.0 feed of all published posts. No auth required for hosted blogs.

GET
/websites/{websiteId}/sitemap.xml

XML sitemap of published posts. Useful for headless setups.

Webhooks

Get notified instantly when a post is published. StackSerp sends an HTTP POST to your URL with the full post payload — no polling required.

1

Set up your endpoint

Create a public HTTPS endpoint on your server that accepts POST requests.

2

Register it in StackSerp

Go to Website Settings → Integrations → Webhook. Paste your URL and optionally set a secret for signature verification.

3

Receive the payload

When any post is published, StackSerp sends:

json
{
  "event": "post.published",
  "timestamp": "2026-02-21T12:00:00.000Z",
  "post": {
    "id": "clx123...",
    "title": "10 Best SaaS Tools in 2026",
    "slug": "best-saas-tools-2026",
    "content": "## Introduction\n\n...",
    "contentHtml": "<h2>Introduction</h2>...",
    "excerpt": "A curated list of...",
    "metaTitle": "10 Best SaaS Tools in 2026",
    "metaDescription": "We reviewed 50+ tools...",
    "focusKeyword": "best saas tools 2026",
    "featuredImage": "https://cdn.stackserp.com/images/...",
    "tags": ["saas", "productivity"],
    "category": "Tools",
    "status": "PUBLISHED",
    "publishedAt": "2026-02-21T12:00:00.000Z",
    "wordCount": 2100,
    "readingTime": 10,
    "websiteId": "ws_abc...",
    "websiteDomain": "mysite.com",
    "brandName": "My Brand"
  }
}
4

Verify the signature (recommended)

If you set a webhook secret, every request includes X-StackSerp-Signature: sha256=<hmac>. Verify it:

javascript
import crypto from "crypto";

export async function POST(req) {
  const rawBody = await req.text();
  const signature = req.headers.get("x-stackserp-signature");

  const expected = "sha256=" + crypto
    .createHmac("sha256", process.env.WEBHOOK_SECRET)
    .update(rawBody)
    .digest("hex");

  if (signature !== expected) {
    return new Response("Unauthorized", { status: 401 });
  }

  const { event, post } = JSON.parse(rawBody);

  if (event === "post.published") {
    // Save to your DB, push to CDN, trigger rebuild, etc.
    await savePost(post);
  }

  return new Response("OK");
}
StackSerp expects a 2xx response within 10 seconds. For slow operations (rebuilds, syncs), respond immediately and process in the background.

WordPress Integration

Publish AI-generated posts directly to any WordPress site. Two modes — no plugin required for basic use.

Mode 1 — Application Passwords

Built into WordPress 5.6+. No plugin needed.

  1. Log into WordPress Admin
  2. Go to Users → Your Profile → Application Passwords
  3. Create a new password, name it "StackSerp"
  4. Copy the generated password
  5. Paste your site URL, username, and app password into StackSerp Settings

Mode 2 — StackSerp Plugin

For custom post types, Yoast SEO fields, and advanced control.

  1. Install the StackSerp Connector plugin on your WordPress site
  2. Go to Settings → StackSerp → copy your plugin API key
  3. Paste your site URL and plugin key into StackSerp Settings

What gets synced

Title
Content (HTML)
Excerpt
Slug
Featured Image
Tags
Category
Meta Title
Meta Description
Focus Keyword (Yoast)

Shopify Integration

Publish SEO blog posts straight into your Shopify store's blog.

1

Create a Shopify Custom App

Go to your Shopify Admin → Settings → Apps → Develop apps → Create app. Name it "StackSerp".

2

Set the required API scopes

Under Configuration → Admin API access scopes, enable:

read_contentwrite_content
3

Install and copy the access token

Click Install app, then copy the Admin API access token (starts with shpat_).

4

Connect in StackSerp

Go to Website Settings → Shopify. Enter your store URL (e.g. mystore.myshopify.com) and paste your access token.

Each Shopify store can have multiple blogs. StackSerp automatically targets your first blog, or you can specify a Blog ID in settings.

Ghost Integration

Connect StackSerp to any self-hosted or Ghost Pro publication.

1

Create a Ghost Admin API integration

In your Ghost Admin dashboard, go to Settings → Integrations → Add custom integration. Name it "StackSerp".

2

Copy the Admin API Key

Copy the Admin API Key. It looks like 64f0a...b3c:ab12... (id:secret format).

3

Connect in StackSerp

Go to Website Settings → Ghost. Enter your Ghost site URL and Admin API Key.

StackSerp uses Ghost Admin API v5. Make sure your Ghost instance is version 5.x or later.

Webflow Integration

Publish AI-generated content directly into your Webflow CMS collection. Perfect for teams using Webflow as their primary website platform.

1

Enable Webflow CMS API access

In your Webflow dashboard, go to Project Settings → Integrations → API Access and generate a new API token. Make sure the token has CMS read & write access.

2

Find your Site ID and Collection ID

Your Site ID is visible in Project Settings → General. Your Collection ID is in the CMS tab — click on your blog collection to find it in the URL or collection settings.

3

Map your collection fields

StackSerp needs to know which Webflow CMS fields map to the post title, body (rich text), slug, and metadata. Common field names: name, body, slug, meta-title, meta-description.

4

Connect in StackSerp

Go to Website Settings → Integrations → Webflow. Enter your API token, Site ID, and Collection ID. StackSerp will validate the connection and display your collection fields for mapping.

5

Publish posts to Webflow

Once connected, every post in your StackSerp editor will have a Publish to Webflow button. You can also enable auto-publish so content goes live in Webflow automatically when marked as ready.

Webflow CMS items are created as drafts by default and must be published from the Webflow editor or via the Webflow API's publish endpoint. StackSerp can optionally trigger a site publish automatically if configured.

AI Agent Prompt

Building a website and want it to auto-receive blog posts from StackSerp? Copy the prompt below and paste it into your AI coding tool. Fill in your credentials — that's it.

Works with Cursor, Claude Code, Windsurf, GitHub Copilot, v0, Bolt, and any other AI coding assistant.

stackserp-agent-prompt.txt
Copy & customize
You are integrating StackSerp (an AI SEO blog platform) into a website.
StackSerp generates blog posts automatically. Your job is to receive those
posts and display them on this website.

== CREDENTIALS ==
API Key: <PASTE_YOUR_API_KEY_HERE>
Website ID: <PASTE_YOUR_WEBSITE_ID_HERE>
Webhook Secret: <PASTE_YOUR_WEBHOOK_SECRET_HERE>

== HOW IT WORKS ==
StackSerp publishes blog posts via two methods. Use whichever fits your stack:

METHOD 1 — WEBHOOK (recommended)
StackSerp POSTs a JSON payload to your endpoint every time a post is published.
Create an API route to receive it.

Webhook payload:
{
  "event": "post.published",
  "timestamp": "ISO8601",
  "post": {
    "id": "uuid",
    "title": "string",
    "slug": "string",
    "content": "markdown string",
    "contentHtml": "html string",
    "excerpt": "string",
    "metaTitle": "string",
    "metaDescription": "string",
    "focusKeyword": "string",
    "featuredImage": "url or null",
    "featuredImageAlt": "string or null",
    "tags": ["string"],
    "category": "string or null",
    "status": "PUBLISHED",
    "publishedAt": "ISO8601",
    "wordCount": 1500,
    "readingTime": 7
  }
}

Verify the signature before processing:
  Header: X-StackSerp-Signature: sha256=<hmac>
  Compute: HMAC-SHA256(raw_body, webhook_secret) → compare hex digest

Example webhook handler (Next.js App Router):

  // app/api/stackserp-webhook/route.ts
  import crypto from "crypto";
  import { NextResponse } from "next/server";

  export async function POST(req: Request) {
    const secret = process.env.STACKSERP_WEBHOOK_SECRET!;
    const body = await req.text();
    const sig = req.headers.get("x-stackserp-signature") || "";
    const expected = "sha256=" +
      crypto.createHmac("sha256", secret).update(body).digest("hex");

    if (sig !== expected) {
      return NextResponse.json({ error: "Invalid signature" }, { status: 401 });
    }

    const { event, post } = JSON.parse(body);

    if (event === "post.published") {
      // Save to your database, write as MDX file, or however you store content.
      // Fields available: post.title, post.slug, post.content (markdown),
      // post.contentHtml (ready-to-render HTML), post.excerpt, post.metaTitle,
      // post.metaDescription, post.featuredImage, post.featuredImageAlt,
      // post.tags, post.category, post.wordCount, post.readingTime
      await savePostToDatabase(post);
    }

    return NextResponse.json({ received: true });
  }

Then set your webhook URL in StackSerp dashboard → Settings → Webhook:
  https://yoursite.com/api/stackserp-webhook

METHOD 2 — PULL VIA API
Fetch posts on demand. Useful for static site builds or initial sync.

Base URL: https://stackserp.com/api/v1
Auth header: Authorization: Bearer <your_api_key>

LIST POSTS (paginated):
  GET /api/v1/websites/{websiteId}/posts?page=1&limit=20&status=PUBLISHED
  Returns: { posts: [{ id, title, slug, excerpt, metaTitle, metaDescription,
  focusKeyword, featuredImage, status, publishedAt, wordCount, readingTime,
  category, tags }], pagination: { page, limit, total, totalPages } }

GET SINGLE POST (full content):
  GET /api/v1/websites/{websiteId}/posts/{slug}
  Returns full post object including content (markdown) and contentHtml

RSS FEED:
  GET /api/v1/websites/{websiteId}/feed.xml
  Returns RSS 2.0 XML — useful for feed readers or static site ingestion

SITEMAP:
  GET /api/v1/websites/{websiteId}/sitemap.xml
  Returns XML sitemap of all published posts

== POST DATA GUIDE ==
- content: raw Markdown — convert to HTML yourself, or use contentHtml
- contentHtml: pre-rendered HTML — ready to inject into your page
- featuredImage: CDN URL — use directly in <img> tags
- metaTitle / metaDescription: use in <head> for SEO
- slug: URL-safe lowercase string with hyphens — use as your URL path
- tags: array of strings — use for filtering, tag pages, or related posts
- category: string or null — use for blog sections

== INSTRUCTIONS ==
- When asked to set up StackSerp integration, create the webhook handler above
- When asked to display blog posts, fetch from the API or read from your DB
- When asked to build a blog page, use the post fields to render the layout
- Post content is Markdown — use contentHtml for direct rendering
- featuredImage is a CDN URL — use directly, no download needed
- Handle 429 rate limit responses with exponential backoff on API calls
Replace <PASTE_YOUR_API_KEY_HERE>, <PASTE_YOUR_WEBSITE_ID_HERE>, and <PASTE_YOUR_WEBHOOK_SECRET_HERE> with your actual values from the StackSerp dashboard before pasting into your AI coding tool.

Example agent tasks this prompt enables

"Set up StackSerp webhook to receive blog posts"
"Build a blog listing page using posts from StackSerp"
"Create a dynamic blog post page with SEO meta tags"
"Fetch all published posts and display them on the homepage"
"Add an RSS feed page that pulls from StackSerp"
"Build a blog with categories and tag filtering"

Ready to connect?

Create a free account, grab your API key, and start pulling content into your product in minutes.