(DEMO) Just a weather rest API built with trae agent
For detailed technical documentation and architecture, please see DESIGN.md.
- Python 3.7 or higher
- WeatherAPI.com API key (get it from WeatherAPI.com)
- Clone the repository:
git clone https://github.com/yourusername/trae-test.git
cd trae-test
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a
.env
file in the project root - Add your WeatherAPI.com API key as follows:
WEATHERAPI_KEY=your_api_key_here
- Create a
Start the server with:
uvicorn main:app --reload
The API will be available at http://localhost:8000
curl http://localhost:8000/weather/{city}
Replace {city}
with the name of the city you want to get weather information for.
Example response:
{
"city": "London",
"temperature": 15.6,
"humidity": 75,
"description": "Partly cloudy",
"feels_like": 14.8
}