{"id":22967825,"url":"https://github.com/ibensusan/weather-forecast-api-with-fastapi","last_synced_at":"2026-05-02T19:34:13.735Z","repository":{"id":261389497,"uuid":"883772373","full_name":"iBensusan/Weather-Forecast-API-with-FastAPI","owner":"iBensusan","description":"This API simulates a simple weather forecast service, allowing users to request a weather forecast for a specified city","archived":false,"fork":false,"pushed_at":"2024-11-06T09:15:50.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T05:19:19.379Z","etag":null,"topics":["fastapi","python3","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iBensusan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-05T14:47:08.000Z","updated_at":"2024-11-07T10:16:33.000Z","dependencies_parsed_at":"2024-11-06T10:41:15.521Z","dependency_job_id":"bcd837ef-e7d3-49a6-ba92-40a08040a043","html_url":"https://github.com/iBensusan/Weather-Forecast-API-with-FastAPI","commit_stats":null,"previous_names":["ibensusan/weather-forecast-api-with-fastapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iBensusan/Weather-Forecast-API-with-FastAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBensusan%2FWeather-Forecast-API-with-FastAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBensusan%2FWeather-Forecast-API-with-FastAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBensusan%2FWeather-Forecast-API-with-FastAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBensusan%2FWeather-Forecast-API-with-FastAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iBensusan","download_url":"https://codeload.github.com/iBensusan/Weather-Forecast-API-with-FastAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBensusan%2FWeather-Forecast-API-with-FastAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32547650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","python3","uvicorn"],"created_at":"2024-12-14T21:14:53.522Z","updated_at":"2026-05-02T19:34:13.719Z","avatar_url":"https://github.com/iBensusan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather Forecast API with FastAPI\n\nA real-world level project designed to build a RESTful API using FastAPI. This API simulates a simple weather forecast service, allowing users to request a weather forecast for a specified city over a 3-day period and retrieve specific day forecasts within this period.\n\n## Features\n\n- **3-Day Forecast Retrieval**: Users can get the weather forecast for a city over a 3-day period.\n- **Daily Forecast Query**: Allows users to query the forecast for a specific day within the 3-day range.\n- **High-Performance Framework**: Built with FastAPI for fast and reliable API performance.\n- **Simulated Data**: Generates random weather conditions for demonstration purposes.\n\n## Requirements\n\n- Python 3.6 or above\n- `fastapi`\n- `uvicorn`\n\n## Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/username/weather-forecast-api-fastapi.git\n    cd weather-forecast-api-fastapi\n    ```\n\n2. Install the required libraries:\n    ```bash\n    pip install fastapi uvicorn\n    ```\n\n## Usage\n\n1. Run the API using `uvicorn`:\n    ```bash\n    uvicorn weather_api:app --reload\n    ```\n\n2. Access the API endpoints:\n    - Get a 3-day weather forecast for a city:\n      ```\n      http://127.0.0.1:8000/forecast/{city_name}\n      ```\n    - Get the weather forecast for a specific day within the 3-day period:\n      ```\n      http://127.0.0.1:8000/forecast/{city_name}/{day}\n      ```\n\n## Example Workflow\n\n1. Query the 3-day forecast for a city:\n    ```\n    http://127.0.0.1:8000/forecast/London\n    ```\n\n    Response:\n    ```json\n    {\n      \"city\": \"London\",\n      \"forecasts\": [\n        {\"day\": \"Day 1\", \"temperature_c\": 8, \"condition\": \"Rainy\"},\n        {\"day\": \"Day 2\", \"temperature_c\": 34, \"condition\": \"Cloudy\"},\n        {\"day\": \"Day 3\", \"temperature_c\": 25, \"condition\": \"Sunny\"}\n      ]\n    }\n    ```\n\n2. Query the forecast for a specific day:\n    ```\n    http://127.0.0.1:8000/forecast/London/2\n    ```\n\n    Response:\n    ```json\n    {\n      \"city\": \"London\",\n      \"forecast\": {\"day\": \"Day 2\", \"temperature_c\": 34, \"condition\": \"Cloudy\"}\n    }\n    ```\n\n## Files\n\n- `weather_api.py`: The main FastAPI script that runs the API and simulates the weather forecast service.\n- `README.md`: Project description and usage guide.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibensusan%2Fweather-forecast-api-with-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibensusan%2Fweather-forecast-api-with-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibensusan%2Fweather-forecast-api-with-fastapi/lists"}