{"source":"banenor","operation":"get_train","description":"Current status of one train by its national train number: every stop\nwith planned, expected and actually observed times and platforms. Signature: get_train(train_number: string, required; date: string, optional, default None; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0).","signature":"get_train(train_number: string, required; date: string, optional, default None; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0)","parameters":[{"name":"train_number","type":"string","schema":{"type":"string"},"required":true,"default":null,"description":"The train number, e.g. \"605\" (Oslo S-Bergen), \"43\" (Dovrebanen). This is the number shown on tickets and boards (VY 605 -> \"605\"). Freight trains are included - something neither Entur nor other public APIs offer.","unit":null},{"name":"date","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"Optional \"YYYY-MM-DD\" to disambiguate when the same number runs on several days inside Bane NOR's data horizon (roughly the current day). Default: all matches.","unit":null},{"name":"limit","type":"integer","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"display_type":"integer","required":false,"default":25,"description":"Maximum list items returned by the gateway (default 25, maximum 100).","unit":"items"},{"name":"offset","type":"integer","schema":{"type":"integer","minimum":0,"default":0},"display_type":"integer","required":false,"default":0,"description":"Number of list items to skip before returning the page.","unit":"items"}],"json_get_url_template":"https://allemannsdata.com/wiki/api/v1/kilder/banenor/get_train?train_number={train_number}&date={date}&limit=25&offset=0","schema_scope":"#/data in the successful operation envelope","response_schema":{"type":"object","properties":{"train_number":{"type":"string"},"match_count":{"type":"integer"},"matches":{"type":"array","items":{"type":"object","properties":{"train":{"type":"string"},"line":{"type":"string"},"operator":{"type":"string"},"product":{"type":"string"},"service":{"type":"string"},"origin":{"type":"string"},"destination":{"type":"string"},"date":{"type":"string"},"calls":{"type":"array","items":{"type":"object","properties":{"station":{"type":"string"},"name":{"type":"string"},"aimed_arrival":{"type":"string","format":"date-time"},"expected_arrival":{"type":"string","format":"date-time"},"actual_arrival":{"type":"string","format":"date-time"},"arrival_status":{"type":"string"},"arrival_platform":{"type":"string"},"aimed_departure":{"type":"string","format":"date-time"},"expected_departure":{"type":"string","format":"date-time"},"actual_departure":{"type":"string","format":"date-time"},"departure_status":{"type":"string"},"departure_platform":{"type":"string"}},"additionalProperties":false}}},"additionalProperties":false}},"attribution":{"type":"string"}},"additionalProperties":false,"required":["train_number","match_count","matches","attribution"]},"response_schema_status":{"status":"declared","codegen_safe":true,"description":"Maintained response contract."},"entity_projection":{"status":"projected","entity_types":["rail_station"],"description":"Recognized records and stable operation identifiers are projected; an empty array means the successful payload contained no recognizable entity."},"error_contract":{"scope":"top-level HTTP error response; never part of a success payload","schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"details":{"type":"object"}},"additionalProperties":false,"required":["code","message","retryable"]},"suggestion":{"type":"string"},"_meta":{"type":"object","properties":{"retrieved_at":{"type":"string","format":"date-time"},"language":{"type":"string","const":"en"},"content_languages":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object"}}},"required":["retrieved_at","language","content_languages","sources"]},"_links":{"type":"object","properties":{"self":{"type":"string","format":"uri"},"api_index":{"type":"string","format":"uri"},"feedback":{"type":"string","format":"uri"}},"required":["self","api_index","feedback"],"additionalProperties":false}},"additionalProperties":false,"required":["error","suggestion","_meta","_links"]},"statuses":{"400":{"codes":["MISSING_PARAMETER","INVALID_PARAMETER","INVALID_REQUEST"],"retryable":false},"404":{"codes":["SOURCE_NOT_FOUND","OPERATION_NOT_FOUND","ENTITY_NOT_FOUND"],"retryable":false},"429":{"codes":["RATE_LIMITED","GATEWAY_RATE_LIMITED"],"retryable":true},"502":{"codes":["SOURCE_UNAVAILABLE"],"retryable":true},"500":{"codes":["INTERNAL_ERROR"],"retryable":true}}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/banenor/get_train","operation":"https://allemannsdata.com/wiki/api/v1/kilder/banenor/get_train","source":"https://allemannsdata.com/wiki/api/v1/kilder/banenor","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"},"output_fields":["train_number","match_count","matches","matches[].train","matches[].line","matches[].operator","matches[].product","matches[].service","matches[].origin","matches[].destination","matches[].date","matches[].calls","matches[].calls[].station","matches[].calls[].name","matches[].calls[].aimed_arrival","matches[].calls[].expected_arrival","matches[].calls[].actual_arrival","matches[].calls[].arrival_status","matches[].calls[].arrival_platform","matches[].calls[].aimed_departure","matches[].calls[].expected_departure","matches[].calls[].actual_departure","matches[].calls[].departure_status","matches[].calls[].departure_platform","attribution"],"output_fields_truncated":false,"canonical_field_aliases":{"date":["matches[].date"],"name":["matches[].calls[].name"]},"response_example":{"source":"banenor","operation":"get_train","parameters":{"train_number":"example value","date":"2026-01-15"},"data":{"train_number":"example value","match_count":1,"matches":[{"train":"example value","line":"example value","operator":"example value","product":"example value","service":"example value","origin":"example value","destination":"example value","date":"2026-01-15","calls":[{"station":"example value","name":"Example","aimed_arrival":"2026-01-15T12:00:00Z","expected_arrival":"2026-01-15T12:00:00Z","actual_arrival":"2026-01-15T12:00:00Z","arrival_status":"example value","arrival_platform":"example value","aimed_departure":"2026-01-15T12:00:00Z","expected_departure":"2026-01-15T12:00:00Z","actual_departure":"2026-01-15T12:00:00Z","departure_status":"example value","departure_platform":"example value"}]}],"attribution":"example value"},"entities":[],"_meta":{"retrieved_at":"2026-01-15T12:00:00Z","language":"en","content_languages":["en"],"sources":[{"id":"banenor","name":"Bane NOR train data","description":"Real-time station boards, train movements and rail disruptions from the infrastructure manager.","cache_ttl_seconds":30,"documentation":"https://www.banenor.no/reise-og-trafikk/apne-data/"}]},"_provenance":{"data":{"source":"banenor","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/banenor"},"entities":{"source":"banenor","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/banenor","derived_from":"#/data","description":"Normalized projection of data."}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/banenor/get_train","source":"https://allemannsdata.com/wiki/api/v1/kilder/banenor","wiki":"https://allemannsdata.com/wiki/kilder/banenor/get_train/","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"}}}
