Developer API

TimeLocal API

Access time, timezone, and holiday data through our simple REST API. Free to use with generous rate limits.

Fast & Reliable
Global CDN with edge caching for sub-100ms responses worldwide
Free Tier
100 requests/day without API key, 1000/day with free API key
Easy Integration
RESTful JSON API with CORS support for browser and server apps
Base URL
https://timelocal.com/api/v1

All endpoints return JSON. Include x-api-key header for higher rate limits.

Endpoints

GET/api/v1/time
Get current time for any timezone or city

Parameters

NameTypeRequiredDescription
timezonestringOptionalIANA timezone (e.g., America/New_York)
citystringOptionalCity name or slug
GET /api/v1/time?timezone=America/New_York
GET/api/v1/cities
Search and list cities with time zones

Parameters

NameTypeRequiredDescription
qstringOptionalSearch query for city name
countrystringOptionalFilter by country
timezonestringOptionalFilter by timezone
limitnumberOptionalResults per page (max 100)
offsetnumberOptionalPagination offset
GET /api/v1/cities?q=new+york&limit=5
GET/api/v1/holidays
Get holidays by year, month, or country

Parameters

NameTypeRequiredDescription
yearnumberOptionalYear (defaults to current)
monthnumberOptionalMonth (1-12)
countrystringOptionalFilter by country
typestringOptionalHoliday type filter
upcomingbooleanOptionalOnly show future holidays
GET /api/v1/holidays?upcoming=true&limit=5
GET/api/v1/convert
Convert time between timezones

Parameters

NameTypeRequiredDescription
fromstringOptionalSource timezone (defaults to UTC)
tostringRequiredTarget timezone
datetimestringOptionalISO datetime to convert
GET /api/v1/convert?from=America/New_York&to=Europe/London

Code Examples

// Get current time in Tokyo
const response = await fetch('https://timelocal.com/api/v1/time?city=tokyo');
const data = await response.json();
console.log(data.local_datetime); // "2024-03-15T19:30:45"

// Convert time between zones
const convert = await fetch(
  'https://timelocal.com/api/v1/convert?from=America/New_York&to=Asia/Tokyo'
);
const result = await convert.json();
console.log(result.difference.description);

// Search cities
const cities = await fetch('https://timelocal.com/api/v1/cities?q=london');
const cityData = await cities.json();
cityData.cities.forEach(city => {
  console.log(`${city.name}: ${city.current_time}`);
});
Rate Limits

Free (No API Key)

100

requests per day

With API Key

1,000

requests per day

Rate limit info is returned in response headers: X-RateLimit-Remaining and X-RateLimit-Reset. Contact us for enterprise plans with higher limits.

Need Higher Limits?

Contact us for enterprise API access with custom rate limits and SLA guarantees.

Contact Us