
Time Card Calculator API
Fill in a weekly timesheet with start and end times and breaks, including overnight shifts, and get daily and weekly hours, overtime and gross pay.
Send your API key as a Bearer token in the Authorization header (Authorization: Bearer YOUR_API_KEY), or in an X-API-Key header.
120 requests per minute
1 endpoint available
Overview
Turns a week of start and end times into worked hours, split into regular, overtime and double time, with optional gross pay. List the days in week order, up to 7. Each day has a start, an end and an unpaid break. A day with nothing in it is allowed and counts as 0 hours.
Times
- Times can be typed loosely:
9,930,5p,9:30 pm,17:45,9.30,noon,midnight. - Shifts that run past midnight are handled (
10pmto6is 8 hours). - With
guessAmPmtrue (the default), an end time with no am or pm is read the way that makes the shorter shift, so 9 to 5 is 8 hours, not 20. Break times are read as falling inside the shift. Set it to false if you send 24-hour times and want them taken literally. - Times in the response are 24-hour
HH:MM.
Breaks
Give breakMinutes (unpaid minutes), or breakStart and breakEnd, not both. The break must fit inside the shift.
Overtime
overtimePreset:none(default),ontario(44 h a week),us-federal(40 h a week),california(overtime after 8 h a day or 40 h a week, double time after 12 h a day; the seventh-consecutive-day rule is not included) orcustom. These are simplified and are not legal advice.- With
custom, set any ofdailyLimitHours,doubleTimeLimitHours(double time after this many hours in a day) andweeklyLimitHours. The limits only work withcustom. - Daily limits apply first. The weekly limit then counts only the hours still at the regular rate, in the order the days are listed, so an hour is never overtime twice.
Pay
If hourlyRate is above 0, pay has regular, overtime, double time and total in dollars, rounded half up to the cent. Overtime pays overtimeMultiplier (default 1.5) and double time doubleTimeMultiplier (default 2), to 3 decimal places. Otherwise pay is null.
Hours come as whole minutes (exact) and as decimal hours rounded to 2 places. A bad time or break returns a 400 error that names the day, like days[2]: "xx" isn't a time.
If you send startDate, the date of the first day, each day also gets its date and weekday.
Endpoints
https://opentools.ca/api/v1/tools/time-card-calculatorRequest Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| days | array | Required | Days in week order, 1 to 7. |
| days[].label | string | Optional | A label for the day, returned as sent. |
| days[].start | string | Optional | Start time, such as "9a" or "17:45". Leave start, end and breaks empty for a day off. |
| days[].end | string | Optional | End time. Needed when start is given. |
| days[].breakMinutes | number | Optional | Unpaid break in minutes, 0 to 1440. |
| days[].breakStart | string | Optional | Start of the unpaid break. Use with breakEnd. |
| days[].breakEnd | string | Optional | End of the unpaid break. Use with breakStart. |
| startDate | string | Optional | Date of the first day, YYYY-MM-DD. Adds a date and weekday to each day. |
| guessAmPm | boolean | Optional | Read times with no am or pm the way that gives the shorter shift.Default: true |
| overtimePreset | string Enum: ontario, us-federal, california, none, custom | Optional | Overtime rules to apply.Default: none |
| dailyLimitHours | number | Optional | custom only. Hours in a day before overtime. |
| doubleTimeLimitHours | number | Optional | custom only. Hours in a day before double time. |
| weeklyLimitHours | number | Optional | custom only. Regular hours in the week before overtime. |
| hourlyRate | number | Optional | Hourly pay in dollars. Adds pay to the response. |
| overtimeMultiplier | number | Optional | Pay multiplier for overtime hours.Default: 1.5 |
| doubleTimeMultiplier | number | Optional | Pay multiplier for double time hours.Default: 2 |
Response Example
{
"success": true,
"overtime": {
"preset": "california",
"dailyLimitHours": 8,
"doubleTimeLimitHours": 12,
"weeklyLimitHours": 40
},
"days": [
{
"day": 1,
"label": "Mon",
"date": "2026-11-23",
"weekday": "Monday",
"empty": false,
"start": "09:00",
"end": "17:30",
"overnight": false,
"breakStart": null,
"breakEnd": null,
"breakMinutes": 30,
"workedMinutes": 480,
"regularMinutes": 480,
"overtimeMinutes": 0,
"doubleTimeMinutes": 0,
"workedHours": 8,
"regularHours": 8,
"overtimeHours": 0,
"doubleTimeHours": 0
},
{
"day": 2,
"label": "Tue",
"date": "2026-11-24",
"weekday": "Tuesday",
"empty": false,
"start": "08:30",
"end": "18:00",
"overnight": false,
"breakStart": null,
"breakEnd": null,
"breakMinutes": 45,
"workedMinutes": 525,
"regularMinutes": 480,
"overtimeMinutes": 45,
"doubleTimeMinutes": 0,
"workedHours": 8.75,
"regularHours": 8,
"overtimeHours": 0.75,
"doubleTimeHours": 0
}
],
"totals": {
"breakMinutes": 75,
"workedMinutes": 1005,
"regularMinutes": 960,
"overtimeMinutes": 45,
"doubleTimeMinutes": 0,
"workedHours": 16.75,
"regularHours": 16,
"overtimeHours": 0.75,
"doubleTimeHours": 0
},
"hourlyRate": 28.5,
"pay": {
"regular": 456,
"overtime": 32.06,
"doubleTime": 0,
"total": 488.06
}
}Error Codes
Code Examples
# Two days with California overtime rules
curl -X POST https://opentools.ca/api/v1/tools/time-card-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"days": [
{
"label": "Mon",
"start": "9a",
"end": "5:30p",
"breakMinutes": 30
},
{
"label": "Tue",
"start": "8:30",
"end": "6p",
"breakMinutes": 45
}
],
"startDate": "2026-11-23",
"overtimePreset": "california",
"hourlyRate": 28.5
}'Rather use it in your browser? Open the Time Card Calculator