API Access

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

Endpoints

Use latest.json to always get the newest version, or v1.json for guaranteed stability.

Example Response

{
  "data": {
    "change": "At 2:00am, clocks go back to 1:00am",
    "date": "2025-10-26T00:00:00",
    "days_until": 182,
    "type": "back"
  },
  "generated_at": "2025-04-27T13:06:33.189773",
  "version": "1.0"
}

Response Fields

Usage Examples

# Python import requests response = requests.get('https://whendotheclockschange.uk/api/latest.json') data = response.json() print(f"Next clock change: {data['data']['change']}")
// JavaScript fetch('https://whendotheclockschange.uk/api/latest.json') .then(response => response.json()) .then(data => console.log(`Next clock change: ${data.data.change}`));
# curl curl https://whendotheclockschange.uk/api/latest.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