API Access

Get programmatic access to UK clock change data through our simple JSON API.

Endpoints

Recommended: Use v2.json for new integrations (improved structure with both upcoming changes, proper timezones, and current status). Use latest.json to always get the newest version, or v1.json for legacy support.

🎉 API v2 is here! The new version includes:

API v2 Example Response

{
  "api_version": "2.0",
  "generated_at": "2025-10-26T12:34:56Z",
  "timezone": "Europe/London",
  "current_offset": "+00:00",
  "current_timezone_name": "GMT",
  "in_daylight_saving": false,
  "next_change": {
    "date": "2026-03-29",
    "datetime_utc": "2026-03-29T01:00:00Z",
    "datetime_local": "2026-03-29T01:00:00+00:00",
    "type": "spring_forward",
    "days_until": 154,
    "offset_before": "+00:00",
    "offset_after": "+01:00",
    "timezone_name_before": "GMT",
    "timezone_name_after": "BST",
    "hour_change": 1
  },
  "upcoming_changes": [
    {
      "date": "2026-03-29",
      "datetime_utc": "2026-03-29T01:00:00Z",
      "datetime_local": "2026-03-29T01:00:00+00:00",
      "type": "spring_forward",
      "days_until": 154,
      "offset_before": "+00:00",
      "offset_after": "+01:00",
      "timezone_name_before": "GMT",
      "timezone_name_after": "BST",
      "hour_change": 1
    },
    {
      "date": "2026-10-25",
      "datetime_utc": "2026-10-25T01:00:00Z",
      "datetime_local": "2026-10-25T02:00:00+01:00",
      "type": "autumn_back",
      "days_until": 364,
      "offset_before": "+01:00",
      "offset_after": "+00:00",
      "timezone_name_before": "BST",
      "timezone_name_after": "GMT",
      "hour_change": -1
    }
  ]
}

API v2 Response Fields

Migration Guide (v1 → v2)

v1 Field v2 Equivalent Notes
version api_version Renamed for clarity
data.date next_change.datetime_utc Now includes actual time (01:00/02:00) with timezone
data.type next_change.type Values changed: "forward" → "spring_forward", "back" → "autumn_back"
data.days_until next_change.days_until Same functionality
data.change Removed Build your own UI text using the structured data
N/A upcoming_changes New: array of both spring and autumn changes
N/A current_offset, in_daylight_saving New: current timezone status

API v1 (Legacy)

Maintained for backward compatibility. New integrations should use v2.

{
  "data": {
    "change": "At 1:00am, clocks go forward to 2:00am",
    "date": "2026-03-29T00:00:00",
    "days_until": 142,
    "type": "forward"
  },
  "generated_at": "2025-11-07T01:30:11.164344",
  "version": "1.0"
}

Usage Examples (v2)

# Python import requests response = requests.get('https://whendotheclockschange.uk/api/v2.json') data = response.json() print(f"Currently in {data['current_timezone_name']}") print(f"Next change: {data['next_change']['type']} on {data['next_change']['date']}") print(f"Days until: {data['next_change']['days_until']}") # Show both upcoming changes for change in data['upcoming_changes']: print(f"{change['type']}: {change['date']} ({change['days_until']} days)")
// JavaScript fetch('https://whendotheclockschange.uk/api/v2.json') .then(response => response.json()) .then(data => { console.log(`Currently: ${data.current_timezone_name} (${data.current_offset})`); console.log(`In daylight saving: ${data.in_daylight_saving}`); console.log(`Next change: ${data.next_change.type} in ${data.next_change.days_until} days`); // Display both upcoming changes data.upcoming_changes.forEach(change => { console.log(`${change.type}: ${change.date}`); }); });
# curl curl https://whendotheclockschange.uk/api/v2.json # Or get v1 for legacy format curl https://whendotheclockschange.uk/api/v1.json

Notes

🔄

Caching

  • Cache responses for up to 12 hours
  • Use ETags for conditional requests
  • Implement exponential backoff
  • Handle errors gracefully
📊

Best Practices

  • Validate response data
  • Handle timezone differences
  • Monitor for updates
  • Keep client libraries updated
🛠️

Integration Tips

  • Use proper error handling
  • Implement request timeouts
  • Log API interactions
  • Test edge cases
Back to top