Task 1: API Analysis

Interactive API documentation and testing environment

API Documentation

Error Code Description HTTP Status Response Format
400 Bad Request 400
{
    "code": "400",
    "message": "Invalid parameters",
    "parameters":"List of all parameters names that are missing or incorrect will be 
returned in `parameters`attribute of the `ErrorResponse` object." }
401 Unauthorized 401
{
    "code": "401",
    "message": "Invalid API key",
    "error": "You must add API token with granted access to the product to the request before returning it."
}
                                    
404 Not Found 404
{
    "code": "404",
    "message": "Not found",
    "error": "Data with requested parameters (lat, lon, date etc) does not exist in service database."
}
                                    
429 Rate Limit Exceeded 429
{
    "code": "429",
    "message": "Too many requests",
    "error": "Rate limit exceeded, please retry request after some time or extend your key quote",
}
                                    
500 Internal Server Error 500
{
    "cod": "500",
    "message": "Internal server error",
    "error": "Server encountered an unexpected condition, 
reach out to contact our support team at help@sunnydaysanalytics.com." }

Common Error Scenarios

Authentication Issues

  • Missing API key parameter (appid)
  • Expired or revoked API key
  • Insufficient permissions for requested resource

Request Validation

  • Missing required parameters
  • Invalid parameter formats
  • Parameter values out of bounds
  • Invalid coordinate ranges

Rate Limiting

The API implements rate limiting with the following quotas:

  • Free tier: 1000 requests per day
  • Paid tiers: Higher quotas based on plan
  • Rate limit reset occurs at midnight UTC

Mid-day temperatures Quick Start

To retrieve mid-day temperatures for a specific location, follow these steps:

  1. Get coordinates using the Geocoding endpoint
  2. Use coordinates with the Day Summary endpoint
  3. Push results to your data store using Zapier webhook

Example Workflow

For Limerick, Ireland:

  1. Get coordinates:
    GET https://api.openweathermap.org/data/2.5/weather?q=Limerick&appid=YOUR_API_KEY
                            
  2. Get mid-day temperature:
    GET https://api.openweathermap.org/data/3.0/onecall/day_summary?lat=52.6647&lon=-8.6231&units=metric&date=2025-06-01&appid=YOUR_API_KEY
                            
  3. Push to Zapier webhook:
    POST https://hooks.zapier.com/hooks/catch/11168475/ubwse9b/?date=2025-06-01&temp=16.14
                            

Response Formats

Geocoding Response

{
    "lat": 53.3498,
    "lon": -6.2603,
    "tz": "+01:00",
    "date": "2025-06-01",
    "units": "metric",
    "cloud_cover": {
        "afternoon": 75
    },
    "humidity": {
        "afternoon": 76
    },
    "precipitation": {
        "total": 0.36
    },
    "temperature": {
        "min": 10.61,
        "max": 17.79,
        "afternoon": 16.14,
        "night": 12.12,
        "evening": 17.23,
        "morning": 11.8
    },
    "pressure": {
        "afternoon": 1009
    },
    "wind": {
        "max": {
            "speed": 10.29,
            "direction": 280
        }
    }
}
                        

Day Summary Response

{
    "lat": 52.6647,
    "lon": -8.6231,
    "tz": "+01:00",
    "date": "2025-06-01",
    "units": "metric",
    "cloud_cover": {
        "afternoon": 75
    },
    "humidity": {
        "afternoon": 76
    },
    "precipitation": {
        "total": 0.36
    },
    "temperature": {
        "min": 10.61,
        "max": 17.79,
        "afternoon": 16.14,
        "night": 12.12,
        "evening": 17.23,
        "morning": 11.8
    },
    "pressure": {
        "afternoon": 1009
    },
    "wind": {
        "max": {
            "speed": 10.29,
            "direction": 280
        }
    }
}
                        

Zapier Webhook Integration

To store the results in a Google Sheet, use the Zapier webhook endpoint:

https://hooks.zapier.com/hooks/catch/11168475/ubwse9b/?date={YYYY-MM-DD}&temp={decimal}

This endpoint will automatically create a new row in the Google Sheet with the date and temperature data.

View the stored data in the Google Sheet here.


Weather Dashboard

7 day Forecast

  • Weather Forecast
  • Rain Outlook
  • Sunrise/Sunset
  • Wind Speed

Weather Forecast

API GET calls provide a human readable weather summary for tomorrow's forecast.

GET https://api.openweathermap.org/data/3.0/onecall/overview?lat={lat}&lon={lon}&unit=metric&date={tomorrow}&appid={API key}
                

Rain Outlook


Sunrise/Sunset

Wind Speed

© 2025 Dom Crosbie. All rights reserved.