Grade AI visibility, get evidence-grounded fix recommendations, and receive webhook alerts when your score changes — all from your CI/CD pipeline.
# Install
npm install @answerlord/sdk
# Add to .env
ANSWERLORD_API_KEY=al_live_your_key_here// answerlord.config.ts
import { Answerlord } from '@answerlord/sdk'
export default {
domain: 'yourapp.com',
niche: 'your product category',
apiKey: process.env.ANSWERLORD_API_KEY,
alerts: {
scoreDropThreshold: 10,
webhook: process.env.ANSWERLORD_WEBHOOK_URL
}
}# .github/workflows/aeo-check.yml
name: AEO Visibility Check
on:
push:
branches: [main]
jobs:
aeo-check:
runs-on: ubuntu-latest
steps:
- name: Check AI Visibility Score
run: |
SCORE=$(curl -s -X GET \
"https://answerlord.com/api/v1/score?domain=yourapp.com&niche=your+category" \
-H "Authorization: Bearer ${{ secrets.ANSWERLORD_API_KEY }}" \
| jq '.score')
echo "Current AEO Score: $SCORE/100"
if [ "$SCORE" -lt "40" ]; then
echo "⚠️ AEO score below threshold — run recommendations"
fiThe GET /api/v1/score endpoint is lightweight — it reads from cache and never runs a fresh grade unless you hit POST /api/v1/grade. Perfect for CI checks.
// scripts/aeo-check.ts (run: npx tsx scripts/aeo-check.ts)
const response = await fetch('https://answerlord.com/api/v1/recommendations', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ANSWERLORD_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ domain: 'yourapp.com', niche: 'your category' })
})
const { recommendations } = await response.json()
recommendations.forEach(rec => {
console.log(`[${rec.priority.toUpperCase()}] ${rec.title}`)
console.log(` What: ${rec.what_to_do}`)
console.log(` Why: ${rec.why_it_works}`)
if (rec.code_snippet) {
console.log(` Add this to your HTML:\n${rec.code_snippet}`)
}
})Recommendations are grounded in the Answerlord RAG knowledge base — every suggestion cites a real crawled source with an evidence_url. Available on Starter tier and above.
// pages/api/answerlord-webhook.ts (Next.js)
export async function POST(req: Request) {
const alert = await req.json()
if (alert.alert_type === 'score_drop') {
// Send Slack notification, create GitHub issue, etc.
await notifyTeam(`🚨 AEO score dropped ${Math.abs(alert.change)} points to ${alert.current_score}/100`)
}
if (alert.alert_type === 'new_competitor') {
await notifyTeam(`👀 New competitor appearing in AI results: ${alert.details}`)
}
return new Response('ok')
}Register a webhook via POST /api/v1/monitor. Answerlord will POST to your URL when score drops, new competitors appear, or you lose a cited engine. Requires Starter tier.
/api/v1/gradeFree+Full grade: score, per-engine breakdown, gaps, competitors.
/api/v1/scoreFree+Lightweight cached score + grade. Returns 404 if not yet graded.
/api/v1/recommendationsStarter+RAG-grounded AEO fix recommendations citing real evidence.
/api/v1/monitorStarter+Register a webhook for score/competitor/engine alerts.
/api/v1/batchGrowth+Async grade up to 50 domains. Returns batch_id to poll.
/api/v1/batch/{id}Growth+Poll batch job status and results.
/api/v1/usageFree+Current month usage, quota, rate limit stats.