APIDataTravel

Trenitalia train search API

Use the Trenitalia train search API to retrieve trip options, journey segments and endpoints, duration information, clock-change records, train records and quoted price as structured JSON from Trenitalia. Supply origin and destination in the query; optionally select date, departure offset in days and sort option to set the requested scope. Use these results to compare journey options for the selected route and dates before choosing a travel itinerary. For sort option, choose departure / arrival / fastest. Continue with the returned next_offset as offset; a null value marks the last page. The detail page includes parameter definitions, paired request and response examples, and usage pricing for this operation.

Selected price
$0.002 / billing creditPublished pricing
Sellers / APIs
1 / 1
Requests · 30d
—Loading...
Success rate · 30d
—Loading...
USE THIS API

Trenitalia train search API

Prepare your request, then continue with your agent.

Pricing

$0.002 / billing credit

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Provider
Pricing
Connect your agent
On this page

Overview

Overview

Trenitalia train search API

Use the Trenitalia train search API to retrieve trip options, journey segments and endpoints, duration information, clock-change records, train records and quoted price as structured JSON from Trenitalia. Supply origin and destination in the query; optionally select date, departure offset in days and sort option to set the requested scope. Use these results to compare journey options for the selected route and dates before choosing a travel itinerary. For sort option, choose departure / arrival / fastest. Continue with the returned next_offset as offset; a null value marks the last page. The detail page includes parameter definitions, paired request and response examples, and usage pricing for this operation.

Trenitalia train search API

Trenitalia trains between two stations from a day and time, as the booking site lists them: departure, arrival, duration, changes, every train and leg, the lowest price, and for each leg every class (Standard, Premium, Business, Executive and others) with each fare (Base, Economy, Super Economy and offers): price, seats left at that price, change and refund rules. Filter by train type (Frecce, regional, Intercity), direct trains only, best fare, bike space; sort by departure, arrival or fastest. Up to 10 trains a page: pass `next_offset` back as `offset`; it is null on the last page.

Inputs and results

Send the listed inputs as GET query parameters. Required inputs: from, to. Supported values, filters and optional identifiers are listed below.

ParameterTypeRequiredMeaning
fromstringRequiredDeparture station: a station id from /trenitalia/v1/stations or a name (the best match is used).
tostringRequiredArrival station: an id or a name.
datestringOptionalDeparture day, YYYY-MM-DD. Give this or `days_ahead`.
days_aheadintegerOptionalDeparture day as days from today (0-365), when `date` is not given.
timestringOptionalEarliest departure, HH:MM (default 00:00).
adultsintegerOptionalAdults (default 1).
childrenintegerOptionalChildren (default 0).
trainsstringOptional`all` (default), `frecce`, `regional` or `intercity`. Allowed values: all, frecce, regional, intercity.
directstringOptional`1` for trains without changes only. Allowed values: 0, 1.
best_farestringOptional`1` to price each train with its best fare. Allowed values: 0, 1.
bikestringOptional`1` for trains that carry bikes. Allowed values: 0, 1.
sortstringOptional`departure` (default), `arrival` or `fastest`. Allowed values: departure, arrival, fastest.
offsetintegerOptionalResults to skip. Pass `next_offset` back here.
limitintegerOptionalTrains per page (1-10, default 10).
rawstringOptionalUse 0 to leave out the source raw blocks. This controls raw source payloads, not the normalized result records. Allowed values: 0, 1.
fieldsstringOptionalOptional comma-separated output fields; nested paths follow the source field-selection syntax. Call metadata is retained.
freshstringOptionalUse 1 to bypass the source response cache. Cache hits are also billed according to reported credits. Allowed values: 1.
outputstringOptionalResponse format for this product: json. Omit this parameter to use JSON. Allowed values: json.
recordsstringOptionalSource export selector for CSV or NDJSON. It has no effect on this JSON-only product.

Using OpenAny

Send this request to the OpenAny gateway with your OpenAny API key in the Authorization header. The query values below match the paired request example.

OpenAny request example

bash
curl "https://api.openany.si/v1/agent-apis/apish/trenitalia/v1/search?from=Roma+Termini&to=Milano+Centrale&days_ahead=30&time=08%3A00&output=json&raw=0&limit=1" \
  -H "Authorization: Bearer <OPENANY_API_KEY>"

This command illustrates the OpenAny request format. The response example below retains its stated provenance; it is not evidence that this gateway request was executed.

Response example

Recorded source response for the exact request shown above. Filters, field selectors and page choices in that request define the returned scope.

json
{"from":{"id":830008409,"name":"Roma Termini"},"to":{"id":830001700,"name":"Milano Centrale"},"date":"2026-12-19","time":"08:00","passengers":{"adults":1,"children":0},"applied_filters":{"trains":"all","direct":false,"best_fare":false,"bike":false,"sort":"departure"},"count":1,"offset":0,"next_offset":1,"messages":[],"solutions":[{"id":"xce005fff-7144-4756-b78a-e0446b288a2b","origin":"Roma Termini","destination":"Milano Centrale","departure":"2026-12-19T08:05:00.000+01:00","arrival":"2026-12-19T11:51:00.000+01:00","duration":"3h 46min","status":"SALEABLE","changes":0,"trains":[{"number":"9516","category":"Frecciarossa","acronym":"FR","brand":"FRECCIAROSSA","urban":false}],"price_from":{"amount":49.9,"currency":"EUR","original_amount":null,"indicative":false},"legs":[{"origin":"Roma Termini","destination":"Milano Centrale","departure":"2026-12-19T08:05:00.000+01:00","arrival":"2026-12-19T11:51:00.000+01:00","train":{"number":"9516","category":"Frecciarossa","acronym":"FR","brand":"FRECCIAROSSA","urban":false}}],"classes":[{"leg_id":"xf2e88d54-3b86-4427-a4b2-3f5ac7d26bff","leg":"Frecciarossa 9516","services":[{"name":"STANDARD","group":"STANDARD","description":"Reclining upholstered or faux-leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The Café/Snack Bar is always available in coach 5 for all train passengers.","offers":[{"name":"BASE","description":"This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.","price":{"amount":95,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":236,"status":"SALEABLE","can_change":true,"can_refund":true,"loyalty_program":true},{"name":"Economy","description":"Reservation change allowed before departure. Refund not allowed. Limited seats","price":{"amount":74.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":236,"status":"SALEABLE","can_change":true,"can_refund":false,"loyalty_program":true},{"name":"Super Economy","description":"Reservation change and refund not allowed. Limited seats","price":{"amount":49.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":236,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":true},{"name":"FrecciaYOUNG","description":"Offer reserved for CartaFreccia holders under 30 years of age. No ticket changes or refunds permitted. Subject to seat availability.","price":{"amount":39,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":236,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":false},{"name":"FrecciaSENIOR","description":"This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.","price":{"amount":49,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":236,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":false},{"name":"FrecciaDAYS","description":"Reservation change and refund not allowed. Limited seats","price":null,"seats_available":0,"status":"SOLD_OUT","can_change":false,"can_refund":false,"loyalty_program":false}]},{"name":"PREMIUM","group":"PREMIUM","description":"Reclining leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. A service to welcome you on board, with savoury and sweet snacks. The FRECCIABistrò in coach 5 remains available to all train passengers.","offers":[{"name":"BASE","description":"This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.","price":{"amount":112,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":48,"status":"SALEABLE","can_change":true,"can_refund":true,"loyalty_program":true},{"name":"Economy","description":"Reservation change allowed before departure. Refund not allowed. Limited seats","price":{"amount":80.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":48,"status":"SALEABLE","can_change":true,"can_refund":false,"loyalty_program":true},{"name":"Super Economy","description":"Reservation change and refund not allowed. Limited seats","price":{"amount":52.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":48,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":true},{"name":"FrecciaSENIOR","description":"This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.","price":{"amount":54,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":48,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":false},{"name":"FrecciaDAYS","description":"Reservation change and refund not allowed. Limited seats","price":null,"seats_available":0,"status":"SOLD_OUT","can_change":false,"can_refund":false,"loyalty_program":false}]},{"name":"BUSINESS","group":"BUSINESS","description":"More space for your journey. Spacious single and double reclining leather seats. Seats are spaced more than one metre apart. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.","offers":[{"name":"BASE","description":"This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.","price":{"amount":129,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":104,"status":"SALEABLE","can_change":true,"can_refund":true,"loyalty_program":true},{"name":"Economy","description":"Reservation change allowed before departure. Refund not allowed. Limited seats","price":{"amount":93.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":104,"status":"SALEABLE","can_change":true,"can_refund":false,"loyalty_program":true},{"name":"Super Economy","description":"Reservation change and refund not allowed. Limited seats","price":{"amount":59.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":104,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":true},{"name":"FrecciaSENIOR","description":"This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.","price":{"amount":59,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":104,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":false},{"name":"FrecciaDAYS","description":"Reservation change and refund not allowed. Limited seats","price":{"amount":51.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":33,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":true}]},{"name":"BUSINESS AREA SILENZIO","group":"BUSINESS","description":"Maximum relaxation and no mobile phone use. Large single and double leather seats equipped with electric reclining systems and adjustable headrests. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. No mobile phone use. The FrecciaBistrò in coach 5 remains available to all train passengers.","offers":[{"name":"BASE","description":"This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.","price":{"amount":129,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":11,"status":"SALEABLE","can_change":true,"can_refund":true,"loyalty_program":true},{"name":"Economy","description":"Reservation change allowed before departure. Refund not allowed. Limited seats","price":{"amount":93.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":11,"status":"SALEABLE","can_change":true,"can_refund":false,"loyalty_program":true},{"name":"Super Economy","description":"Reservation change and refund not allowed. Limited seats","price":{"amount":59.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":11,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":true},{"name":"FrecciaSENIOR","description":"This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.","price":{"amount":59,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":11,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":false},{"name":"FrecciaDAYS","description":"Reservation change and refund not allowed. Limited seats","price":{"amount":51.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":11,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":true}]},{"name":"BUSINESS SALOTTINO","group":"BUSINESS","description":"Maximum privacy. Reserved Area with 4 large, reclining, leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.","offers":[{"name":"BASE","description":"This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.","price":{"amount":139,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":4,"status":"SALEABLE","can_change":true,"can_refund":true,"loyalty_program":true},{"name":"Economy","description":"Reservation change allowed before departure. Refund not allowed. Limited seats","price":{"amount":102.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":4,"status":"SALEABLE","can_change":true,"can_refund":false,"loyalty_program":true},{"name":"Super Economy","description":"Reservation change and refund not allowed. Limited seats","price":{"amount":65.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":4,"status":"SALEABLE","can_change":false,"can_refund":false,"loyalty_program":true}]},{"name":"EXECUTIVE","group":"EXECUTIVE","description":"The Executive travel experience features an exclusive welcome with the utmost care, class and taste, at any time of the day. Maximum comfort. 8 large single leather seats with spacious reclining backrests and extendable leg rests, spaced 150 cm apart. Individual electrical sockets. Complimentary access to our Wi-Fi internet service and the FRECCIAPlay. Screen for travel information and entertainment. For more details, please consult the Trenitalia website: www.trenitalia.com","offers":[{"name":"BASE","description":"This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.","price":{"amount":295,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":7,"status":"SALEABLE","can_change":true,"can_refund":true,"loyalty_program":true},{"name":"Economy","description":"Reservation change allowed before departure. Refund not allowed. Limited seats","price":{"amount":250.9,"currency":"EUR","original_amount":null,"indicative":false},"seats_available":3,"status":"SALEABLE","can_change":true,"can_refund":false,"loyalty_program":true}]}]}],"loyalty_points":49.9,"next_day":false,"seat_map":true,"messages":[]}],"cached":false,"fetched_at":"2026-11-19T12:25:41.228Z","credits_used":1}

Usage and price

The price is USD 0.002 per actual credit reported in credits_used, with no fixed per-call fee. A response reporting zero credits has zero usage cost. Up to USD 0.002 is reserved for this request; the final price follows reported usage within the configured upper limit. A valid empty result or an unsuccessful lookup can still consume source credits. Cache hits also consume credits.

Coverage and limits

Coverage and update times follow the source. Use the documented field definitions when interpreting the selected result. Requests have a 120-second time budget and a 8 MiB response limit.

Use offset according to the operation's parameter definitions. Each additional page requires a separate request.

Playground

Run sends a real API request. Charges follow the published API contract.

Request parameters
Departure station: a station id from /trenitalia/v1/stations or a name (the best match is used).
Arrival station: an id or a name.
Optional parameters (17)
Departure day, YYYY-MM-DD. Give this or `days_ahead`.
Departure day as days from today (0-365), when `date` is not given.
Earliest departure, HH:MM (default 00:00).
Adults (default 1).
Children (default 0).
`all` (default), `frecce`, `regional` or `intercity`.
`1` for trains without changes only.
`1` to price each train with its best fare.
`1` for trains that carry bikes.
`departure` (default), `arrival` or `fastest`.
Results to skip. Pass `next_offset` back here.
Trains per page (1-10, default 10).
0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
1 skips the 24-hour cache and fetches live.
JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Sample response

{
  "applied_filters": {
    "best_fare": false,
    "bike": false,
    "direct": false,
    "sort": "departure",
    "trains": "all"
  },
  "cached": false,
  "count": 1,
  "credits_used": 1,
  "date": "2026-12-19",
  "fetched_at": "2026-11-19T12:25:41.228Z",
  "from": {
    "id": 830008409,
    "name": "Roma Termini"
  },
  "messages": [],
  "next_offset": 1,
  "offset": 0,
  "passengers": {
    "adults": 1,
    "children": 0
  },
  "solutions": [
    {
      "arrival": "2026-12-19T11:51:00.000+01:00",
      "changes": 0,
      "classes": [
        {
          "leg": "Frecciarossa 9516",
          "leg_id": "xf2e88d54-3b86-4427-a4b2-3f5ac7d26bff",
          "services": [
            {
              "description": "Reclining upholstered or faux-leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The Café/Snack Bar is always available in coach 5 for all train passengers.",
              "group": "STANDARD",
              "name": "STANDARD",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 95,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 74.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 49.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Offer reserved for CartaFreccia holders under 30 years of age. No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaYOUNG",
                  "price": {
                    "amount": 39,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 49,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": false,
                  "name": "FrecciaDAYS",
                  "price": null,
                  "seats_available": 0,
                  "status": "SOLD_OUT"
                }
              ]
            },
            {
              "description": "Reclining leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. A service to welcome you on board, with savoury and sweet snacks. The FRECCIABistrò in coach 5 remains available to all train passengers.",
              "group": "PREMIUM",
              "name": "PREMIUM",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 112,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 80.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 52.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 54,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": false,
                  "name": "FrecciaDAYS",
                  "price": null,
                  "seats_available": 0,
                  "status": "SOLD_OUT"
                }
              ]
            },
            {
              "description": "More space for your journey. Spacious single and double reclining leather seats. Seats are spaced more than one metre apart. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
              "group": "BUSINESS",
              "name": "BUSINESS",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 129,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 93.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 59.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 59,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "FrecciaDAYS",
                  "price": {
                    "amount": 51.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 33,
                  "status": "SALEABLE"
                }
              ]
            },
            {
              "description": "Maximum relaxation and no mobile phone use. Large single and double leather seats equipped with electric reclining systems and adjustable headrests. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. No mobile phone use. The FrecciaBistrò in coach 5 remains available to all train passengers.",
              "group": "BUSINESS",
              "name": "BUSINESS AREA SILENZIO",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 129,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 93.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 59.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 59,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "FrecciaDAYS",
                  "price": {
                    "amount": 51.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                }
              ]
            },
            {
              "description": "Maximum privacy. Reserved Area with 4 large, reclining, leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
              "group": "BUSINESS",
              "name": "BUSINESS SALOTTINO",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 139,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 4,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 102.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 4,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 65.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 4,
                  "status": "SALEABLE"
                }
              ]
            },
            {
              "description": "The Executive travel experience features an exclusive welcome with the utmost care, class and taste, at any time of the day. Maximum comfort. 8 large single leather seats with spacious reclining backrests and extendable leg rests, spaced 150 cm apart. Individual electrical sockets. Complimentary access to our Wi-Fi internet service and the FRECCIAPlay. Screen for travel information and entertainment. For more details, please consult the Trenitalia website: www.trenitalia.com",
              "group": "EXECUTIVE",
              "name": "EXECUTIVE",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 295,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 7,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 250.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 3,
                  "status": "SALEABLE"
                }
              ]
            }
          ]
        }
      ],
      "departure": "2026-12-19T08:05:00.000+01:00",
      "destination": "Milano Centrale",
      "duration": "3h 46min",
      "id": "xce005fff-7144-4756-b78a-e0446b288a2b",
      "legs": [
        {
          "arrival": "2026-12-19T11:51:00.000+01:00",
          "departure": "2026-12-19T08:05:00.000+01:00",
          "destination": "Milano Centrale",
          "origin": "Roma Termini",
          "train": {
            "acronym": "FR",
            "brand": "FRECCIAROSSA",
            "category": "Frecciarossa",
            "number": "9516",
            "urban": false
          }
        }
      ],
      "loyalty_points": 49.9,
      "messages": [],
      "next_day": false,
      "origin": "Roma Termini",
      "price_from": {
        "amount": 49.9,
        "currency": "EUR",
        "indicative": false,
        "original_amount": null
      },
      "seat_map": true,
      "status": "SALEABLE",
      "trains": [
        {
          "acronym": "FR",
          "brand": "FRECCIAROSSA",
          "category": "Frecciarossa",
          "number": "9516",
          "urban": false
        }
      ]
    }
  ],
  "time": "08:00",
  "to": {
    "id": 830001700,
    "name": "Milano Centrale"
  }
}

Response result

Response structure

Inferred from examples
  • applied_filtersobject
    • best_fareboolean
    • bikeboolean
    • directboolean
    • sortstring
    • trainsstring
  • cachedboolean
  • countinteger
  • credits_usedinteger
  • datestring
  • fetched_atstring
  • fromobject
    • idinteger
    • namestring
  • messagesunknown[]
  • next_offsetinteger
  • offsetinteger
  • passengersobject
    • adultsinteger
    • childreninteger
  • solutionsobject[]
    • arrivalstring
    • changesinteger
    • classesobject[]
      • legstring
      • leg_idstring
      • servicesobject[]
        • descriptionstring
        • groupstring
        • namestring
        • offersobject[]
          • can_changeboolean
          • can_refundboolean
          • descriptionstring
          • loyalty_programboolean
          • namestring
          • priceobject | null
            • amountnumber
            • currencystring
            • indicativeboolean
            • original_amountnull
          • seats_availableinteger
          • statusstring
    • departurestring
    • destinationstring
    • durationstring
    • idstring
    • legsobject[]
      • arrivalstring
      • departurestring
      • destinationstring
      • originstring
      • trainobject
        • acronymstring
        • brandstring
        • categorystring
        • numberstring
        • urbanboolean
    • loyalty_pointsnumber
    • messagesunknown[]
    • next_dayboolean
    • originstring
    • price_fromobject
      • amountnumber
      • currencystring
      • indicativeboolean
      • original_amountnull
    • seat_mapboolean
    • statusstring
    • trainsobject[]
      • acronymstring
      • brandstring
      • categorystring
      • numberstring
      • urbanboolean
  • timestring
  • toobject
    • idinteger
    • namestring

Sellers

SellerPricingRequests · 30dPerformanceAccess
apishCurrent
Trenitalia train search API · GET · View API reference
$0.002 / billing credit—
—successP50—
Loading...
Selected pricing · apishUSD / billing credit
Pricing
$0.002

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 2. Price update time: not supplied.

API

Method
GET
Endpoint
https://api.openany.si/v1/agent-apis/apish/trenitalia/v1/search
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
  'https://api.openany.si/v1/agent-apis/apish/trenitalia/v1/search?days_ahead=30&from=Roma+Termini&limit=1&output=json&raw=0&time=08%3A00&to=Milano+Centrale' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'

Input parameters

Fields in this listing; additional options and input encoding can vary by provider.

ParameterLocationTypeRequiredDescription
fromURL query parametersquerystringYesDeparture station: a station id from /trenitalia/v1/stations or a name (the best match is used).
toURL query parametersquerystringYesArrival station: an id or a name.
dateURL query parametersquerystringNoDeparture day, YYYY-MM-DD. Give this or `days_ahead`.
days_aheadURL query parametersqueryintegerNoDeparture day as days from today (0-365), when `date` is not given.
timeURL query parametersquerystringNoEarliest departure, HH:MM (default 00:00).
adultsURL query parametersqueryintegerNoAdults (default 1).
childrenURL query parametersqueryintegerNoChildren (default 0).
trainsURL query parametersquerystringNo`all` (default), `frecce`, `regional` or `intercity`.

enum: "all", "frecce", "regional", "intercity"

directURL query parametersquerystringNo`1` for trains without changes only.

enum: "0", "1"

best_fareURL query parametersquerystringNo`1` to price each train with its best fare.

enum: "0", "1"

bikeURL query parametersquerystringNo`1` for trains that carry bikes.

enum: "0", "1"

sortURL query parametersquerystringNo`departure` (default), `arrival` or `fastest`.

enum: "departure", "arrival", "fastest"

offsetURL query parametersqueryintegerNoResults to skip. Pass `next_offset` back here.
limitURL query parametersqueryintegerNoTrains per page (1-10, default 10).
rawURL query parametersquerystringNo0 leaves out the bulky `raw` source blocks (often 10-30x smaller).

enum: "0", "1"

fieldsURL query parametersquerystringNoComma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
freshURL query parametersquerystringNo1 skips the 24-hour cache and fetches live.

enum: "1"

outputURL query parametersquerystringNoJSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.

enum: "json"

recordsURL query parametersquerystringNoWith output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Required markers inside a nested object or variant apply when that object or variant is used.

Sample response

Sample response · Documented HTTP 200 Example from the provider's documentation. Field values in your results will differ.

Official example · Live API.SH response · Minimal request
{
  "applied_filters": {
    "best_fare": false,
    "bike": false,
    "direct": false,
    "sort": "departure",
    "trains": "all"
  },
  "cached": false,
  "count": 1,
  "credits_used": 1,
  "date": "2026-12-19",
  "fetched_at": "2026-11-19T12:25:41.228Z",
  "from": {
    "id": 830008409,
    "name": "Roma Termini"
  },
  "messages": [],
  "next_offset": 1,
  "offset": 0,
  "passengers": {
    "adults": 1,
    "children": 0
  },
  "solutions": [
    {
      "arrival": "2026-12-19T11:51:00.000+01:00",
      "changes": 0,
      "classes": [
        {
          "leg": "Frecciarossa 9516",
          "leg_id": "xf2e88d54-3b86-4427-a4b2-3f5ac7d26bff",
          "services": [
            {
              "description": "Reclining upholstered or faux-leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The Café/Snack Bar is always available in coach 5 for all train passengers.",
              "group": "STANDARD",
              "name": "STANDARD",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 95,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 74.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 49.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Offer reserved for CartaFreccia holders under 30 years of age. No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaYOUNG",
                  "price": {
                    "amount": 39,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 49,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 236,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": false,
                  "name": "FrecciaDAYS",
                  "price": null,
                  "seats_available": 0,
                  "status": "SOLD_OUT"
                }
              ]
            },
            {
              "description": "Reclining leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. A service to welcome you on board, with savoury and sweet snacks. The FRECCIABistrò in coach 5 remains available to all train passengers.",
              "group": "PREMIUM",
              "name": "PREMIUM",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 112,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 80.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 52.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 54,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 48,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": false,
                  "name": "FrecciaDAYS",
                  "price": null,
                  "seats_available": 0,
                  "status": "SOLD_OUT"
                }
              ]
            },
            {
              "description": "More space for your journey. Spacious single and double reclining leather seats. Seats are spaced more than one metre apart. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
              "group": "BUSINESS",
              "name": "BUSINESS",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 129,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 93.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 59.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 59,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 104,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "FrecciaDAYS",
                  "price": {
                    "amount": 51.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 33,
                  "status": "SALEABLE"
                }
              ]
            },
            {
              "description": "Maximum relaxation and no mobile phone use. Large single and double leather seats equipped with electric reclining systems and adjustable headrests. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. No mobile phone use. The FrecciaBistrò in coach 5 remains available to all train passengers.",
              "group": "BUSINESS",
              "name": "BUSINESS AREA SILENZIO",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 129,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 93.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 59.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                  "loyalty_program": false,
                  "name": "FrecciaSENIOR",
                  "price": {
                    "amount": 59,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "FrecciaDAYS",
                  "price": {
                    "amount": 51.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 11,
                  "status": "SALEABLE"
                }
              ]
            },
            {
              "description": "Maximum privacy. Reserved Area with 4 large, reclining, leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
              "group": "BUSINESS",
              "name": "BUSINESS SALOTTINO",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 139,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 4,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 102.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 4,
                  "status": "SALEABLE"
                },
                {
                  "can_change": false,
                  "can_refund": false,
                  "description": "Reservation change and refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Super Economy",
                  "price": {
                    "amount": 65.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 4,
                  "status": "SALEABLE"
                }
              ]
            },
            {
              "description": "The Executive travel experience features an exclusive welcome with the utmost care, class and taste, at any time of the day. Maximum comfort. 8 large single leather seats with spacious reclining backrests and extendable leg rests, spaced 150 cm apart. Individual electrical sockets. Complimentary access to our Wi-Fi internet service and the FRECCIAPlay. Screen for travel information and entertainment. For more details, please consult the Trenitalia website: www.trenitalia.com",
              "group": "EXECUTIVE",
              "name": "EXECUTIVE",
              "offers": [
                {
                  "can_change": true,
                  "can_refund": true,
                  "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                  "loyalty_program": true,
                  "name": "BASE",
                  "price": {
                    "amount": 295,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 7,
                  "status": "SALEABLE"
                },
                {
                  "can_change": true,
                  "can_refund": false,
                  "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                  "loyalty_program": true,
                  "name": "Economy",
                  "price": {
                    "amount": 250.9,
                    "currency": "EUR",
                    "indicative": false,
                    "original_amount": null
                  },
                  "seats_available": 3,
                  "status": "SALEABLE"
                }
              ]
            }
          ]
        }
      ],
      "departure": "2026-12-19T08:05:00.000+01:00",
      "destination": "Milano Centrale",
      "duration": "3h 46min",
      "id": "xce005fff-7144-4756-b78a-e0446b288a2b",
      "legs": [
        {
          "arrival": "2026-12-19T11:51:00.000+01:00",
          "departure": "2026-12-19T08:05:00.000+01:00",
          "destination": "Milano Centrale",
          "origin": "Roma Termini",
          "train": {
            "acronym": "FR",
            "brand": "FRECCIAROSSA",
            "category": "Frecciarossa",
            "number": "9516",
            "urban": false
          }
        }
      ],
      "loyalty_points": 49.9,
      "messages": [],
      "next_day": false,
      "origin": "Roma Termini",
      "price_from": {
        "amount": 49.9,
        "currency": "EUR",
        "indicative": false,
        "original_amount": null
      },
      "seat_map": true,
      "status": "SALEABLE",
      "trains": [
        {
          "acronym": "FR",
          "brand": "FRECCIAROSSA",
          "category": "Frecciarossa",
          "number": "9516",
          "urban": false
        }
      ]
    }
  ],
  "time": "08:00",
  "to": {
    "id": 830001700,
    "name": "Milano Centrale"
  }
}

Composite rule pricing

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Base fee: $0.000000. One matching variant replaces the base fee. Matching add-ons and quantity charges are added.

Fee itemPriceMetering sourceWhenQuantity limit
Actual API.SH credits consumed$0.002000 / billing creditResponse · /credits_used · Numeric valueAlways1 billing credit · Decimal places: 0

Each quantity charge is rounded before summing: ceil. Requests exceeding this cost limit are rejected; it is not a price cap: $0.002000.

Response quantities settle after the response. Before execution, the maximum quantity determines the reservation; unused reservation is released. Missing or invalid quantities are not treated as zero.

Pricing parameters and defaults
[]

Agent integration

Copy the resource contract without sharing an API key.

View API Markdown
API Markdown
# Trenitalia train search API

Use the Trenitalia train search API to retrieve trip options, journey segments and endpoints, duration information, clock-change records, train records and quoted price as structured JSON from Trenitalia. Supply origin and destination in the query; optionally select date, departure offset in days and sort option to set the requested scope. Use these results to compare journey options for the selected route and dates before choosing a travel itinerary. For sort option, choose departure / arrival / fastest. Continue with the returned next_offset as offset; a null value marks the last page. The detail page includes parameter definitions, paired request and response examples, and usage pricing for this operation.
## Available implementations
apish · Trenitalia train search API: https://openany.si/markets/apis/capabilities/trenitalia-train-search-api?offering=5d345aaf-1452-4101-a38b-4a6b981c3325 · $0.002 / billing credit

## Selected API contract
Documentation: https://openany.si/apis/5d345aaf-1452-4101-a38b-4a6b981c3325
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/trenitalia/v1/search
Price: $0.002 / billing credit
Provider: apish
Contract revision: 2
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.

Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.

## Prepared request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/trenitalia/v1/search?days_ahead=30&from=Roma+Termini&limit=1&output=json&raw=0&time=08%3A00&to=Milano+Centrale' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## API contract
```json
{
  "resource_type": "api",
  "name": "Trenitalia train search API",
  "endpoint": "https://api.openany.si/v1/agent-apis/apish/trenitalia/v1/search",
  "method": "GET",
  "content_type": "none",
  "execution_mode": "sync",
  "authentication": {
    "type": "bearer",
    "environment_variable": "OPENANY_API_KEY"
  },
  "inputs": [
    {
      "description": "Departure station: a station id from /trenitalia/v1/stations or a name (the best match is used).",
      "location": "query",
      "name": "from",
      "nullable": false,
      "required": true,
      "type": "string"
    },
    {
      "description": "Arrival station: an id or a name.",
      "location": "query",
      "name": "to",
      "nullable": false,
      "required": true,
      "type": "string"
    },
    {
      "description": "Departure day, YYYY-MM-DD. Give this or `days_ahead`.",
      "location": "query",
      "name": "date",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Departure day as days from today (0-365), when `date` is not given.",
      "location": "query",
      "name": "days_ahead",
      "nullable": false,
      "required": false,
      "type": "integer"
    },
    {
      "description": "Earliest departure, HH:MM (default 00:00).",
      "location": "query",
      "name": "time",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Adults (default 1).",
      "location": "query",
      "name": "adults",
      "nullable": false,
      "required": false,
      "type": "integer"
    },
    {
      "description": "Children (default 0).",
      "location": "query",
      "name": "children",
      "nullable": false,
      "required": false,
      "type": "integer"
    },
    {
      "description": "`all` (default), `frecce`, `regional` or `intercity`.",
      "enum_values": [
        "all",
        "frecce",
        "regional",
        "intercity"
      ],
      "location": "query",
      "name": "trains",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "`1` for trains without changes only.",
      "enum_values": [
        "0",
        "1"
      ],
      "location": "query",
      "name": "direct",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "`1` to price each train with its best fare.",
      "enum_values": [
        "0",
        "1"
      ],
      "location": "query",
      "name": "best_fare",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "`1` for trains that carry bikes.",
      "enum_values": [
        "0",
        "1"
      ],
      "location": "query",
      "name": "bike",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "`departure` (default), `arrival` or `fastest`.",
      "enum_values": [
        "departure",
        "arrival",
        "fastest"
      ],
      "location": "query",
      "name": "sort",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Results to skip. Pass `next_offset` back here.",
      "location": "query",
      "name": "offset",
      "nullable": false,
      "required": false,
      "type": "integer"
    },
    {
      "description": "Trains per page (1-10, default 10).",
      "location": "query",
      "name": "limit",
      "nullable": false,
      "required": false,
      "type": "integer"
    },
    {
      "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
      "enum_values": [
        "0",
        "1"
      ],
      "location": "query",
      "name": "raw",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.",
      "location": "query",
      "name": "fields",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "1 skips the 24-hour cache and fetches live.",
      "enum_values": [
        "1"
      ],
      "location": "query",
      "name": "fresh",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
      "enum_values": [
        "json"
      ],
      "location": "query",
      "name": "output",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.",
      "location": "query",
      "name": "records",
      "nullable": false,
      "required": false,
      "type": "string"
    }
  ],
  "billing": {
    "currency": "USD",
    "mode": "rules",
    "parameters": [],
    "policy_version": 2,
    "sale": {
      "addons": [],
      "base_price_micro_usd": "0",
      "max_cost_micro_usd": "2000",
      "quantities": [
        {
          "id": "upstream_credits",
          "label": "Actual API.SH credits consumed",
          "max_quantity": "1",
          "measure": "value",
          "pointer": "/credits_used",
          "price_micro_usd": "2000",
          "quantity_scale": 0,
          "source": "response",
          "unit": "credit",
          "unit_quantity": "1"
        }
      ],
      "rounding": "ceil",
      "variants": []
    }
  },
  "examples": [
    {
      "http_status": 200,
      "name": "Official example · Live API.SH response · Minimal request",
      "request": {
        "body": null,
        "headers": {},
        "path": {},
        "query": {
          "days_ahead": "30",
          "from": "Roma Termini",
          "limit": "1",
          "output": "json",
          "raw": "0",
          "time": "08:00",
          "to": "Milano Centrale"
        }
      },
      "response_body": {
        "applied_filters": {
          "best_fare": false,
          "bike": false,
          "direct": false,
          "sort": "departure",
          "trains": "all"
        },
        "cached": false,
        "count": 1,
        "credits_used": 1,
        "date": "2026-12-19",
        "fetched_at": "2026-11-19T12:25:41.228Z",
        "from": {
          "id": 830008409,
          "name": "Roma Termini"
        },
        "messages": [],
        "next_offset": 1,
        "offset": 0,
        "passengers": {
          "adults": 1,
          "children": 0
        },
        "solutions": [
          {
            "arrival": "2026-12-19T11:51:00.000+01:00",
            "changes": 0,
            "classes": [
              {
                "leg": "Frecciarossa 9516",
                "leg_id": "xf2e88d54-3b86-4427-a4b2-3f5ac7d26bff",
                "services": [
                  {
                    "description": "Reclining upholstered or faux-leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The Café/Snack Bar is always available in coach 5 for all train passengers.",
                    "group": "STANDARD",
                    "name": "STANDARD",
                    "offers": [
                      {
                        "can_change": true,
                        "can_refund": true,
                        "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                        "loyalty_program": true,
                        "name": "BASE",
                        "price": {
                          "amount": 95,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 236,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": true,
                        "can_refund": false,
                        "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Economy",
                        "price": {
                          "amount": 74.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 236,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Super Economy",
                        "price": {
                          "amount": 49.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 236,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Offer reserved for CartaFreccia holders under 30 years of age. No ticket changes or refunds permitted. Subject to seat availability.",
                        "loyalty_program": false,
                        "name": "FrecciaYOUNG",
                        "price": {
                          "amount": 39,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 236,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                        "loyalty_program": false,
                        "name": "FrecciaSENIOR",
                        "price": {
                          "amount": 49,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 236,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": false,
                        "name": "FrecciaDAYS",
                        "price": null,
                        "seats_available": 0,
                        "status": "SOLD_OUT"
                      }
                    ]
                  },
                  {
                    "description": "Reclining leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. A service to welcome you on board, with savoury and sweet snacks. The FRECCIABistrò in coach 5 remains available to all train passengers.",
                    "group": "PREMIUM",
                    "name": "PREMIUM",
                    "offers": [
                      {
                        "can_change": true,
                        "can_refund": true,
                        "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                        "loyalty_program": true,
                        "name": "BASE",
                        "price": {
                          "amount": 112,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 48,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": true,
                        "can_refund": false,
                        "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Economy",
                        "price": {
                          "amount": 80.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 48,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Super Economy",
                        "price": {
                          "amount": 52.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 48,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                        "loyalty_program": false,
                        "name": "FrecciaSENIOR",
                        "price": {
                          "amount": 54,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 48,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": false,
                        "name": "FrecciaDAYS",
                        "price": null,
                        "seats_available": 0,
                        "status": "SOLD_OUT"
                      }
                    ]
                  },
                  {
                    "description": "More space for your journey. Spacious single and double reclining leather seats. Seats are spaced more than one metre apart. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
                    "group": "BUSINESS",
                    "name": "BUSINESS",
                    "offers": [
                      {
                        "can_change": true,
                        "can_refund": true,
                        "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                        "loyalty_program": true,
                        "name": "BASE",
                        "price": {
                          "amount": 129,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 104,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": true,
                        "can_refund": false,
                        "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Economy",
                        "price": {
                          "amount": 93.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 104,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Super Economy",
                        "price": {
                          "amount": 59.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 104,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                        "loyalty_program": false,
                        "name": "FrecciaSENIOR",
                        "price": {
                          "amount": 59,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 104,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "FrecciaDAYS",
                        "price": {
                          "amount": 51.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 33,
                        "status": "SALEABLE"
                      }
                    ]
                  },
                  {
                    "description": "Maximum relaxation and no mobile phone use. Large single and double leather seats equipped with electric reclining systems and adjustable headrests. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. No mobile phone use. The FrecciaBistrò in coach 5 remains available to all train passengers.",
                    "group": "BUSINESS",
                    "name": "BUSINESS AREA SILENZIO",
                    "offers": [
                      {
                        "can_change": true,
                        "can_refund": true,
                        "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                        "loyalty_program": true,
                        "name": "BASE",
                        "price": {
                          "amount": 129,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 11,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": true,
                        "can_refund": false,
                        "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Economy",
                        "price": {
                          "amount": 93.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 11,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Super Economy",
                        "price": {
                          "amount": 59.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 11,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                        "loyalty_program": false,
                        "name": "FrecciaSENIOR",
                        "price": {
                          "amount": 59,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 11,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "FrecciaDAYS",
                        "price": {
                          "amount": 51.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 11,
                        "status": "SALEABLE"
                      }
                    ]
                  },
                  {
                    "description": "Maximum privacy. Reserved Area with 4 large, reclining, leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
                    "group": "BUSINESS",
                    "name": "BUSINESS SALOTTINO",
                    "offers": [
                      {
                        "can_change": true,
                        "can_refund": true,
                        "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                        "loyalty_program": true,
                        "name": "BASE",
                        "price": {
                          "amount": 139,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 4,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": true,
                        "can_refund": false,
                        "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Economy",
                        "price": {
                          "amount": 102.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 4,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": false,
                        "can_refund": false,
                        "description": "Reservation change and refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Super Economy",
                        "price": {
                          "amount": 65.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 4,
                        "status": "SALEABLE"
                      }
                    ]
                  },
                  {
                    "description": "The Executive travel experience features an exclusive welcome with the utmost care, class and taste, at any time of the day. Maximum comfort. 8 large single leather seats with spacious reclining backrests and extendable leg rests, spaced 150 cm apart. Individual electrical sockets. Complimentary access to our Wi-Fi internet service and the FRECCIAPlay. Screen for travel information and entertainment. For more details, please consult the Trenitalia website: www.trenitalia.com",
                    "group": "EXECUTIVE",
                    "name": "EXECUTIVE",
                    "offers": [
                      {
                        "can_change": true,
                        "can_refund": true,
                        "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                        "loyalty_program": true,
                        "name": "BASE",
                        "price": {
                          "amount": 295,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 7,
                        "status": "SALEABLE"
                      },
                      {
                        "can_change": true,
                        "can_refund": false,
                        "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                        "loyalty_program": true,
                        "name": "Economy",
                        "price": {
                          "amount": 250.9,
                          "currency": "EUR",
                          "indicative": false,
                          "original_amount": null
                        },
                        "seats_available": 3,
                        "status": "SALEABLE"
                      }
                    ]
                  }
                ]
              }
            ],
            "departure": "2026-12-19T08:05:00.000+01:00",
            "destination": "Milano Centrale",
            "duration": "3h 46min",
            "id": "xce005fff-7144-4756-b78a-e0446b288a2b",
            "legs": [
              {
                "arrival": "2026-12-19T11:51:00.000+01:00",
                "departure": "2026-12-19T08:05:00.000+01:00",
                "destination": "Milano Centrale",
                "origin": "Roma Termini",
                "train": {
                  "acronym": "FR",
                  "brand": "FRECCIAROSSA",
                  "category": "Frecciarossa",
                  "number": "9516",
                  "urban": false
                }
              }
            ],
            "loyalty_points": 49.9,
            "messages": [],
            "next_day": false,
            "origin": "Roma Termini",
            "price_from": {
              "amount": 49.9,
              "currency": "EUR",
              "indicative": false,
              "original_amount": null
            },
            "seat_map": true,
            "status": "SALEABLE",
            "trains": [
              {
                "acronym": "FR",
                "brand": "FRECCIAROSSA",
                "category": "Frecciarossa",
                "number": "9516",
                "urban": false
              }
            ]
          }
        ],
        "time": "08:00",
        "to": {
          "id": 830001700,
          "name": "Milano Centrale"
        }
      }
    }
  ]
}
```

Error handling

StatusNext step
400Check the offering and request fields.
401 / 403Verify your credentials and access permissions.
402Inspect the selected access mode and returned payment requirements.
429Respect the returned rate limit and retry guidance.
5xxInspect the error and usage record before retrying a paid operation.

Examples

Official example · Live API.SH response · Minimal request

Example from the provider's documentation. Field values in your results will differ.

  1. Prepare your environment

    Use a terminal with cURL installed.

    Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.

    Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.

    Terminal · macOS / Linux
    printf 'OpenAny API key: '
    read -r -s OPENANY_API_KEY
    export OPENANY_API_KEY
    printf '\n'
  2. Run the request

    Paste the complete command below into your terminal.

    Values to replace before running 19

    Review these request fields before running. Keep the published provider and request method unchanged.

    from
    Departure station: a station id from /trenitalia/v1/stations or a name (the best match is used).
    to
    Arrival station: an id or a name.
    date
    Departure day, YYYY-MM-DD. Give this or `days_ahead`.
    days_ahead
    Departure day as days from today (0-365), when `date` is not given.
    time
    Earliest departure, HH:MM (default 00:00).
    adults
    Adults (default 1).
    children
    Children (default 0).
    trains
    `all` (default), `frecce`, `regional` or `intercity`.
    direct
    `1` for trains without changes only.
    best_fare
    `1` to price each train with its best fare.
    bike
    `1` for trains that carry bikes.
    sort
    `departure` (default), `arrival` or `fastest`.
    offset
    Results to skip. Pass `next_offset` back here.
    limit
    Trains per page (1-10, default 10).
    raw
    0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
    fields
    Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
    fresh
    1 skips the 24-hour cache and fetches live.
    output
    JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
    records
    With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.
    Terminal · cURL
    curl \
      'https://api.openany.si/v1/agent-apis/apish/trenitalia/v1/search?days_ahead=30&from=Roma+Termini&limit=1&output=json&raw=0&time=08%3A00&to=Milano+Centrale' \
      -X GET \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json'
  3. Check the response

    Sample response · Documented HTTP 200

    Sample response
    {
      "applied_filters": {
        "best_fare": false,
        "bike": false,
        "direct": false,
        "sort": "departure",
        "trains": "all"
      },
      "cached": false,
      "count": 1,
      "credits_used": 1,
      "date": "2026-12-19",
      "fetched_at": "2026-11-19T12:25:41.228Z",
      "from": {
        "id": 830008409,
        "name": "Roma Termini"
      },
      "messages": [],
      "next_offset": 1,
      "offset": 0,
      "passengers": {
        "adults": 1,
        "children": 0
      },
      "solutions": [
        {
          "arrival": "2026-12-19T11:51:00.000+01:00",
          "changes": 0,
          "classes": [
            {
              "leg": "Frecciarossa 9516",
              "leg_id": "xf2e88d54-3b86-4427-a4b2-3f5ac7d26bff",
              "services": [
                {
                  "description": "Reclining upholstered or faux-leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The Café/Snack Bar is always available in coach 5 for all train passengers.",
                  "group": "STANDARD",
                  "name": "STANDARD",
                  "offers": [
                    {
                      "can_change": true,
                      "can_refund": true,
                      "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                      "loyalty_program": true,
                      "name": "BASE",
                      "price": {
                        "amount": 95,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 236,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": true,
                      "can_refund": false,
                      "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Economy",
                      "price": {
                        "amount": 74.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 236,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Super Economy",
                      "price": {
                        "amount": 49.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 236,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Offer reserved for CartaFreccia holders under 30 years of age. No ticket changes or refunds permitted. Subject to seat availability.",
                      "loyalty_program": false,
                      "name": "FrecciaYOUNG",
                      "price": {
                        "amount": 39,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 236,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                      "loyalty_program": false,
                      "name": "FrecciaSENIOR",
                      "price": {
                        "amount": 49,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 236,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": false,
                      "name": "FrecciaDAYS",
                      "price": null,
                      "seats_available": 0,
                      "status": "SOLD_OUT"
                    }
                  ]
                },
                {
                  "description": "Reclining leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. A service to welcome you on board, with savoury and sweet snacks. The FRECCIABistrò in coach 5 remains available to all train passengers.",
                  "group": "PREMIUM",
                  "name": "PREMIUM",
                  "offers": [
                    {
                      "can_change": true,
                      "can_refund": true,
                      "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                      "loyalty_program": true,
                      "name": "BASE",
                      "price": {
                        "amount": 112,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 48,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": true,
                      "can_refund": false,
                      "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Economy",
                      "price": {
                        "amount": 80.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 48,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Super Economy",
                      "price": {
                        "amount": 52.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 48,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                      "loyalty_program": false,
                      "name": "FrecciaSENIOR",
                      "price": {
                        "amount": 54,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 48,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": false,
                      "name": "FrecciaDAYS",
                      "price": null,
                      "seats_available": 0,
                      "status": "SOLD_OUT"
                    }
                  ]
                },
                {
                  "description": "More space for your journey. Spacious single and double reclining leather seats. Seats are spaced more than one metre apart. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
                  "group": "BUSINESS",
                  "name": "BUSINESS",
                  "offers": [
                    {
                      "can_change": true,
                      "can_refund": true,
                      "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                      "loyalty_program": true,
                      "name": "BASE",
                      "price": {
                        "amount": 129,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 104,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": true,
                      "can_refund": false,
                      "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Economy",
                      "price": {
                        "amount": 93.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 104,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Super Economy",
                      "price": {
                        "amount": 59.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 104,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                      "loyalty_program": false,
                      "name": "FrecciaSENIOR",
                      "price": {
                        "amount": 59,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 104,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "FrecciaDAYS",
                      "price": {
                        "amount": 51.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 33,
                      "status": "SALEABLE"
                    }
                  ]
                },
                {
                  "description": "Maximum relaxation and no mobile phone use. Large single and double leather seats equipped with electric reclining systems and adjustable headrests. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel info and entertainment. No mobile phone use. The FrecciaBistrò in coach 5 remains available to all train passengers.",
                  "group": "BUSINESS",
                  "name": "BUSINESS AREA SILENZIO",
                  "offers": [
                    {
                      "can_change": true,
                      "can_refund": true,
                      "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                      "loyalty_program": true,
                      "name": "BASE",
                      "price": {
                        "amount": 129,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 11,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": true,
                      "can_refund": false,
                      "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Economy",
                      "price": {
                        "amount": 93.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 11,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Super Economy",
                      "price": {
                        "amount": 59.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 11,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "This offer is reserved for CartaFreccia holders aged 60 or over (the passenger travelling under this offer must be the CartaFRECCIA cardholder). No ticket changes or refunds permitted. Subject to seat availability.",
                      "loyalty_program": false,
                      "name": "FrecciaSENIOR",
                      "price": {
                        "amount": 59,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 11,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "FrecciaDAYS",
                      "price": {
                        "amount": 51.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 11,
                      "status": "SALEABLE"
                    }
                  ]
                },
                {
                  "description": "Maximum privacy. Reserved Area with 4 large, reclining, leather seats. Individual electrical sockets. Complimentary on-board Wi-Fi and access to the FRECCIAPlay. Screen for travel information and entertainment. The FrecciaBistrò in coach 5 remains available to all train passengers.",
                  "group": "BUSINESS",
                  "name": "BUSINESS SALOTTINO",
                  "offers": [
                    {
                      "can_change": true,
                      "can_refund": true,
                      "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                      "loyalty_program": true,
                      "name": "BASE",
                      "price": {
                        "amount": 139,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 4,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": true,
                      "can_refund": false,
                      "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Economy",
                      "price": {
                        "amount": 102.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 4,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": false,
                      "can_refund": false,
                      "description": "Reservation change and refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Super Economy",
                      "price": {
                        "amount": 65.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 4,
                      "status": "SALEABLE"
                    }
                  ]
                },
                {
                  "description": "The Executive travel experience features an exclusive welcome with the utmost care, class and taste, at any time of the day. Maximum comfort. 8 large single leather seats with spacious reclining backrests and extendable leg rests, spaced 150 cm apart. Individual electrical sockets. Complimentary access to our Wi-Fi internet service and the FRECCIAPlay. Screen for travel information and entertainment. For more details, please consult the Trenitalia website: www.trenitalia.com",
                  "group": "EXECUTIVE",
                  "name": "EXECUTIVE",
                  "offers": [
                    {
                      "can_change": true,
                      "can_refund": true,
                      "description": "This ticket allows unlimited booking changes prior to departure. For Frecce Trains, if the Base price level originally paid is not available, you are required to request a ticket change and pay the resulting price difference. Refund with deduction.",
                      "loyalty_program": true,
                      "name": "BASE",
                      "price": {
                        "amount": 295,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 7,
                      "status": "SALEABLE"
                    },
                    {
                      "can_change": true,
                      "can_refund": false,
                      "description": "Reservation change allowed before departure. Refund not allowed. Limited seats",
                      "loyalty_program": true,
                      "name": "Economy",
                      "price": {
                        "amount": 250.9,
                        "currency": "EUR",
                        "indicative": false,
                        "original_amount": null
                      },
                      "seats_available": 3,
                      "status": "SALEABLE"
                    }
                  ]
                }
              ]
            }
          ],
          "departure": "2026-12-19T08:05:00.000+01:00",
          "destination": "Milano Centrale",
          "duration": "3h 46min",
          "id": "xce005fff-7144-4756-b78a-e0446b288a2b",
          "legs": [
            {
              "arrival": "2026-12-19T11:51:00.000+01:00",
              "departure": "2026-12-19T08:05:00.000+01:00",
              "destination": "Milano Centrale",
              "origin": "Roma Termini",
              "train": {
                "acronym": "FR",
                "brand": "FRECCIAROSSA",
                "category": "Frecciarossa",
                "number": "9516",
                "urban": false
              }
            }
          ],
          "loyalty_points": 49.9,
          "messages": [],
          "next_day": false,
          "origin": "Roma Termini",
          "price_from": {
            "amount": 49.9,
            "currency": "EUR",
            "indicative": false,
            "original_amount": null
          },
          "seat_map": true,
          "status": "SALEABLE",
          "trains": [
            {
              "acronym": "FR",
              "brand": "FRECCIAROSSA",
              "category": "Frecciarossa",
              "number": "9516",
              "urban": false
            }
          ]
        }
      ],
      "time": "08:00",
      "to": {
        "id": 830001700,
        "name": "Milano Centrale"
      }
    }

Common questions

Do I need a separate key for every provider?

Use your OpenAny API key for standard API access. Read it from OPENANY_API_KEY in your environment and keep it out of prompts, source code and logs.

Are these providers interchangeable?

No. Each offering has its own inputs, pricing and response contract. Selecting a catalog offering does not establish automatic routing or fallback. Confirm the service contract before calling.

How is this API billed?

API-key calls use your shared balance at the selected implementation's published rate. Check the billing unit and request-specific pricing rules before making a paid call. Recorded usage determines the final charge under that contract.

Where do the price and contract come from?

The selected implementation publishes its provider, request contract, revision and billing rules through OpenAny's public API catalog. A revision number identifies a contract version, not a price update date. A price update timestamp is not supplied; do not treat a page date as one.

How do OpenAny Balance and x402 differ?

OpenAny Balance uses an API key and one shared balance. Card, USDC and x402 top-ups, card auto top-up and USDC subscriptions fund that balance; available routes appear on the Credits page. Direct x402 is a separate pay-per-request flow, available only on listings that show it and requiring an authorized payment client.

Does Playground send a paid request?

Yes. After you sign in, Run sends a real API request using an active OpenAny API key. Charges follow the published API contract and use your shared balance. Selecting an implementation, editing inputs and viewing sample responses do not send requests.

Use Trenitalia train search API with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.