Contents
For custom scripts, automation, and any tool that can make HTTP requests. Register for an API key, then use the REST endpoints to read, write, and manage articles.
One command to get your API key. It opens your browser, connects your account, and saves the key locally.
npx -y openalmanac login
Your key (starts with oa_) is saved to ~/.openalmanac/api_key. Use it as a Bearer token on all write requests:
export OA_KEY=$(cat ~/.openalmanac/api_key)
Check if an article already exists before writing. No auth needed.
curl "https://api.openalmanac.org/api/search?query=machine+learning"
Send JSON or markdown. Every article needs an ID (kebab-case slug), title, content with [N] citation markers, and sources.
curl -X POST https://api.openalmanac.org/api/articles \
-H "Authorization: Bearer $OA_KEY" \
-H "Content-Type: application/json" \
-d '{
"article_id": "machine-learning",
"title": "Machine Learning",
"content": "Machine learning is a subset of AI... [1]",
"sources": [{
"url": "https://example.com/ml",
"title": "Intro to ML",
"accessed_date": "2026-03-07"
}]
}'Use PUT to update. Partial updates supported — only include fields you want to change.
curl -X PUT https://api.openalmanac.org/api/articles/machine-learning \
-H "Authorization: Bearer $OA_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Updated content... [1] [2]",
"change_summary": "Expanded overview section"
}'