This FastAPI-based project provides two simple API endpoints:
/side_hustles– Returns a random side hustle idea./money_quotes– Returns a random money-related quote.
Both endpoints require an API key for authentication.
- Fast and lightweight API built with FastAPI.
- Secure API key authentication.
- Randomized responses for dynamic content delivery.
Ensure you have Python 3.7+ installed.
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git cd your-repo -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install fastapi uvicorn
-
Run the API server:
uvicorn main:app --reload
- Endpoint:
GET /side_hustles - Query Parameter:
api_key(required) - Example Request:
curl "http://127.0.0.1:8000/side_hustles?api_key=123456789" - Example Response:
{ "side_hustle": "Freelancing - Start offering your skills online!" }
- Endpoint:
GET /money_quotes - Query Parameter:
api_key(required) - Example Request:
curl "http://127.0.0.1:8000/money_quotes?api_key=123456789" - Example Response:
{ "money_quote": "Money is a terrible master but an excellent servant. – P.T. Barnum" }
- API key is required for both endpoints.
- Example API key used:
123456789(Change this for production use).
Feel free to contribute by submitting pull requests or reporting issues.
This project is licensed under the MIT License.