Tourism API Design for Attraction Opening Hours Exceptions
An attraction can appear open in a destination guide and still be impossible to visit on a chosen date. Weekly opening hours may be accurate for an ordinary Tuesday, yet wrong during a festival, a winter shutdown, or a public holiday. A reliable tourism api must therefore answer a date-specific question: when can this particular place receive visitors, and how certain is the answer?
This guide covers the publication of attraction hours for itinerary builders, destination websites, agency portals, and travel planning applications. It focuses on information about physical access, not inventory allocation or checkout. The design goal is to preserve what each source actually says, resolve overlapping schedules predictably, and explain uncertainty before a traveler commits a day to an attraction.
Define what opening hours actually describe
Keep the place, admission, and sales clocks separate
“Open” is an overloaded word in travel software. A museum building may welcome visitors from 10:00 until 18:00, stop admitting guests at 17:00, close its ticket counter at 16:30, and continue selling tickets online for next month after midnight. Those clocks support different decisions. Collapsing them into one start and end time creates false recommendations, particularly when a planner places the attraction near the end of a sightseeing day.
Define published place hours as the periods when the attraction reports that its visitor-facing premises operate. Define entry windows as times when a guest may enter, subject to ticket and operating rules. Define sale windows as periods when a channel accepts orders. A fourth concept, bookable inventory, represents actual ticket or capacity availability. It can be empty while the museum remains open.
Give each clock its own field, source, and interpretation. If a supplier provides opening hours but no admission cutoff, publish the hours and mark the cutoff unknown rather than substituting closing time. Likewise, a reservation system returning no tickets for a date does not establish that the venue is closed.
Distinguish operating status from a dated schedule
A permanently closed place should not appear as a normal visit option. A temporarily closed place may have no confirmed reopening date. Neither condition is equivalent to “closed on Monday.” Treat operational status as a separate dimension evaluated alongside the resolved schedule, with evidence and review requirements of its own. Status should not silently rewrite the weekly timetable or erase historical hours.
Build a schedule model that survives real calendars
Represent recurring periods, not a single daily string
Store a regular schedule as recurring local-day intervals keyed by an explicit timezone. Each interval needs a start, an end, and a visitor-access purpose. A Tuesday might contain two noncontiguous intervals; a Monday might be deliberately closed. Use an array even if most attractions have just one interval per day. That choice avoids a schema migration when a midday break or evening reopening appears.
Keep the raw upstream description alongside a normalized interpretation. “Daily 9–5” is useful evidence, but insufficient as a machine contract: it may exclude public holidays, refer to a ticket desk, or hide a lunch closure. Normalization should record whether these uncertainties were resolved. Never convert missing hours into a seven-day closed schedule; missing means unconfirmed, while an explicitly empty schedule means a verified closure for that scope.
Attach a stable attraction identifier, schedule identifier, local timezone, source attribution, validity boundaries, and a revision number. A change to the attraction’s name or location should not generate a new schedule silently. If the same physical museum exists under several suppliers’ IDs, preserve those source IDs as references to one canonical place, but do not merge conflicting time assertions without recording their origins.
Add seasons as dated rules, not vague labels
Seasonality often means more than longer summer evenings. Attractions can close for restoration, switch to weekends only, or open different wings in different months. Represent each seasonal rule with explicit effective dates and its own weekly intervals or a full-closure instruction. A phrase such as “winter hours” can remain as display text, but a processor should not guess the start of winter from geography.
Make the ends of seasonal date ranges unambiguous. Inclusive local dates are natural for an editorial interface; internally, a half-open interval from the first local midnight to the midnight after the final date simplifies overlap checks. Store whether a seasonal schedule replaces the baseline or modifies only identified days. Otherwise a weekend-only winter rule could accidentally preserve weekday hours from the summer baseline.
Apply dated exceptions with deterministic precedence
Model holidays, closures, and one-off extensions
Dated exceptions are instructions tied to local calendar dates, not alternative names for the weekly timetable. They cover public holidays, special events, staff closures, emergency maintenance, and one-day extended hours. An exception should contain an effective date, a typed action, zero or more replacement intervals, an explanation suitable for travelers, and source evidence. Zero intervals with a confirmed closure action mean closed; a missing intervals property does not.
For predictable resolution, use a published precedence policy. A verified emergency closure or suspended operational status blocks visits first. An explicit date exception then overrides the applicable seasonal rule; the seasonal rule overrides the baseline weekly timetable. If two exceptions overlap with equal authority, do not arbitrarily select the latest database row. Flag the conflict, retain both assertions, and require a resolution or source priority rule.
Exceptions must specify whether they replace all intervals for that date or modify one interval. This matters for split-hour venues: a temporary closure of the morning gallery should not automatically cancel a separately confirmed evening event. For public visitor hours, full-date replacement is usually the safest default when a provider supplies only a special-day schedule, but that assumption must be documented and testable.
A holiday name is not itself a closure rule. Local holidays may change by region, and some museums extend their hours during celebrations. Holiday calendars can trigger a recheck, never an automatic “closed” state without authoritative evidence. If one provider says “Christmas hours may differ” and another supplies exact times, keep the warning and the times with their respective confidence instead of converting the warning into a false closure.
Make exception resolution explainable
A trip planner needs the final intervals for the requested local date, but editors need to know why those intervals won. Return a compact resolution trail: baseline rule, matching season, matching exception, chosen version, and reason code. An explanation such as “holiday schedule replaced regular Thursday hours” is more actionable than a bare boolean. The trail also makes support tickets reproducible after another feed update changes the displayed answer.
Handle split hours, midnight crossings, and time zones
A single calendar day can have more than one visitor interval. Represent 09:00–12:00 and 14:00–18:00 as separate periods, never as 09:00–18:00 with a note about lunch. Availability checks must test the traveler’s intended arrival and estimated visit duration against the appropriate interval. A visit scheduled across the closed gap should be rejected or explicitly split only if the attraction permits re-entry.
Overnight opening is another common parsing trap. A venue open Friday 20:00 until Saturday 02:00 has one continuous interval crossing midnight, not a negative-length Friday interval. Associate the operational period with both local date-time endpoints and the applicable timezone. A search for Saturday 01:00 must recognize that it belongs to Friday’s overnight operation, while Saturday evening may follow a different rule.
Use an IANA timezone identifier such as Europe/London, rather than assuming the city always has one fixed UTC offset. Offset changes around daylight-saving transitions can make some local times nonexistent or repeated. Establish a policy for ambiguous timestamps, preserve original local notation, and convert to instants only with a known timezone. Do not construct “tomorrow at 00:00 UTC” as a substitute for local midnight.
Exception logic must also consider intervals that began yesterday. A Saturday emergency closure may cancel an overnight Friday interval extending into Saturday, depending on the provider’s stated scope. The safest model distinguishes a local-date exception from an instant-bounded closure and records how it interacts with crossing periods. Test the previous day, the target day, and the following day together.
Interpret external place data without overclaiming
External place services can enrich attraction records, but their fields do not replace a complete editorial calendar. Google’s Places API Place resource reference distinguishes regularOpeningHours from currentOpeningHours. The latter describes the next seven days, including special hours when available. That horizon is not a promise of accurate exceptions for every date a traveler might choose months ahead.
The same reference describes opening-hour periods, localized weekdayDescriptions, and specialDays. A special day identifies a date affected by exceptional hours; it is not a self-contained explanation of why the hours changed. The documentation also warns that period ordering need not match the localized weekday-description ordering, and that current periods can be truncated at the seven-day response boundary. Normalize from structured endpoints, not display-string positions.
Google’s Place Data Fields documentation lists the available fields and their request implications. It requires a field mask and identifies opening-hours fields separately from other place attributes. Request only fields needed for the feature, check applicable billing and usage terms, and preserve any required attribution. Field availability is not proof that a venue has supplied complete or current hours.
Worked hypothetical example: a museum holiday calendar
Consider the fictional Harbor Lantern Museum in London. The following dates, rules, and ticket arrangements are invented solely to demonstrate a tourism api design; they are not operational information about a real attraction. Its baseline visiting schedule is Tuesday through Sunday, 10:00–18:00, with Mondays closed. The museum publishes Christmas Eve shortened hours, a Christmas Day closure, and a Boxing Day late opening. It also announces a January maintenance shutdown.
Its fictional December 24, 2026 place hours are 10:00–14:00. Online sales for a December 24 ticket end at 12:00, and the final permitted admission is 13:00. Someone holding a valid ticket may therefore enter at 12:45, but a customer attempting to purchase that ticket at 12:30 cannot complete the transaction through that sales channel. The physical premises remain open until 14:00. None of these three boundaries should overwrite the others.
On December 25 the museum is closed to visitors, although its online shop can still sell tickets for later dates. On December 26 it opens 12:00–17:00 with a last entry at 15:30; online ticket purchases for that visit date stop at 15:00. From January 5 through January 31, 2027, a confirmed seasonal shutdown replaces ordinary opening days. The closure has its own evidence, rather than being derived from the lack of ticket slots.
| Local date | Published place hours | Entry cutoff | Sales for that date | Resolution |
|---|---|---|---|---|
| Thu 24 Dec 2026 | 10:00–14:00 | 13:00 | Until 12:00 | Dated holiday exception |
| Fri 25 Dec 2026 | Closed | None | Not sold for visits that day | Dated holiday closure |
| Sat 26 Dec 2026 | 12:00–17:00 | 15:30 | Until 15:00 | Dated holiday exception |
| 5–31 Jan 2027 | Closed throughout | None | Not sold for visits in range | Seasonal maintenance closure |

The resolver first selects the museum’s London timezone and interprets the requested visit date there. It loads the baseline weekly rule, checks matching seasonal rules, then applies the more specific dated holiday exception. For December 24, the result is one place interval ending at 14:00. A separate admission rule caps entry at 13:00; the online channel rule ends sales at noon. Their independently labeled outputs prevent an apparently open museum from being mistaken for a ticket still on sale.
Suppose an itinerary suggests arrival at 13:20 on December 24 with a planned 50-minute visit. The intended visit overlaps the open period, but the arrival misses the museum’s admission cutoff. The planner should label the proposed stop “entry not permitted at this arrival time,” even though the doors are not scheduled to close until 14:00. It can suggest a time before 13:00, subject to admission and ticket conditions, rather than claiming the attraction is closed all afternoon.
Now suppose an operator revises December 26 to close completely after the itinerary was saved. That is a new dated exception, not an edit to generic Saturday hours. The schedule version changes, the saved stop becomes affected, and the customer-facing message states that the date-specific opening information changed. Any paid booking requires its own supplier confirmation; the itinerary service must not silently cancel or refund a ticket based only on a place-hours update.
Track provenance, freshness, and verification evidence
Separate observation from confirmation
Every schedule assertion should identify where it came from: attraction website, official notice, contracted content supplier, editor, or external place service. Preserve source identifiers, retrieval timestamps, source publication timestamps when given, evidence links, the exact affected fields, and the transformation performed. A screenshot or archived source extract may be appropriate where retention and licensing allow it. Do not represent a secondary aggregator as a direct operator statement.
Use distinct fields for last_observed_at, last_verified_at, and published_at. Observation means the integration fetched data. Verification means a specified authority or review process confirmed the claim and its scope. Publication means the platform made a particular schedule version visible. An API call returning HTTP success updates observation status, not necessarily verification, especially when dates are absent or contradictory.
Evidence also needs an expiration or review policy. A confirmed exception for an upcoming public holiday may need another check as the date approaches, while a historic closure can remain as a past record. Define age thresholds by attraction importance, date proximity, and source reliability; avoid pretending that one global freshness number is suitable for every destination. Record when thresholds were evaluated and why a record was escalated.
Show uncertainty without creating false precision
Expose states such as confirmed, provisional, conflicting, and unknown. They are editorial confidence labels, not probabilities invented by an algorithm. A verified full-day closure should produce “Closed” with its effective date. A missing upcoming holiday schedule should produce “Hours not yet confirmed,” possibly with regular hours shown as context but never presented as guaranteed holiday hours.
Design provider updates as an auditable workflow
Ingestion starts with source-specific adapters that fetch relevant fields, validate shape, and produce normalized candidate rules. Store the original payload reference and a versioned canonical representation. Compare semantic intervals rather than raw text, because localized strings and irrelevant metadata may change without affecting operating hours. Deduplicate retried messages using provider identifiers, source revision values where available, and stable content fingerprints.
A change detector should classify updates as added exception, modified interval, removed exception, closure, reopening, or ambiguous change. The distinction matters: removing a previously supplied closure does not prove the museum is open unless the remaining published rule is authoritative for that date. Maintain the previous accepted version while a high-impact conflict is reviewed. Retain an audit trail showing the editor or process responsible for release.
After acceptance, recompute the affected date range, invalidate dated caches, and refresh search indexes and itinerary projections. Send events to dependent systems with attraction ID, affected local dates, previous and new schedule revisions, and a reason. Consumers should process these events idempotently and retrieve authoritative details rather than relying on an incomplete notification payload. For multi-day closures, expand the impact window sufficiently to catch overnight intervals crossing its edges.
Escalation should be proportional to traveler impact. A newly confirmed closure tomorrow warrants faster review than a revised weekday description for next year. Flag saved itineraries, upcoming paid visits, and prominently recommended attractions for prioritized handling. Route discrepancies between official notices and third-party feeds to a designated reviewer; document the decision and its supporting evidence before an override becomes public.
When schedule changes affect customers, notify through the channel authorized for itinerary updates, identify the exact stop and date, and provide an action such as replan or contact the booking provider. Never imply that an information update automatically changes a reservation. Monitor delivery failures and unresolved review queues so escalation does not end with a message that nobody reads.
One safeguard is to keep resolver output stable when a supplier changes labels. Renaming a holiday from ‘special hours’ to ‘festival hours’ should update explanatory text, not the actual interval if its date and endpoints are unchanged. Conversely, moving the final admission cutoff from 16:30 to 16:00 is operationally meaningful even when the building closes at the same time. Version these clocks independently so downstream systems can identify exactly which traveler decision is affected.
Publish date-aware responses that planners can trust
A practical endpoint can accept attraction ID, visit local date, language, and optionally planned arrival and duration. Return resolved place intervals, the timezone, closure or uncertainty status, applicable exception reason, source reference, schedule version, and verification metadata permitted for display. Admission and sales rules should appear in separately named objects only when their sources support them. Booking inventory belongs behind a separate availability check.
Document the contract’s null behavior. An absent schedule means no supported assertion; an explicit empty interval list with closed_confirmed means a confirmed closure. An admission cutoff of null means unknown, not equal to the building closing time. Responses should also state the requested local date because a timezone conversion error can otherwise make a correct interval look attached to the wrong day.
Cache by attraction, local date, schedule version, and any output-changing context. Do not cache a seven-day provider snapshot as a permanent year-round calendar. Define a stale-data strategy: return previously confirmed information with a warning where appropriate, or suppress a recommendation when the risk of a wrong visit is high. Downstream trip planners should never remove stale warnings merely because a response arrived with HTTP success.
Test failure modes before publishing at scale
Build fixtures for recurring schedules, seasonal replacements, one-off closures, shortened public holidays, multiple intervals, overnight spans, and daylight-saving transitions. Assert the resolved intervals, rationale, confidence state, and affected itinerary dates. Tests should include an unknown schedule and a confirmed empty schedule to ensure the system never confuses missing evidence with closure. Add boundary assertions at opening, closing, final-entry, and sale cutoff times.
Validate provider updates that arrive out of order, duplicate the same rule, or retract an exception. Check that a newer but less authoritative feed cannot silently erase an official closure. Test a period truncated by an upstream seven-day window, and ensure the application does not infer a complete operating day from it. Confirm that locale-specific weekday text never drives machine calculations when structured intervals are available.
Acceptance criteria should cover operations as well as parsing. Editors must be able to inspect evidence and override decisions with reasons. A change to tomorrow’s hours must invalidate date-scoped caches and identify saved plans that depend on it. A museum whose online tickets sell out must remain marked open when the place schedule says so. A stale unknown holiday must never display as an unqualified normal day.
Make schedule integrity part of the travel experience
Reliable attraction content comes from preserving distinctions: typical hours versus dated exceptions, seasonal shutdowns versus routine closed days, public access versus entry permission, and opening information versus ticket sales. The underlying tourism api should resolve those distinctions into a calendar answer that a traveler can understand and an operator can audit. It should also be willing to say “not confirmed” when evidence does not support a stronger statement.
