Documentation
API Reference
Everything you need to connect your site and start generating content.
Quick Start
Two ways to connect: the CLI (interactive) or the SDK (programmatic).
Option 1: CLI (recommended for first setup)
$ npx networkr init # Auto-detects your framework, database, and config # Asks for domain, email, niche, voice style # Connects your site and generates first article immediately
Option 2: SDK
npm install networkr import Networkr from 'networkr' const nm = new Networkr({ apiKey: 'nk_...' }) const site = await nm.connect({ domain: 'myblog.com', email: 'me@company.com', db_type: 'supabase', db_url: process.env.SUPABASE_URL, db_key: process.env.SUPABASE_KEY, niche: 'developer tools' }) // First article generates immediately // Daily articles start on configured schedule
SDK Reference
const nm = new Networkr({ apiKey, baseUrl? }) // Connect a site (one-call onboarding) await nm.connect({ domain, email, db_type, db_url, ... }) // List your sites await nm.sites() // Get site detail with stats await nm.site(siteId) // Update site config await nm.update(siteId, { voice_id?, themes?, ... }) // Generate article now await nm.generate(siteId, { topic?, angle? }) // Get generation history await nm.history(siteId) // Disconnect a site await nm.disconnect(siteId) // System health (no auth) await nm.health()
Connect Endpoint
The POST /api/connect endpoint is the one-call onboarding. It auto-creates a network (or joins an existing one by email), creates a voice, creates an author, registers your site, starts the cron, and fires the first article immediately.
POST /api/connect
{
"domain": "myblog.com", // required
"email": "me@company.com", // required — groups sites into networks
"db_type": "supabase", // required — "supabase" or "pocketbase"
"db_url": "https://xxx.supabase.co", // required
"db_key": "eyJ...", // supabase service role key
"db_password": "...", // pocketbase admin password (instead of db_key)
"name": "My Blog", // optional — auto-derived from domain
"niche": "developer tools", // optional — sets themes
"topics": ["AI", "DevOps"], // optional — multiple themes
"voice_preset": "technical", // optional — professional|casual|technical|founder
"author_name": "Jane Dev", // optional
"cron_schedule": "0 6 * * *" // optional — default daily 06:00
}Response
{
"success": true,
"site_id": "myblog-com",
"network_id": "fe09c250...",
"voice_id": "a3b1...",
"author_id": "c4d2...",
"status": "connected",
"first_article": "generating now — check history in ~2 minutes",
"message": "MyBlog is live. First article is generating now...",
"digest": "Weekly digest will be sent to me@company.com every Monday",
"endpoints": { ... }
}REST API
Base URL: https://api.networkr.dev
Sites
POST/api/connect
One-call onboardingGET/api/sites
List all sitesGET/api/sites/:id
Site detail + statsPUT/api/sites/:id
Update site configDELETE/api/sites/:id
Disconnect siteBlog Generation
POST/api/sites/:id/blog/generate
Generate article nowPOST/api/sites/:id/blog/start
Enable daily cronPOST/api/sites/:id/blog/stop
Disable daily cronGET/api/sites/:id/blog/history
Generation historyGET/api/sites/:id/blog/preview
Dry-run topic selectionSEO
GET/api/seo/research?q=...
SERP researchPOST/api/seo/keywords
Track keywordsGET/api/seo/keywords/:siteId
Keyword rankingsPOST/api/seo/keywords/check
Trigger rank checkPOST/api/seo/brain/trigger
Run SEO BrainGET/api/seo/brain/status
Topic queue statusContent Registry
GET/api/registry
All articlesGET/api/registry/search?tags=...
Search articlesGET/api/registry/links/:siteId
Cross-link suggestionsGET/api/registry/stats
Network statsNetwork & Admin
GET/api/networks
List networksGET/api/orchestrator/latest
Latest health reportPOST/api/orchestrator/trigger
Run orchestrator nowPOST/api/digest/trigger
Send weekly digest nowGET/api/status
Full system statusGET/health
Health check (no auth)Authentication
All /api/* endpoints require a bearer token:
Authorization: Bearer nk_your_api_key
The /health endpoint is public (no auth required).
Self-Hosting
The entire engine runs as a single Docker container. Bring your own API keys.
docker-compose.yml
services:
content-machine:
build: .
container_name: content-machine
restart: unless-stopped
ports:
- "3002:3002"
env_file:
- .env
volumes:
- ./data:/app/data
- ./assets/logos:/app/assets/logos
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3002/health"]
interval: 30s
timeout: 5s
retries: 3Required environment variables
CONTENT_MACHINE_SECRET=your-bearer-token ANTHROPIC_API_KEY=sk-ant-... # or use OpenRouter only OPENROUTER_API_KEY=sk-or-... SERPER_API_KEY=... # Google search API MAILJET_API_KEY=... # optional — for weekly digest MAILJET_SECRET_KEY=...