XooCode(){

TrainTrip

TrainTrip is a Trip subtype for rail journeys. It has 6 properties of its own: departureStation and arrivalStation (TrainStation objects), departurePlatform and arrivalPlatform (text), trainName (service name), and trainNumber (service number). All Trip properties apply: departureTime, arrivalTime, offers, provider. TrainTrip is the reservationFor target in TrainReservation.

The type hierarchy is Thing → Intangible → Trip → TrainTrip. Google reads TrainTrip in Gmail booking confirmations to show a train ticket card with departure/arrival stations, times, and platform numbers.

Full example of schema.org/TrainTrip json-ld markup

The markup is verified as valid with Rich Results Test from Google.

Highlight legend:Required by GoogleRecommendedOptional
schema.org/TrainTrip
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@id": "https://amtrak.com/trips/NEC171-2026-11-13#trip",
  "@type": "TrainTrip",
  "trainName": "Northeast Regional",
  "trainNumber": "NEC 171",
  "departureStation": {
    "@type": "TrainStation",
    "name": "New York Penn Station",
    "address": { "@type": "PostalAddress", "addressLocality": "New York", "addressRegion": "NY", "addressCountry": "US" }
  },
  "arrivalStation": {
    "@type": "TrainStation",
    "name": "Scranton Intermodal Transportation Center",
    "address": { "@type": "PostalAddress", "addressLocality": "Scranton", "addressRegion": "PA", "addressCountry": "US" }
  },
  "departureTime": "2026-11-13T06:30:00-05:00",
  "arrivalTime": "2026-11-13T10:15:00-05:00",
  "departurePlatform": "Platform 7",
  "provider": { "@type": "Organization", "name": "Amtrak" },
  "offers": { "@type": "Offer", "price": "67.00", "priceCurrency": "USD", "availability": "https://schema.org/InStock" }
}
</script>

departureStation and arrivalStation

Both take TrainStation objects with name and optionally address. Google uses the station names to display the route on the ticket card. Include at least the name; add address for stations in less well-known locations.

trainName and trainNumber

trainName is the service name ("Northeast Regional", "Eurostar", "Shinkansen Nozomi"). trainNumber is the service number ("NEC 171", "ES 9023"). Some rail systems use both, some only one. Include whichever the operator uses on the ticket.

Minimal valid version

The smallest markup that still produces a valid TrainTrip entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/TrainTrip (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "TrainTrip",
  "trainNumber": "NEC 171",
  "departureStation": { "@type": "TrainStation", "name": "New York Penn Station" },
  "arrivalStation": { "@type": "TrainStation", "name": "Scranton Intermodal" },
  "departureTime": "2026-11-13T06:30:00-05:00"
}
</script>

Google rich results this unlocks

Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.

Common TrainTrip mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    Station as a string instead of TrainStation

    Wrong
    "departureStation": "Penn Station"
    Right
    "departureStation": { "@type": "TrainStation", "name": "New York Penn Station" }

    departureStation and arrivalStation expect TrainStation objects. A structured object lets Google match the station to its knowledge graph entry and show the location on a map.

  2. 02

    Missing departureTime

    Wrong
    TrainTrip with stations but no times
    Right
    "departureTime": "2026-11-13T06:30:00-05:00"

    A trip without departure time is not actionable. Gmail needs the time to build the ticket card timeline. Include timezone offset since rail routes may cross time zones.

About the example data

A train from New York to Scranton for an XooCon attendee arriving by rail. This is the TrainTrip entity that the TrainReservation stub references.

Comments

Loading comments...

Leave a comment