Data source: Entur
Overview
Entur (Norwegian Transit) wraps Entur, handling authentication, pagination, and rate limits for you. This tutorial covers all 3 tools with working code examples you can copy and run.
Prerequisites
- Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
- Choose your integration method: MCP protocol or REST API.
Connect via MCP
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"gnist-entur": {
"url": "https://context.gnist.ai/mcp/entur/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Tools (3)
search_stops
Search for transit stops by name. Args: query: Stop name or partial name to search for. lat: Optional latitude to boost nearby results. lon: Optional longitude to boost nearby results. limit: Maximum number of results (default 5). Returns: List of stops with id, name, lat, lon, description.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Stop name or partial name to search for. |
lat | any | optional | Optional latitude to boost nearby results. |
lon | any | optional | Optional longitude to boost nearby results. |
limit | integer | optional | Maximum number of results (default 5). (default: 5) |
curl -X POST "https://context.gnist.ai/mcp/entur/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_stops", "arguments": {"query": "renewable energy"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/entur/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'query': 'renewable energy'}, 'name': 'search_stops'}},
)
print(resp.json())
get_departures
Get upcoming departures from a transit stop. Args: stop_id: The stop ID (e.g. NSR:StopPlace:59872 for Oslo S). Use search_stops to find IDs. limit: Maximum number of departures (default 10). Returns: List of departures with line, destination, expected_departure, aimed_departure, realtime, transport_mode, platform.
| Parameter | Type | Required | Description |
|---|---|---|---|
stop_id | string | required | The stop ID (e.g. NSR:StopPlace:59872 for Oslo S). Use search_stops to find IDs. |
limit | integer | optional | Maximum number of departures (default 10). (default: 10) |
curl -X POST "https://context.gnist.ai/mcp/entur/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_departures", "arguments": {"stop_id": "NSR:StopPlace:59872"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/entur/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'stop_id': 'NSR:StopPlace:59872'},
'name': 'get_departures'}},
)
print(resp.json())
report_feedback
Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: general) |
curl -X POST "https://context.gnist.ai/mcp/entur/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/entur/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())
Common Patterns
Use
search_stops to find items, then get_departures to get full details. This two-step pattern is common for exploring data before drilling down.Several tools support
limit, offset, or page parameters. Start with small limits during development, then increase for production queries.FAQ
What data does Entur (Norwegian Transit) provide?
Norwegian public transit — routes, stops, departures, and journey planning. It exposes 3 tools: search_stops, get_departures, report_feedback.
What do I need to get started?
A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.
What format does the Entur (Norwegian Transit) API return?
JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.