Trigger from your CMS
POST to /generate whenever editors mark a keyword as “ready”. Webhook notifies your CMS when the draft is done.
This 5-minute walkthrough takes you from a fresh account to your first AI-generated SEO article via the AutoRanq API. By the end you’ll have:
You need:
curl, OR Node 18+ / Python 3.9+ if you prefer thoseOpen the dashboard at app.autoranq.ai and go to Settings → API.
Create a key with scope read,write. Pick test mode for this walkthrough (your key starts with ar_test_).
Copy the key now — it’s shown only once. Paste it into your terminal:
export AUTORANQ_KEY="ar_test_paste_your_key_here"You need a project_id to generate articles. List your projects:
curl https://api.autoranq.ai/api/public/v1/projects \ -H "Authorization: Bearer $AUTORANQ_KEY"const response = await fetch( 'https://api.autoranq.ai/api/public/v1/projects', { headers: { Authorization: `Bearer ${process.env.AUTORANQ_KEY}` } });const { data } = await response.json();console.log(data);import os, requests
response = requests.get( "https://api.autoranq.ai/api/public/v1/projects", headers={"Authorization": f"Bearer {os.environ['AUTORANQ_KEY']}"},)print(response.json())Copy a project_id from the response — it looks like clxabc123def456ghi789. Export it:
export PROJECT_ID="clxabc123def456ghi789"Fire a generation job for the keyword "how to start a blog":
curl -X POST https://api.autoranq.ai/api/public/v1/generate \ -H "Authorization: Bearer $AUTORANQ_KEY" \ -H "Content-Type: application/json" \ -d "{ \"project_id\": \"$PROJECT_ID\", \"keyword\": \"how to start a blog\" }"const response = await fetch( 'https://api.autoranq.ai/api/public/v1/generate', { method: 'POST', headers: { Authorization: `Bearer ${process.env.AUTORANQ_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ project_id: process.env.PROJECT_ID, keyword: 'how to start a blog', }), });const { data } = await response.json();console.log('generation_id:', data.generation_id);import os, requests
response = requests.post( "https://api.autoranq.ai/api/public/v1/generate", headers={ "Authorization": f"Bearer {os.environ['AUTORANQ_KEY']}", "Content-Type": "application/json", }, json={ "project_id": os.environ["PROJECT_ID"], "keyword": "how to start a blog", },)print("generation_id:", response.json()["data"]["generation_id"])The response includes a generation_id. Save it:
export GEN_ID="clxgen123def456ghi789" # paste from responseGeneration takes 30-90 seconds depending on the recipe. Poll the status endpoint:
# Poll every 5 seconds until status is COMPLETED or FAILEDwhile true; do status=$(curl -s https://api.autoranq.ai/api/public/v1/generations/$GEN_ID \ -H "Authorization: Bearer $AUTORANQ_KEY" | jq -r '.data.status') echo "$(date +%T) — $status" [[ "$status" == "COMPLETED" || "$status" == "FAILED" ]] && break sleep 5donewhile (true) { const res = await fetch( `https://api.autoranq.ai/api/public/v1/generations/${process.env.GEN_ID}`, { headers: { Authorization: `Bearer ${process.env.AUTORANQ_KEY}` } } ); const { data } = await res.json(); console.log(new Date().toLocaleTimeString(), '—', data.status); if (data.status === 'COMPLETED' || data.status === 'FAILED') break; await new Promise(r => setTimeout(r, 5000));}import os, time, requestsfrom datetime import datetime
while True: res = requests.get( f"https://api.autoranq.ai/api/public/v1/generations/{os.environ['GEN_ID']}", headers={"Authorization": f"Bearer {os.environ['AUTORANQ_KEY']}"}, ) status = res.json()["data"]["status"] print(datetime.now().strftime("%H:%M:%S"), "—", status) if status in ("COMPLETED", "FAILED"): break time.sleep(5)Once status is COMPLETED, the generation contains an article_id. Fetch the article:
article_id=$(curl -s https://api.autoranq.ai/api/public/v1/generations/$GEN_ID \ -H "Authorization: Bearer $AUTORANQ_KEY" | jq -r '.data.article_id')
curl https://api.autoranq.ai/api/public/v1/articles/$article_id \ -H "Authorization: Bearer $AUTORANQ_KEY"const gen = await fetch( `https://api.autoranq.ai/api/public/v1/generations/${process.env.GEN_ID}`, { headers: { Authorization: `Bearer ${process.env.AUTORANQ_KEY}` } }).then(r => r.json());
const article = await fetch( `https://api.autoranq.ai/api/public/v1/articles/${gen.data.article_id}`, { headers: { Authorization: `Bearer ${process.env.AUTORANQ_KEY}` } }).then(r => r.json());
console.log(article.data.title);console.log(article.data.content_html.slice(0, 500));import os, requests
gen = requests.get( f"https://api.autoranq.ai/api/public/v1/generations/{os.environ['GEN_ID']}", headers={"Authorization": f"Bearer {os.environ['AUTORANQ_KEY']}"},).json()
article = requests.get( f"https://api.autoranq.ai/api/public/v1/articles/{gen['data']['article_id']}", headers={"Authorization": f"Bearer {os.environ['AUTORANQ_KEY']}"},).json()
print(article["data"]["title"])print(article["data"]["content_html"][:500])You’ll get back the full article: title, content HTML, meta description, SEO fields, and FAQ section.
In ~5 minutes you went from no integration to a programmatic SEO-content pipeline. Real-world usage looks like:
Trigger from your CMS
POST to /generate whenever editors mark a keyword as “ready”. Webhook notifies your CMS when the draft is done.
Bulk-generate from a sheet
Loop through a list of keywords with 100ms throttling — well under the 1000 req/hour rate limit.
Publish to WordPress
Pull content_html after generation, push to WP REST API. ~10 lines of code.