Discover/NS International API
live

NS International APInsinternational.nl

Look up international train stations, browse per-day lowest fares, and retrieve priced itineraries sold by NS International via a simple REST API.

Endpoint health
verified 2h ago
search_stations
get_price_calendar
search_train_offers
3/3 passing latest checkself-healing
Endpoints
3
Updated
3h ago

What is the NS International API?

The NS International API exposes 3 endpoints covering station lookup, price calendars, and bookable train itineraries on the NS International network. Use search_stations to resolve any partial station name to a 5-letter station_code, then pass that code to get_price_calendar for a 300+ day fare overview or to search_train_offers to retrieve priced departure options with class and flexibility variants in EUR.

This call costs1 credit / call— charged only on success
Try it
Full or partial station/city name in any spelling the site knows (Dutch or local), minimum 2 characters observed to return results.
api.parse.bot/scraper/39f1ff74-3ac4-446d-856c-1959243053cd/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/39f1ff74-3ac4-446d-856c-1959243053cd/search_stations?name=Paris' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace nsinternational-nl-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: NS International — find stations, check fares, browse itineraries."""
from parse_apis.nsinternational_nl_api import NsInternational, InputNotFound

client = NsInternational()

# Find the station code for Paris (needed by every other endpoint).
station = client.stations.search(name="Paris", limit=5).first()
if station is None:
    raise SystemExit("no station matched")
print(station.name, station.station_code, station.country_code)

# Pull the price calendar for Amsterdam → Paris and pick a cheap bookable day.
calendar = client.price_calendars.get(origin="NLASC", destination=station.station_code)
print(f"{calendar.days_with_price} of {calendar.count} days have a price")

cheap_day = None
if calendar.days is not None:
    for day in calendar.days:
        if day.lowest_price is not None:
            cheap_day = day
            break  # first priced day is enough
if cheap_day is not None:
    print(cheap_day.date, f"€{cheap_day.lowest_price}", cheap_day.price_category)

# Search itineraries for that date, capped to the first few results.
if cheap_day is not None:
    try:
        for itin in client.itineraries.search(
            origin="NLASC",
            destination=station.station_code,
            travel_date=cheap_day.date,
            limit=3,
        ):
            print(
                itin.origin.name, "→", itin.destination.name,
                itin.duration, f"changes={itin.number_of_changes}",
                f"from €{itin.lowest_price}" if itin.lowest_price is not None else "sold out",
            )
            for offer in itin.offers:
                print(f"  {offer.name} class {offer.class_level} €{offer.total_price}")
    except InputNotFound:
        print("route not found for", cheap_day.date)

print("exercised: stations.search / price_calendars.get / itineraries.search")
All endpoints · 3 totalmissing one? ·

Searches stations, cities and points of interest by (partial) name and returns matching stations with their station_code, the identifier accepted by get_price_calendar and search_train_offers. One upstream request; results are not paginated (the site returns at most a handful of matches ordered by relevance). Names are returned in Dutch where the site has a Dutch name (e.g. 'Parijs'), with other-language spellings in aliases. type is set only for special places (agglo-station, airport, theme-park, top-destination) and null for ordinary stations. An unknown name yields an empty stations list.

Input
ParamTypeDescription
namerequiredstringFull or partial station/city name in any spelling the site knows (Dutch or local), minimum 2 characters observed to return results.
Response
{
  "type": "object",
  "fields": {
    "count": "number of stations returned",
    "query": "the name searched for (trimmed)",
    "stations": "array of matching stations; each has station_code (5-letter code used by the other endpoints), name, type (nullable category), aliases (array of alternate names), country_code (2-letter, from the station code), longitude, latitude"
  },
  "sample": {
    "data": {
      "count": 2,
      "query": "Paris",
      "stations": [
        {
          "name": "Parijs",
          "type": "agglo-station",
          "aliases": [
            "Paris"
          ],
          "latitude": 48.861496,
          "longitude": 2.33368,
          "country_code": "FR",
          "station_code": "FRPAR"
        },
        {
          "name": "Paliseul",
          "type": null,
          "aliases": [],
          "latitude": 49.895156,
          "longitude": 5.118718,
          "country_code": "BE",
          "station_code": "BEPLS"
        }
      ]
    },
    "status": "success"
  }
}

About the NS International API

Station Search

search_stations accepts a partial or full station name (minimum 2 characters, Dutch or local spelling) and returns an array of matching stations. Each station object includes a station_code (a 5-letter identifier), name, type, and aliases. This code is the required input for both other endpoints, so station lookup is typically the first call in any workflow.

Price Calendar

get_price_calendar takes an origin and destination station_code and returns one row per calendar day from today through roughly 10 months ahead — typically 300 or more rows. Each day carries a lowest_price (EUR, nullable) and a price_category band from the site (LOWEST, AVERAGE, or similar). The response also surfaces days_with_price, letting you quickly count how many dates have available fares without iterating the full array. This endpoint is suited for flexible-date fare searches and price-trend analysis.

Train Offers

search_train_offers queries concrete departures for a travel_date and optional departure_time. Each itinerary in the response includes itinerary_id, bookable_status (BOOKABLE, NOT_BOOKABLE_SOLD_OUT, NOT_BOOKABLE_NO_SERVICE), origin and destination station details, and an array of priced offers broken down by ticket class and flexibility tier. The travelers parameter accepts comma-separated age codes (S_65 for senior, YOUNG for youth, etc., up to 9 travelers), so you can price multi-traveler or mixed-age groups. Pagination is handled via an opaque next_cursor field — pass it back in a subsequent call to retrieve later departures on the same date.

Reliability & maintenanceVerified

The NS International API is a managed, monitored endpoint for nsinternational.nl — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when nsinternational.nl changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official nsinternational.nl API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
2h ago
Latest check
3/3 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Find the cheapest days to travel between two cities using get_price_calendar's lowest_price and price_category fields
  • Build a fare-alert tool that monitors price_category changes across the 300-day calendar for a given route
  • Display real-time departure boards with bookable_status and itinerary departure/arrival times from search_train_offers
  • Price multi-passenger bookings by passing mixed age codes via the travelers parameter in search_train_offers
  • Resolve ambiguous city names to exact station_codes using search_stations before querying fares
  • Compare first-class vs second-class ticket prices across flexibility tiers using the priced offers in each itinerary
  • Identify sold-out or suspended services on a route by filtering itineraries on bookable_status values
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo2005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min
Team$300/mo20,000300 req/min
Company$1,000/mo100,000500 req/min

Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does NS International offer an official public developer API?+
NS International does not publish a documented public developer API for consumers. NS (the domestic carrier) offers a separate developer portal at ns.nl/en/contact/ns-api, but that covers Dutch domestic services and is distinct from the international booking site.
What does get_price_calendar actually return, and how far ahead does it cover?+
It returns one record per calendar day from today through the end of the bookable horizon — typically around 10 months, producing 300 or more rows. Each row has a date in YYYY-MM-DD format, a lowest_price in EUR (or null when no fare is available), and a price_category band. The response-level field days_with_price tells you how many of those rows carry a non-null price.
How does pagination work in search_train_offers?+
The endpoint returns a page of itineraries starting at or after the requested departure_time. If more departures exist later that day, the response includes a non-null next_cursor string. Pass that value as the cursor parameter in your next request — all other parameters stay the same — to retrieve the following page. When next_cursor is null, there are no further departures to retrieve for that date.
Does the API cover return trips or multi-leg journeys?+
The current endpoints cover one-way trips only. get_price_calendar and search_train_offers each take a single origin–destination pair and a single travel_date. Return-trip pricing and multi-leg routing are not exposed. You can fork this API on Parse and revise it to add a return-journey endpoint if your use case requires it.
Are seat availability counts or specific seat maps returned?+
No seat-level data is returned. The search_train_offers response indicates whether an itinerary is BOOKABLE, NOT_BOOKABLE_SOLD_OUT, or NOT_BOOKABLE_NO_SERVICE at the itinerary level, but does not include remaining seat counts or carriage/seat maps. You can fork this API on Parse and revise it to surface any additional availability detail if the source exposes it elsewhere.
Page content last updated . Spec covers 3 endpoints from nsinternational.nl.
Related APIs in TravelSee all →
9292.nl API
Plan trips across Dutch trains, buses, trams, metros, and ferries by searching for locations and getting detailed journey information including travel times and costs. Find the best routes through the Netherlands' public transport network with real-time trip planning.
trainline.eu API
Search for train stations and routes across the UK and Europe, then find and compare available journeys with schedules and pricing. Book your ideal train trip by accessing real-time travel options directly from Trainline.com.
thetrainline.com API
Search UK train stations and find the cheapest fares across date ranges, then generate direct booking links to complete your purchase on Trainline.com. Get real-time journey information to compare prices and book your tickets in seconds.
bahn.de API
Access data from bahn.de.
nationalrail.co.uk API
Check live train departure and arrival times at UK stations, search for specific stations, and get real-time service disruption alerts. Stay informed about rail service delays and changes to plan your journeys efficiently.
bahn.com API
Search German train schedules and stations, find connections between destinations, and compare ticket prices across Deutsche Bahn routes. Get real-time station information and transit association details to plan your train journey efficiently.
trenitalia.com API
Search for trains across Italy, check real-time train status and delays, view station departure and arrival boards, and find available tickets all in one place. Get live traffic information and detailed train itineraries to plan your journey with complete visibility into schedules and service disruptions.
amtrak.com API
Search for Amtrak trains across stations, compare fares, and discover discounts to plan your rail journey with current pricing and availability. Get detailed train information, autocomplete station names, and find the cheapest routes for your travel dates.