Free, open-source API serving curated investment wisdom from the world's greatest investors — Warren Buffett, Charlie Munger, Benjamin Graham, Peter Lynch, Howard Marks, Ray Dalio, and more.
Powered by KeepRule — Your guide to timeless investment principles.
All endpoints are static JSON files hosted on GitHub Pages. No authentication required.
| Endpoint | Description |
|---|---|
/api/principles.json |
100 investment principles with author, category & source |
/api/authors.json |
List of all investment masters |
/api/categories.json |
Investment principle categories |
Base URL: https://henu-wang.github.io/keeprule-api
{
"total": 100,
"source": "https://keeprule.com",
"principles": [
{
"id": 1,
"text": "Rule No. 1: Never lose money. Rule No. 2: Never forget Rule No. 1.",
"author": "Warren Buffett",
"category": "Risk Management",
"source": "Berkshire Hathaway Annual Meeting"
}
]
}{
"total": 18,
"authors": [
{
"id": 1,
"name": "Warren Buffett",
"title": "Chairman & CEO, Berkshire Hathaway",
"known_for": "Value Investing, Long-term Holding",
"principles_count": 20
}
]
}{
"total": 13,
"categories": [
{
"id": 1,
"name": "Risk Management",
"description": "Principles about identifying, assessing, and mitigating investment risks",
"principles_count": 14
}
]
}# Get all principles
curl https://henu-wang.github.io/keeprule-api/api/principles.json
# Get authors
curl https://henu-wang.github.io/keeprule-api/api/authors.json
# Get categories
curl https://henu-wang.github.io/keeprule-api/api/categories.json// Fetch all investment principles
const response = await fetch('https://henu-wang.github.io/keeprule-api/api/principles.json');
const data = await response.json();
// Get a random principle
const random = data.principles[Math.floor(Math.random() * data.total)];
console.log(`"${random.text}" — ${random.author}`);
// Filter by author
const buffett = data.principles.filter(p => p.author === 'Warren Buffett');
console.log(`Found ${buffett.length} Buffett principles`);
// Filter by category
const risk = data.principles.filter(p => p.category === 'Risk Management');
console.log(`Found ${risk.length} risk management principles`);import requests
import random
# Fetch all principles
response = requests.get('https://henu-wang.github.io/keeprule-api/api/principles.json')
data = response.json()
# Random principle
principle = random.choice(data['principles'])
print(f'"{principle["text"]}" — {principle["author"]}')
# Filter by author
munger = [p for p in data['principles'] if p['author'] == 'Charlie Munger']
print(f'Found {len(munger)} Munger principles')| Investor | Principles | Known For |
|---|---|---|
| Warren Buffett | 20 | Value Investing, Long-term Holding |
| Charlie Munger | 13 | Mental Models, Multidisciplinary Thinking |
| Benjamin Graham | 10 | Margin of Safety, Security Analysis |
| Peter Lynch | 10 | Invest in What You Know |
| Howard Marks | 10 | Second-Level Thinking |
| Ray Dalio | 10 | Principles-Based Investing |
| Philip Fisher | 7 | Growth Investing, Scuttlebutt Method |
| John Templeton | 4 | Global Contrarian Investing |
| + 10 more | ... | ... |
Risk Management, Value Investing, Market Psychology, Long-term Thinking, Mental Models, Decision Making, Circle of Competence, Portfolio Management, Business Quality, Self-improvement, Contrarian Thinking, Research, Compounding
KeepRule is an interactive platform for exploring investment principles from the world's greatest investors. Features include:
- Scenario-based learning with real-world investment situations
- Principles organized by master investor and category
- AI-powered investment wisdom chat
This API is free to use for personal and commercial projects. Attribution to KeepRule is appreciated but not required.
Data is provided for educational purposes only and does not constitute financial advice.
- Investor Personality Quiz - Which legendary investor are you?
- Investment Scorecard - Rate any stock like Buffett
- Portfolio Health Check - Grade your portfolio
- Fear & Greed Calculator - Market sentiment tool
- Decision Tree - Buy/Hold/Sell guidance
- Investment Calculators - Compound interest, retirement, DCA & more
- 30-Day Challenge - Transform your investing
- Free API - 100 principles, 20 authors
- NPM Package -
npm install keeprule - PyPI Package -
pip install keeprule - Chrome Extension
- Discord Bot
- Embeddable Widget
- Master Guides - Buffett, Munger, Graham & more
- Free Ebook - 100 Investment Principles
- Email Course - 7-day Buffett course
- Infographics - Visual investing guides
- Investment Glossary - 100 terms every investor should know
- Annual Report - State of Investment Principles 2026
- SEO Blog - Deep-dive investing articles
- Platform Comparisons - KeepRule vs alternatives
Built by William Wang | All Tools