{"id":32481059,"url":"https://github.com/cmandersen/dmi-proxy","last_synced_at":"2026-07-13T07:31:44.974Z","repository":{"id":320845164,"uuid":"1083192319","full_name":"cmandersen/dmi-proxy","owner":"cmandersen","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-11T10:15:50.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-11T12:14:16.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmandersen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T14:27:03.000Z","updated_at":"2026-04-11T10:15:56.000Z","dependencies_parsed_at":"2025-10-26T10:08:25.876Z","dependency_job_id":"d4801f48-e3ab-42ac-8995-713313dd84c0","html_url":"https://github.com/cmandersen/dmi-proxy","commit_stats":null,"previous_names":["cmandersen/dmi-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cmandersen/dmi-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmandersen%2Fdmi-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmandersen%2Fdmi-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmandersen%2Fdmi-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmandersen%2Fdmi-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmandersen","download_url":"https://codeload.github.com/cmandersen/dmi-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmandersen%2Fdmi-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35414732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-27T02:24:06.270Z","updated_at":"2026-07-13T07:31:44.967Z","avatar_url":"https://github.com/cmandersen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DMI Weather API\n\nA Laravel-based proxy API for the Danish Meteorological Institute (DMI) weather data services. This API provides a clean, RESTful interface to access current weather conditions, forecasts, and historical weather data for locations across Denmark.\n\n## Features\n\n-   **Current Weather**: Real-time weather observations from DMI weather stations\n-   **Weather Forecasts**: Up to 72 hours of forecast data\n-   **Historical Data**: Access to historical weather records with flexible time resolutions\n-   **Automatic Wind Chill**: Calculated and included when conditions meet criteria (≤10°C, \u003e1.3 m/s wind)\n-   **Smart Geocoding**: Support for city names, postal codes, and coordinates with caching\n-   **Response Caching**: Configurable cache durations for optimal performance\n\n## Requirements\n\n-   PHP 8.3+\n-   Composer\n-   DMI API Keys (Climate, MetObs, and Forecast)\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/cmandersen/dmi-proxy.git\ncd dmi-proxy\n```\n\n2. Install dependencies:\n\n```bash\ncomposer install\n```\n\n3. Copy the environment file and configure:\n\n```bash\ncp .env.example .env\n```\n\n4. Generate application key:\n\n```bash\nphp artisan key:generate\n```\n\n5. Configure your DMI API keys in `.env`:\n\n```env\nDMI_CLIMATE_KEY=your_climate_api_key\nDMI_METOBS_KEY=your_metobs_api_key\nDMI_FORECAST_KEY=your_forecast_api_key\n```\n\n6. (Optional) Configure cache TTL values:\n\n```env\nDMI_CACHE_CURRENT=300        # 5 minutes\nDMI_CACHE_FORECAST=1800      # 30 minutes\nDMI_CACHE_HISTORICAL=86400   # 24 hours\nDMI_CACHE_GEOCODING=86400    # 24 hours\n```\n\n7. Cache Danish cities for faster geocoding:\n\n```bash\nphp artisan weather:cache-cities\n```\n\n## Usage\n\nStart the development server:\n\n```bash\nphp artisan serve\n```\n\nVisit the API documentation at `http://localhost:8000`\n\n### API Endpoints\n\n#### Get Current Weather\n\n```http\nGET /api/weather/current/{location}\n```\n\n**Parameters:**\n\n-   `location` (path): City name, postal code, or coordinates (lat,lon)\n-   `parameters` (query, optional): Array of parameters to include (`temperature`, `humidity`, `wind`, `pressure`)\n\n**Example:**\n\n```bash\ncurl http://localhost:8000/api/weather/current/copenhagen\n```\n\n#### Get Forecast\n\n```http\nGET /api/weather/forecast/{location}\n```\n\n**Parameters:**\n\n-   `location` (path): City name, postal code, or coordinates\n-   `hours` (query, optional): Number of hours to forecast (1-72, default: 48)\n\n**Example:**\n\n```bash\ncurl http://localhost:8000/api/weather/forecast/aarhus?hours=24\n```\n\n#### Get Historical Weather\n\n```http\nGET /api/weather/historical/{location}\n```\n\n**Parameters:**\n\n-   `location` (path): City name, postal code, or coordinates\n-   `from` (query, required): Start date (YYYY-MM-DD)\n-   `to` (query, required): End date (YYYY-MM-DD)\n-   `resolution` (query, optional): Time resolution (`hour`, `day`, `month`, `year`, default: `day`)\n-   `parameters` (query, optional): Array of parameters (`temperature`, `precipitation`, `wind`, `humidity`, `sunshine`)\n\n**Example:**\n\n```bash\ncurl \"http://localhost:8000/api/weather/historical/odense?from=2024-01-01\u0026to=2024-01-31\u0026resolution=day\"\n```\n\n## Testing\n\nRun the test suite:\n\n```bash\nphp artisan test\n```\n\nRun specific tests:\n\n```bash\nphp artisan test --filter=WeatherControllerTest\n```\n\nThe project includes 68 tests covering:\n\n-   Unit tests for services and transformers\n-   Feature tests for API endpoints\n-   Wind chill calculation tests\n-   Geocoding service tests\n\n## Code Formatting\n\nThis project uses Laravel Pint for code formatting:\n\n```bash\nvendor/bin/pint\n```\n\n## Project Structure\n\n```\napp/\n├── Actions/          # Reusable action classes\n│   └── Dawa/        # Danish Address Web API integrations\n├── Console/\n│   └── Commands/    # Artisan commands\n├── DTOs/            # Data Transfer Objects\n├── Enums/           # Validation enums\n├── Exceptions/      # Custom exceptions\n├── Http/\n│   ├── Controllers/\n│   │   └── Api/     # API controllers\n│   └── Requests/\n│       └── Api/     # Form request validation\n└── Services/        # Business logic services\n    ├── Location/    # Geocoding services\n    └── Weather/     # Weather data services\n```\n\n## Wind Chill Calculation\n\nWind chill is automatically calculated using the North American and UK wind chill index formula when:\n\n-   Temperature is at or below 10°C\n-   Wind speed is above 1.3 m/s (4.68 km/h)\n\nFormula:\n\n```\nWind Chill (°C) = 13.12 + 0.6215T - 11.37V^0.16 + 0.3965TV^0.16\n\nWhere:\n  T = Air temperature (°C)\n  V = Wind speed (km/h)\n```\n\n## Cache Management\n\nThe API implements intelligent caching:\n\n-   **Current weather**: 5 minutes (configurable)\n-   **Forecast data**: 30 minutes (configurable)\n-   **Historical data**: 24 hours (configurable)\n-   **Geocoding results**: 24 hours (configurable)\n\nClear all caches:\n\n```bash\nphp artisan cache:clear\n```\n\n## Credits\n\n-   Weather data provided by [Danish Meteorological Institute (DMI)](https://www.dmi.dk/)\n-   Geocoding powered by [DAWA (Danish Address Web API)](https://dawadocs.dataforsyningen.dk/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmandersen%2Fdmi-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmandersen%2Fdmi-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmandersen%2Fdmi-proxy/lists"}