Countdown
What this does
Calculates how much time is left until a future moment (or how long ago a past moment was). Returns friendly breakdowns in days, hours, and minutes, plus total seconds. Pass the target as an ISO date-time.
Who it is for
- Launch countdown widgets
- “Days until bank holiday” displays
- Event reminders in internal tools
- Support macros (“incident started 2h 14m ago”)
Try it
Countdown to New Year 2027 (UTC):
https://fetch.li/v1/countdown?to=2027-01-01T00:00:00Z
UK-local midnight:
https://fetch.li/v1/countdown?to=2026-12-25T00:00:00+00:00
HTTP example
GET /v1/countdown?to=2027-01-01T00:00:00Z HTTP/1.1
Host: fetch.li
Accept: application/json
curl
curl -sS "https://fetch.li/v1/countdown?to=2027-01-01T00:00:00Z"
JavaScript fetch
const response = await fetch(
"https://fetch.li/v1/countdown?to=2027-01-01T00:00:00Z"
);
const countdown = await response.json();
console.log(countdown.human);
Python requests
import requests
response = requests.get(
"https://fetch.li/v1/countdown",
params={"to": "2027-01-01T00:00:00Z"},
)
response.raise_for_status()
print(response.json()["human"])
Example JSON response
{
"to": "2027-01-01T00:00:00.000Z",
"now": "2026-08-25T11:43:00.000Z",
"is_future": true,
"total_seconds": 10916620,
"days": 126,
"hours": 12,
"minutes": 17,
"human": "126 days, 12 hours, 17 minutes remaining"
}
For a past date, is_future is false and human reads “… ago”.
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
to |
Yes | string | Target instant in ISO 8601 format (UTC Z or offset) |
Errors that can happen
| HTTP | error.code |
When |
|---|---|---|
| 400 | invalid_body |
Missing or unparseable to |
| 429 | rate_limited |
Demo limit exceeded |
| 500 | internal |
Unexpected server error |
Demo
GET endpoints work without an API key on the public demo tier (60 calls per hour per IP). POST /v1/vibe/classify needs a key.