Skip to content
laluka

Demo workspace Tidewatch is a made-up tide API. The lessons are real laluka lessons about it. Your own repos arrive with sign-in.

The tides route allows at most 14 days per request

Origin: baselineStatus: confirmedRepo: tidewatch-apiWritten: 19 Sept 2026

What

GET /v1/stations/:id/tides takes from and an optional days. days defaults to 1 and must be a whole number from 1 to 14. An unknown station is 404, a bad days or from is 400.
Cites

Cites

  1. [1]src/routes.ts:4-13matchSupports: what
    [lines 4-13 of a 16-line file]
    const MAX_DAYS = 14;
    // GET /v1/stations/:id/tides?from=YYYY-MM-DD&days=N
    export function parseTideQuery(id: string, from: string, days: string | undefined) {
    const station = getStation(id);
    if (!station) return { status: 404 as const, error: `Unknown station: ${id}` };
    const n = days === undefined ? 1 : Number(days);
    if (!Number.isInteger(n) || n < 1 || n > MAX_DAYS) {
    return { status: 400 as const, error: `days must be a whole number from 1 to ${MAX_DAYS}` };
    }

Card

What does the tides route return for days=30?
junior
Show the answer
400 with the message that days must be a whole number from 1 to 14. MAX_DAYS is 14 in src/routes.ts.
Cites[1]