Developer API

Answerlord SDK

Grade AI visibility, get evidence-grounded fix recommendations, and receive webhook alerts when your score changes — all from your CI/CD pipeline.

1. Add to your CI/CD pipeline

bash
# Install
npm install @answerlord/sdk

# Add to .env
ANSWERLORD_API_KEY=al_live_your_key_here
typescript
// 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
  }
}

2. Grade on every deploy (GitHub Actions)

yaml
# .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"
          fi

The 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.

3. Get fix recommendations in your codebase

typescript
// 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.

4. Webhook alerts when your score changes

typescript
// 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 Reference

POST
/api/v1/gradeFree+

Full grade: score, per-engine breakdown, gaps, competitors.

GET
/api/v1/scoreFree+

Lightweight cached score + grade. Returns 404 if not yet graded.

POST
/api/v1/recommendationsStarter+

RAG-grounded AEO fix recommendations citing real evidence.

POST
/api/v1/monitorStarter+

Register a webhook for score/competitor/engine alerts.

POST
/api/v1/batchGrowth+

Async grade up to 50 domains. Returns batch_id to poll.

GET
/api/v1/batch/{id}Growth+

Poll batch job status and results.

GET
/api/v1/usageFree+

Current month usage, quota, rate limit stats.

Pricing

Free
$0
/month
50 calls/mo
10 req/min
grade
score
Starter
$29
/month
500 calls/mo
30 req/min
+ recommendations
+ monitor
Growth
$99
/month
5,000 calls/mo
60 req/min
+ batch
+ webhooks
Scale
$299
/month
50,000 calls/mo
200 req/min
+ priority
+ all endpoints