Skip to main content
Automate SEO-optimized content creation with AI-powered keyword research, competitive analysis, and structured article generation. Streamline content production from keyword discovery to publish-ready articles.

Features

  • Keyword Research Integration: DataForSEO API for volume, CPC, and competition metrics
  • Competitive Analysis: Automated content scraping and gap analysis
  • Topic Generation: AI-powered topic suggestions based on keyword data
  • Content Creation: Full article generation with SEO optimization
  • Real-time Processing: Live streaming of content generation progress

Architecture Overview

The content generation process follows a four-stage pipeline:
Business Analysis → Keyword Research → Topic Generation → Article Creation

Processing Pipeline

Stage 1: Business Context Analysis

Analyze the target website to understand business focus, audience, and content style.

Stage 2: Keyword Research

Research and validate keywords using DataForSEO API for search volume and competition data.

Stage 3: Topic Development

Generate SEO-optimized topic suggestions based on keyword opportunities and competitive gaps.

Stage 4: Article Generation

Create comprehensive articles with proper SEO structure, internal linking, and calls-to-action.

Implementation

Business Summary Generation

async function generateBusinessSummary(websiteUrl) {
    // 1. Validate URL accessibility
    const urlChecker = new URLCheckerService();
    if (!await urlChecker.isReachable(websiteUrl)) {
        throw new URLNotAccessibleError(websiteUrl);
    }
    
    // 2. Extract website content
    const scrapedContent = await scrapeUrlContent(websiteUrl);
    
    // 3. Initialize LLM for analysis
    const llm = await initializeLLM({ model: "gpt-4" });
    
    // 4. Generate business summary
    const prompts = createBusinessAnalysisPrompts();
    const chain = createAnalysisChain(llm, prompts);
    
    const summary = await chain.run(scrapedContent);
    return summary;
}

Keyword Research Workflow

async function researchKeywords(domain, seedKeywords) {
    // 1. Initialize DataForSEO client
    const dataforSeoClient = new DataForSEOClient();
    
    // 2. Get keyword suggestions
    const keywordSuggestions = await dataforSeoClient.getKeywordIdeas({
        keywords: seedKeywords,
        location: "United States",
        language: "en"
    });
    
    // 3. Analyze keyword metrics
    const keywordData = [];
    for (const keyword of keywordSuggestions) {
        const metrics = await dataforSeoClient.getKeywordMetrics(keyword);
        keywordData.push({
            keyword: keyword,
            searchVolume: metrics.search_volume,
            competition: metrics.competition_level,
            cpc: metrics.cost_per_click,
            difficulty: metrics.keyword_difficulty
        });
    }
    
    return keywordData.sort((a, b) => b.searchVolume - a.searchVolume);
}

Article Generation Process

async function generateSeoArticle(topic, keywords, businessContext) {
    // 1. Research competitor content
    const competitorArticles = await fetchCompetitorContent(keywords);
    
    // 2. Initialize content generation chain
    const llm = await initializeLLM({ model: "gpt-4" });
    const memory = await initializeMemory();
    
    // 3. Create article generation prompts
    const prompts = createArticlePrompts({
        topic: topic,
        targetKeywords: keywords,
        businessContext: businessContext,
        competitorInsights: competitorArticles
    });
    
    // 4. Generate article sections
    const articleChain = createContentChain(llm, prompts, memory);
    
    // Stream article generation
    for await (const section of articleChain.stream()) {
        yield section;
    }
    
    return articleChain.getFinalOutput();
}

API Reference

Business Summary Endpoint

POST /pro-agent/business-summary
Request Body
{
  "websiteUrl": "https://example.com",
  "analysisDepth": "comprehensive",
  "focusAreas": ["products", "target_audience", "brand_voice"]
}
Response Format
{
  "summary": {
    "businessType": "E-commerce Platform",
    "targetAudience": "Small to medium businesses",
    "keyProducts": ["Inventory Management", "Point of Sale"],
    "brandVoice": "Professional, approachable, solution-focused",
    "contentThemes": ["efficiency", "growth", "automation"]
  },
  "metadata": {
    "processingTime": "8s",
    "pagesAnalyzed": 5,
    "contentLength": 12500
  }
}

Keyword Research Endpoint

GET /pro-agent/keyword-research
Query Parameters
  • domain: Target domain for research
  • seedKeywords: Comma-separated list of seed keywords
  • location: Geographic location for search data
  • limit: Maximum number of keywords to return
Response Format
{
  "keywords": [
    {
      "keyword": "inventory management software",
      "searchVolume": 8100,
      "competition": "medium",
      "cpc": 12.45,
      "difficulty": 65,
      "trend": "stable",
      "relatedKeywords": [
        "warehouse management system",
        "stock control software"
      ]
    }
  ],
  "totalKeywords": 150,
  "processingTime": "12s"
}

Topic Generation Endpoint

POST /pro-agent/topic-generation
Request Body
{
  "primaryKeyword": "inventory management software",
  "secondaryKeywords": ["warehouse management", "stock control"],
  "businessContext": "B2B SaaS platform targeting SMEs",
  "contentType": "informational",
  "targetLength": "long-form"
}
Response Format
{
  "topics": [
    {
      "title": "Complete Guide to Inventory Management Software for Small Businesses",
      "angle": "Comprehensive educational guide",
      "targetKeywords": ["inventory management software", "small business"],
      "estimatedDifficulty": "medium",
      "contentOutline": [
        "What is Inventory Management Software?",
        "Key Features to Look For",
        "Implementation Best Practices",
        "ROI and Cost Analysis"
      ]
    }
  ],
  "competitorGaps": [
    "Lack of SME-specific implementation guides",
    "Limited cost comparison content"
  ]
}

Article Generation Endpoint

POST /pro-agent/article-generation
Request Body
{
  "topic": {
    "title": "Complete Guide to Inventory Management Software",
    "targetKeywords": ["inventory management", "warehouse software"],
    "contentType": "guide"
  },
  "requirements": {
    "wordCount": 2500,
    "includeImages": true,
    "internalLinks": 3,
    "callsToAction": 2
  },
  "businessContext": {
    "companyName": "ExampleCorp",
    "products": ["Inventory Pro", "Warehouse Manager"],
    "targetAudience": "SME operations managers"
  }
}
Response Format (Streaming)
data: {"type": "section", "title": "Introduction", "content": "Effective inventory management..."}
data: {"type": "section", "title": "Key Features", "content": "Modern inventory systems..."}
data: {"type": "meta", "wordCount": 2487, "readabilityScore": 68}
data: {"type": "complete", "articleId": "art_12345"}

Core Components

ComponentPurpose
URLCheckerServiceWebsite accessibility validation
DataForSEO ClientKeyword metrics and search data
Content ScraperCompetitor content extraction
LLM ChainContent generation and optimization
Topic ValidatorTopic uniqueness and SEO potential
Article FormatterSEO structure and formatting

Configuration

Keyword Research Settings

{
  "dataforseo": {
    "apiKey": "your-dataforseo-key",
    "location": "2840",
    "language": "en",
    "maxKeywords": 1000,
    "includeRelated": true
  },
  "filtering": {
    "minSearchVolume": 100,
    "maxDifficulty": 80,
    "excludeQuestions": false
  }
}

Content Generation Parameters

{
  "generation": {
    "model": "gpt-4",
    "maxTokens": 4000,
    "temperature": 0.7,
    "structure": {
      "introduction": 150,
      "mainSections": 4,
      "wordsPerSection": 400,
      "conclusion": 100
    }
  },
  "seo": {
    "keywordDensity": 1.5,
    "headingStructure": "h1-h2-h3",
    "metaDescriptionLength": 155,
    "internalLinks": 3
  }
}

Usage Examples

Complete Article Generation Workflow

# 1. Generate business summary
curl -X POST /pro-agent/business-summary \
  -H "Content-Type: application/json" \
  -d '{"websiteUrl": "https://stockwise.com"}'

# 2. Research keywords
curl -X GET "/pro-agent/keyword-research?domain=stockwise.com&seedKeywords=inventory,warehouse"

# 3. Generate topic
curl -X POST /pro-agent/topic-generation \
  -H "Content-Type: application/json" \
  -d '{
    "primaryKeyword": "inventory management software",
    "businessContext": "B2B SaaS for SMEs"
  }'

# 4. Create article
curl -X POST /pro-agent/article-generation \
  -H "Content-Type: application/json" \
  -d '{
    "topic": {
      "title": "Complete Inventory Management Guide",
      "targetKeywords": ["inventory software", "warehouse management"]
    }
  }'

Node.js Integration

const axios = require('axios');

class SEOArticleGenerator {
    constructor(apiKey) {
        this.apiKey = apiKey;
        this.baseUrl = "https://api.example.com";
    }
    
    async generateArticle(websiteUrl, targetKeyword) {
        // 1. Business analysis
        const businessData = await this.analyzeBusiness(websiteUrl);
        
        // 2. Keyword research
        const keywords = await this.researchKeywords(websiteUrl, targetKeyword);
        
        // 3. Topic generation
        const topic = await this.generateTopic(keywords[0], businessData);
        
        // 4. Article creation
        const article = await this.createArticle(topic, keywords, businessData);
        
        return article;
    }
    
    async analyzeBusiness(url) {
        const response = await axios.post(`${this.baseUrl}/pro-agent/business-summary`, 
            { websiteUrl: url }
        );
        return response.data;
    }
    
    async researchKeywords(domain, seedKeyword) {
        const response = await axios.get(`${this.baseUrl}/pro-agent/keyword-research`, {
            params: { domain, seedKeywords: seedKeyword }
        });
        return response.data.keywords;
    }
}

// Usage
const generator = new SEOArticleGenerator("your-api-key");
const article = await generator.generateArticle("https://example.com", "inventory software");

Performance & Limits

Processing Metrics

  • Business Analysis: 5-15 seconds per website
  • Keyword Research: 10-30 seconds for 100 keywords
  • Topic Generation: 3-8 seconds per topic
  • Article Creation: 45-90 seconds for 2000-word articles

Rate Limits

  • API Requests: 100 requests per hour per API key
  • DataForSEO Calls: Limited by DataForSEO subscription
  • Content Generation: 20 articles per day per account

Content Specifications

  • Article Length: 500-5000 words
  • Keyword Density: 1-3% for target keywords
  • Reading Level: Flesch score 60-80 (accessible)
  • SEO Structure: H1, H2, H3 hierarchy with keyword optimization

Error Handling

Common Error Responses

Status CodeError TypeDescriptionSolution
400INVALID_WEBSITE_URLWebsite URL inaccessible or invalidVerify URL format and website accessibility
429KEYWORD_QUOTA_EXCEEDEDDataForSEO API limit reachedUpgrade DataForSEO plan or wait for reset
422INSUFFICIENT_CONTENTWebsite lacks adequate content for analysisProvide alternative content sources
500GENERATION_FAILEDArticle generation pipeline errorRetry with simplified requirements

Error Response Format

{
  "error": {
    "code": "KEYWORD_QUOTA_EXCEEDED",
    "message": "DataForSEO API quota exceeded",
    "details": {
      "quotaUsed": 950,
      "quotaLimit": 1000,
      "resetDate": "2024-02-01T00:00:00Z"
    }
  }
}

Integration Guide

Authentication

All requests require API key authentication:
curl -H "Authorization: Bearer your-api-key"

Webhook Configuration

Configure webhooks for content completion:
{
  "webhookUrl": "https://your-app.com/content-ready",
  "events": ["article.completed", "keyword.research.completed"]
}

Content Quality Controls

Generated articles include:
  • SEO Optimization: Proper keyword placement and density
  • Readability: Target Flesch score of 60-80
  • Structure: Logical H1-H6 heading hierarchy
  • Internal Linking: Strategic links to related content
  • Meta Elements: Optimized title tags and descriptions
  • Content Guidelines: Brand voice and style consistency