-
Notifications
You must be signed in to change notification settings - Fork 1
07 Integration Guide
Ghost Writer integrates with the googleadsagent.ai ecosystem and can be used as a standalone API or as part of a larger content and advertising workflow.
Ghost Writer can be invoked by the advertising-hub orchestration layer when content generation is needed:
- Use case: Generate LinkedIn posts from campaign insights, blog posts from audit findings, or email copy from lead data
- Flow: Hub receives request → routes to Ghost Writer API → returns formatted content
-
Context: Hub can pass campaign data, audience segments, or topic briefs as
context
The google-ads-mcp server provides live Google Ads API access. Ghost Writer can consume:
- Campaign data — For case studies, performance narratives, proof points
- Search terms — For topic ideas, FAQ content
- Audience insights — For persona-aware copy
Example flow: MCP returns top-performing keywords → Ghost Writer generates blog post or LinkedIn post using those topics.
- Voice profiles — Custom profiles can be stored in ContextOS and loaded by Ghost Writer
- Session memory — Prior generations, preferences, and feedback can inform future requests
- Cross-tool consistency — Same voice across Audit Engine reports, Ghost Writer content, and chat
Intel Harvester collects competitor content from public sources. Ghost Writer can:
- Use competitor posts as topic inspiration (not copy)
- Adapt format and structure from high-performing examples
- Generate differentiated responses to competitor messaging
The 250-point Audit Engine produces structured audit data. Ghost Writer can:
- Turn audit findings into proof points for case studies
- Generate client-facing summaries from technical scores
- Create blog posts or LinkedIn posts that cite audit results
Base URL: https://googleadsagent.ai/api (or your deployment)
Main content generation and adaptation endpoint.
Actions: generate, check, adapt
{
"action": "generate",
"type": "linkedin",
"topic": "Why PMax works better with brand campaigns",
"context": "B2B SaaS audience, $50K/month spend",
"voice": "john-williams",
"length": 500,
"variants": 1,
"detectorsEnabled": true
}{
"action": "generate",
"type": "linkedin",
"voice": "john-williams",
"topic": "Why PMax works better with brand campaigns",
"results": {
"variant": 1,
"content": "Here's the thing about PMax...",
"qa": {
"passed": true,
"hardFails": 0,
"softFails": 2,
"checks": [...]
},
"stats": {
"wordCount": 127,
"avgSentenceLength": 16.2,
"sentenceLengthStdev": 7.1,
"ttr": 0.52,
...
},
"detection": {
"gptzero": { "aiProbability": 0.12, "passed": true },
"pangram": { "prediction": "Human", "passed": true },
"originality": { "aiScore": 0.08, "plagiarismScore": 0.02, "passed": true },
"allPassed": true
},
"revisionCount": 0,
"platform": { "name": "LinkedIn", "maxChars": 3000, ... }
}
}{
"action": "check",
"existingText": "Your existing content to analyze...",
"type": "linkedin",
"voice": "john-williams",
"detectorsEnabled": true
}{
"action": "check",
"qa": { "passed": true, "checks": [...], "hardFails": 0, "softFails": 1 },
"detection": { "gptzero": {...}, "pangram": {...}, "originality": {...} },
"stats": { "wordCount": 89, ... },
"platform": {...}
}{
"action": "adapt",
"existingText": "Your content to format for platform...",
"type": "linkedin",
"voice": "john-williams"
}Grammar, readability, tone, AI detection, and plagiarism check for arbitrary text.
Request:
{
"text": "Your content to check...",
"checkGrammar": true,
"checkReadability": true,
"checkTone": true,
"checkAI": true,
"checkPlagiarism": true
}Response:
{
"grammar": { "errors": [...], "score": 94 },
"readability": { "fleschKincaid": 65, "grade": "8th grade", "wordCount": 120, ... },
"tone": { "detected": ["confident", "direct"], "onBrand": true, "suggestions": [] },
"aiDetection": { "overallScore": 0.15, "passed": true, "sentences": [...] },
"plagiarism": { "score": 0.02, "matches": [] },
"style": {
"phraseBlacklistHits": [],
"vocabularyRichness": 0.52,
"hapaxRatio": 0.31,
"burstiness": 7.2,
"avgSentenceLength": 16.1
}
}Voice profile management.
Actions: analyze, save, list, get, delete
{
"action": "analyze",
"samples": [
"Your first writing sample...",
"Your second sample...",
"Your third sample..."
]
}{
"action": "analyze",
"fingerprint": {
"sentenceLength": { "mean": 16.2, "stdev": 8.5, "min": 3, "max": 42 },
"vocabulary": { "ttr": 0.51, "domainTerms": [...], "signaturePhrases": [...] },
"structuralHabits": { "startsWithConjunctions": true, "usesFragments": true, ... },
"toneAnchors": ["direct", "data-driven", ...],
"perplexityTarget": [28, 48],
"burstiTarget": "high",
"samplesAnalyzed": 3,
"totalWordsAnalyzed": 1250
}
}{
"action": "save",
"name": "my-custom-voice",
"samples": ["Sample 1...", "Sample 2...", "Sample 3..."]
}Requires CONTEXT KV binding.
All endpoints support CORS with Access-Control-Allow-Origin: * for OPTIONS and POST.