Skip to content

nfurniel/cosmos-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪐 CosmosAPI

Python FastAPI License Status

The open-source, high-performance REST API for astronomy enthusiasts, educators, and space-bots. 🚀

CosmosAPI provides curated, scientifically accurate facts about the universe (planets, stars, black holes, and more). Built with FastAPI for blazing speed and simplicity.


Live Demo & Documentation

The API is deployed and ready to use! You can test all endpoints directly in your browser via the interactive Swagger UI:

Click here to try the API (Live Docs)


Features

  • 🌌 Vast Database: Facts about planets, stars, nebulae, and space history.
  • 🚀 Blazing Fast: Built on top of Starlette and Pydantic.
  • 📖 Self-Documented: Automatic interactive documentation.
  • 🔍 Smart Filtering: Filter facts by specific categories.
  • 🆓 Free & Open Source: No API keys required (yet).

API Endpoints

Base URL: https://cosmos-api-production.onrender.com

Method Endpoint Description Example Usage
GET /api/v1/random Returns a single random fact. curl /api/v1/random
GET /api/v1/facts Returns the full list of facts. curl /api/v1/facts
GET /api/v1/category/{name} Filter facts by category. curl /api/v1/category/planets
GET /docs Interactive Swagger UI. Visit in browser

Example Response (/api/v1/random)

{
  "id": "fact_001",
  "content": "Neutron stars are so dense that a teaspoon of them would weigh about 6 billion tons.",
  "category": "stars",
  "complexity": "medium",
  "source": "National Geographic"
}

📂 Project Structure

cosmos-api/
├── app/
│   ├── main.py           # The API entry point & logic
│   └── __init__.py
├── data/
│   └── cosmos_facts.json # The database of facts
├── requirements.txt      # Python dependencies
└── README.md             # Project documentation

If you find this API useful, please give it a star ⭐ on GitHub!
Built with ❤️ and 🔭 by Furni

About

A high-performance, open-source REST API for astronomy facts built with FastAPI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages