Programmatically create and manage countdown timers with the SnapTimers API.
Create an API key from your account settings. API access is available on Pro, Business, and Enterprise plans.
Include your API key in the Authorization header:
curl https://www.snaptimers.com/api/v1/timers \
-H "Authorization: Bearer st_your_api_key_here"All API requests require authentication using your API key. Include it in the request headers:
Authorization: Bearer st_your_api_key_hereAlternatively, you can use the X-API-Key header.
API requests are rate limited to ensure fair usage:
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
/api/v1/timerstimers:readList all timers
/api/v1/timerstimers:writeCreate a new timer
/api/v1/timers/:idtimers:readGet timer details
/api/v1/timers/:idtimers:writeUpdate a timer
/api/v1/timers/:idtimers:writeDelete a timer
/api/v1/timers/:id/analyticsanalytics:readGet timer analytics
/api/v1/usageusage:readGet usage statistics
/api/v1/timersCreate a new countdown timer with custom styling.
const response = await fetch('https://www.snaptimers.com/api/v1/timers', {
method: 'POST',
headers: {
'Authorization': 'Bearer st_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Flash Sale Timer',
type: 'fixed',
targetDate: '2024-12-25T00:00:00Z',
timezone: 'America/New_York',
template: 'bold',
colors: {
background: '#1a1a2e',
text: '#ffffff',
accent: '#ff6b6b',
},
}),
});
const { data } = await response.json();
console.log(data.embedUrl);
// https://cdn.snaptimers.com/t/abc-123.gifAll responses are JSON and follow this structure:
{
"data": {
"id": "abc-123-def-456",
"name": "My Timer",
"type": "fixed",
"status": "active",
"targetDate": "2024-12-25T00:00:00Z",
"viewCount": 1542,
"embedUrl": "https://cdn.snaptimers.com/t/abc-123.gif",
"embedCode": "<img src=\"...\" alt=\"Countdown Timer\" />"
}
}Errors return appropriate HTTP status codes with details:
{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key"
}
}401Invalid or missing API key403Insufficient permissions or plan404Resource not found429Rate limit exceededAPI access is available on Pro, Business, and Enterprise plans.