API for getting random facts and information about cat breeds in English.
CatFactsAPI is a simple and lightweight REST API built with FastAPI that returns random facts about cats and breed information. Perfect for educational projects, test applications, or just for fun.
- β Random cat facts
- β 350+ unique facts in the database
- β Cat breed information
- β Get fact or breed by ID
- β Fact length information
- β Automatic documentation via Swagger UI
- β English-language API
- Python 3.8+
- pip
- Clone the repository:
git clone https://github.com/FelineFantasy/CatFactsAPI
cd CatFactsAPI- Install dependencies:
pip install -r requirements.txtStart the server using Uvicorn:
uvicorn main:app --reloadOr run the script directly (no reload):
python main.pyThe server will be available at: http://localhost:8000
The API is already deployed and available at: https://catfactsapi.onrender.com
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
API information |
| GET | /fact |
Random fact |
| GET | /facts?limit=5 |
Multiple random facts |
| GET | /fact/{id} |
Fact by ID (0β99) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /breed |
Random breed |
| GET | /breeds?limit=5 |
Multiple breeds |
| GET | /breed/{id} |
Breed by ID (0β9) |
Interactive documentation is available at:
- Swagger UI: https://catfactsapi.onrender.com/docs
- ReDoc: https://catfactsapi.onrender.com/redoc
When running locally:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
# Random fact
curl https://catfactsapi.onrender.com/fact
# Random breed
curl https://catfactsapi.onrender.com/breed
# 3 random facts
curl https://catfactsapi.onrender.com/facts?limit=3
# Fact by ID
curl https://catfactsapi.onrender.com/fact/42
# Breed by ID
curl https://catfactsapi.onrender.com/breed/5import requests
# Random fact
response = requests.get("https://catfactsapi.onrender.com/fact")
data = response.json()
print(data["fact"])
# Random breed
response = requests.get("https://catfactsapi.onrender.com/breed")
data = response.json()
print(data["breed"], data["country"])// Random fact
fetch('https://catfactsapi.onrender.com/fact')
.then(response => response.json())
.then(data => console.log(data.fact));
// Random breed
fetch('https://catfactsapi.onrender.com/breed')
.then(response => response.json())
.then(data => console.log(data.breed, data.country));CatFactsAPI/
βββ .github/
β βββ FUNDING.yml # Support link for DonationAlerts
βββ .gitignore # Git ignore file
βββ LICENSE # MIT License
βββ main.py # Main application file
βββ facts.json # Cat facts database (350+)
βββ breeds.json # Cat breeds database (100+)
βββ requirements.txt # Project dependencies
βββ README.md # Documentation
If you enjoy CatFactsAPI and want to help keep the project alive, you can support me here:
Your support helps me:
- π± Keep developing new features
- π οΈ Fix bugs and improve the game
- β Stay awake while coding at 4 AM
Every little bit is appreciated! β€οΈ
- FastAPI β Modern web framework for building APIs
- Uvicorn β ASGI server
- Render β Hosting (live version)
- FelineFantasy
- License: MIT
fix: update readme
chore: cleanup
feat: add feature
refactor: improve