> For the complete documentation index, see [llms.txt](https://homey-nederlandse-spoorwegen.gitbook.io/docs-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://homey-nederlandse-spoorwegen.gitbook.io/docs-en/guides/getting-started.md).

# Getting started

From zero to a working NS device in five minutes.

## 1 · Get an NS API key

Travel data lives behind the [NS API Developer Portal](https://apiportal.ns.nl/) and you need a personal subscription key to access it. The key is **free**.

The full click-by-click walkthrough is in its own page:

{% content-ref url="/pages/40ADWJCHddP0UaLkZ7SE" %}
[Get your NS API key](/docs-en/guides/ns-api-key.md)
{% endcontent-ref %}

In short: register on apiportal.ns.nl, subscribe to the **Ns-App** product, and copy the **primary key** from your profile. Come back here once you have the key on your clipboard.

## 2 · Install the app and paste the key

1. Install the NS app on your Homey.
2. In the Homey app, open the NS app and tap **Configure app**.
3. Paste your subscription key into the **API key** field.
4. Tap **Test connection**. You should see a green success message.

If the test fails, double-check that you copied the **primary** key (not the secondary), and that you actually subscribed to the Ns-App product — without a subscription the key won't work.

## 3 · Pair your first device

The app ships two device types — pick whichever matches what you want to automate.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Station</strong></td><td>Track all departures from a single station, optionally filtered by destination text.</td><td><a href="/docs-en/devices/station.md">Station</a></td></tr><tr><td><strong>Trip</strong></td><td>Track a single A→B route. Use this if you have a regular commute.</td><td><a href="/docs-en/devices/trip.md">Trip</a></td></tr></tbody></table>

In Homey: **Devices → Add device → NS → \[Station or Trip]**.

## 4 · Build your first flow

A starting suggestion: notify yourself if your next train home is delayed.

**When**: *Next train delayed by more than \[10] minutes* (Trip device) **Then**: *Send push notification: "Next train at {{departure\_time}} is +{{delay\_minutes}} min"*

See [flow cards](/docs-en/reference/flow-cards.md) for everything available.

## 5 · Tune the refresh interval (optional)

Each device has a **Refresh interval** setting:

* **Station** — default 60 s, minimum 60 s.
* **Trip** — default 120 s, minimum 120 s.

Lower means fresher data and more API calls; the minimums keep you safely within typical NS API quotas. See the [rate limits guide](/docs-en/guides/rate-limits.md) for the trade-off.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://homey-nederlandse-spoorwegen.gitbook.io/docs-en/guides/getting-started.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
