Examples
Complete working examples for common use cases.
curl
The simplest way to test the API:
bash
# Generate article
curl -X POST https://blogaizer.com/api/v1/content/articles \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"topic": "AI hospital bed management", "outputs": ["html", "social"]}'
# Poll for result
curl https://blogaizer.com/api/v1/content/articles/job_abc123 \
-H "Authorization: Bearer sk_live_..."
Python
python
import requests
import time
API_KEY = "sk_live_..."
BASE = "https://blogaizer.com/api/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}
# 1. Generate article
job = requests.post(f"{BASE}/content/articles", headers=headers, json={
"topic": "AI-powered hospital bed management in 2026",
"keywords": ["bed management", "patient flow AI"],
"word_count": 1500,
"outputs": ["html", "social", "featured_image"]
}).json()
print(f"Job started: {job['job_id']}")
# 2. Poll for result
while True:
status = requests.get(f"{BASE}/content/articles/{job['job_id']}", headers=headers).json()
if status["status"] == "complete":
print(f"Article ready: {status['article']['title']}")
print(f"EEAT Score: {status['article']['eeat_score']}/50")
break
print(f"Processing... {status['progress']}%")
time.sleep(5)
JavaScript / Node.js
javascript
const API_KEY = "sk_live_...";
const BASE = "https://blogaizer.com/api/v1";
async function generateArticle(topic) {
// 1. Submit job
const job = await fetch(`${BASE}/content/articles`, {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
topic,
keywords: ["bed management", "patient flow AI"],
outputs: ["html", "social", "featured_image"]
})
}).then(r => r.json());
console.log(`Job started: ${job.job_id}`);
// 2. Poll for result
while (true) {
const status = await fetch(`${BASE}/content/articles/${job.job_id}`, {
headers: { "Authorization": `Bearer ${API_KEY}` }
}).then(r => r.json());
if (status.status === "complete") {
console.log(`Article: ${status.article.title} (EEAT: ${status.article.eeat_score}/50)`);
return status;
}
console.log(`Processing... ${status.progress}%`);
await new Promise(r => setTimeout(r, 5000));
}
}
generateArticle("AI-powered hospital bed management in 2026");
n8n Workflow
Build a no-code content pipeline with n8n:
- HTTP Request node —
POST /v1/content/articleswith your topic and API key - Wait node — 60 seconds
- HTTP Request node —
GET /v1/content/articles/{job_id}to check status - IF node —
status === "complete"? continue : loop back to Wait - WordPress node — Publish
article.htmlto your blog
n8n Configuration
Node 1 — Generate Article:
- Method: POST
- URL:
https://blogaizer.com/api/v1/content/articles - Authentication: Header Auth (
Authorization: Bearer sk_live_...) - Body:
{"topic": "{{$json.topic}}", "outputs": ["html", "social"]}
Node 3 — Check Status:
- Method: GET
- URL:
https://blogaizer.com/api/v1/content/articles/{{$json.job_id}} - Authentication: Header Auth
Node 4 — Check Complete:
- Condition:
{{$json.status}}equalscomplete
Full Pipeline Example
Complete flow: register, configure, generate, and publish.
python
import requests
import time
BASE = "https://blogaizer.com/api/v1"
# 1. Register
account = requests.post(f"{BASE}/account/register", json={
"email": "bot@company.com",
"company_name": "Acme Corp"
}).json()
headers = {"Authorization": f"Bearer {account['api_key_live']}"}
# 2. Configure brand
requests.post(f"{BASE}/config/brand", headers=headers, json={
"name": "Acme Healthcare",
"industry": "Healthcare Technology",
"brand_voice": "Professional, data-driven, empathetic."
})
# 3. Configure products
products = requests.post(f"{BASE}/config/products", headers=headers, json={
"brand_id": "brd_xyz",
"products": [{
"name": "WardControl",
"tagline": "AI hospital bed management",
"description": "Real-time bed management and patient flow optimization.",
"keywords": ["bed management", "patient flow"]
}]
}).json()
# 4. Generate 10 content ideas
ideas = requests.post(f"{BASE}/intelligence/ideas", headers=headers, json={
"brand_id": "brd_xyz",
"consider": {"trends": True, "competitors": True}
}).json()
# 5. Generate article from best idea
best_idea = ideas["ideas"][0]
job = requests.post(f"{BASE}/content/articles", headers=headers, json={
"topic": best_idea["title"],
"keywords": best_idea["suggested_keywords"],
"outputs": ["html", "social", "featured_image"]
}).json()
# 6. Wait for result
while True:
result = requests.get(f"{BASE}/content/articles/{job['job_id']}", headers=headers).json()
if result["status"] == "complete":
print(f"Done! {result['article']['title']} — EEAT: {result['article']['eeat_score']}/50")
break
time.sleep(5)
