Documentation

API URL


GET /api/v1/weather/current

Headers
Code
Content-Type: application/json
Query Parameters


Example GET Request

Code
GET https://datpaq.com/api/v1/weather/current?api_key=your-api-key&lat=40.7128&lon=-74.0060

Successful Response

Status
HTML
200 OK
Body
Code
{
  "success": true,
  "location": {
    "lat": 40.7128,
    "lon": -74.006,
    "name": "New York, NY",
    "country": "US"
  },
  "timezone": "America/New_York",
  "offset": -4,
  "current": {
    "temperature": 72,
    "temperatureUnit": "fahrenheit",
    "apparentTemperature": 74.2,
    "humidity": 56,
    "dewPoint": 58.1,
    "pressure": 1013,
    "windSpeed": "12 mph",
    "windDirection": "NW",
    "windGust": "18 mph",
    "cloudCover": 40,
    "uvIndex": 3.5,
    "precipProbability": 10,
    "precipAmount": 0,
    "precipType": "rain",
    "condition": "Partly Cloudy",
    "icon": "https://example.com/icon.png"
  },
  "hourly": [
    {
      "time": "2026-06-26T13:00:00-04:00",
      "temperature": 74,
      "temperatureUnit": "fahrenheit",
      "apparentTemperature": 75.2,
      "precipProbability": 20,
      "precipType": "rain",
      "condition": "Chance Showers",
      "icon": "https://example.com/icon-hourly.png"
    }
  ],
  "forecast": [
    {
      "date": "2026-06-27",
      "high": 79,
      "low": 66,
      "temperatureUnit": "fahrenheit",
      "precipType": "rain",
      "condition": "Chance Showers",
      "icon": "https://example.com/icon-forecast.png"
    }
  ],
  "alerts": [
    {
      "title": "Flood Watch",
      "severity": "Moderate",
      "startsAt": "2026-06-26T10:00:00-04:00",
      "endsAt": "2026-06-27T02:00:00-04:00",
      "description": "Heavy rainfall may cause localized flooding.",
      "source": "nws"
    }
  ],
  "units": "fahrenheit",
  "sources": [
    {
      "provider": "nws",
      "available": true,
      "fromCache": false,
      "durationMs": 241
    },
    {
      "provider": "metno",
      "available": true,
      "fromCache": false,
      "durationMs": 190
    },
    {
      "provider": "openweather",
      "available": false,
      "fromCache": false,
      "durationMs": null,
      "error": "OpenWeather API key not configured"
    }
  ],
  "updatedAt": "2026-06-26T12:00:00.000Z",
  "degraded": false,
  "correlationId": "req_abc123"
}

Error Response

Example
Code
400 ValidationError - Invalid or missing query parameters: Request fails Joi validation before provider calls
401 AuthenticationError - Gateway authentication failure: Missing or invalid API credentials
404 NotFound - Unknown route path: Endpoint not found
429 RateLimitError - Limiter threshold exceeded: More than 120 requests in 15-minute window
500 InternalError - Unhandled runtime failure: Handler throws unexpected error with reason lookup-failed
503 ProviderUnavailable - Both providers unavailable: Provider-unavailable response with source diagnostics

Last Updated:  May 4, 2026