mta.subway.direction() — resolve a destination to a direction
Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.
The mta.subway.direction method resolves a rider-facing destination string (such as "Union Sq") into a typed direction of travel, the terminal the train heads toward, and a ready-to-display label. Use it when a rider tells you where they want to go and you need to translate that into the north / south direction the realtime feed uses — for example, to pre-select the correct direction in an arrivals UI.This method requires a hosted API key. It resolves destinations against the hosted API’s static GTFS route order and is not available in direct-feed mode.
mta.subway.direction(params)
Parameters
routestringrequiredThe subway route the rider is traveling on (for example, 'L').fromStopIdstringrequiredThe stop ID the rider is departing from (for example, 'L08' for Bedford Av).destinationstringrequiredA rider-facing destination string to resolve against the route’s stop order (for example, 'Union Sq'). Matching tolerates casing and common station-name variations.
TypeScript signature
interface SubwayDirectionQuery { route: SubwayRoute fromStopId: SubwayStopId destination: string}// Subway feed directions are always north/south, even on east-west linestype SubwayResolvedDirection = 'north' | 'south'interface SubwayDirectionResolution { route: Route destination: string // the string you passed in normalizedDestination: string // cleaned form used for matching resolved: boolean // whether a direction was determined direction?: SubwayResolvedDirection displayDirection?: string // e.g. "toward 8 Av" terminal?: string // terminal station the train heads toward fromStop?: Stop destinationStop?: Stop matches?: Stop[] // candidate stops when the match is ambiguous reason?: string // why resolution failed, when resolved is false}mta.subway.direction(params: SubwayDirectionQuery): Promise<SubwayDirectionResolution>
The method always resolves to a SubwayDirectionResolution object — it does not return null. Branch on resolved: when true, direction, displayDirection, terminal, and destinationStop are populated; when false, reason explains why, and matches may list ambiguous candidates.
Response fields
routeRouterequiredThe resolved route object: id, plus optional shortName, longName, color, textColor, and type.destinationstringrequiredThe destination string exactly as passed in.normalizedDestinationstringrequiredThe cleaned/normalized form of the destination used for matching.resolvedbooleanrequiredWhether a direction was successfully determined. When false, inspect reason and matches.directionstringThe resolved feed direction: 'north' or 'south'. Present when resolved is true.displayDirectionstringA human-readable label such as "toward 8 Av". Present when resolved is true.terminalstringThe name of the terminal station the train heads toward in the resolved direction.fromStopStopThe resolved origin stop object for fromStopId.destinationStopStopThe resolved destination stop object that matched destination.matchesStop[]Candidate stops when the destination is ambiguous and could not be narrowed to a single stop.reasonstringA short explanation of why resolution failed. Present when resolved is false.
Code example
import { MTA } from 'mta-js'const mta = new MTA({ apiKey: process.env.MTA_API_KEY })// A rider at Bedford Av (L08) wants to reach Union Sq — which way do they go?const resolution = await mta.subway.direction({ route: 'L', fromStopId: 'L08', destination: 'Union Sq',})if (resolution.resolved) { console.log(resolution.direction) // "north" console.log(resolution.displayDirection) // "toward 8 Av" console.log(resolution.terminal) // "8 Av" // Feed the resolved direction straight into arrivals const arrivals = await mta.subway.arrivals({ stopId: 'L08', route: 'L', direction: resolution.direction, }) console.log(arrivals)} else { console.warn(`Couldn't resolve a direction: ${resolution.reason}`)}
NYC Subway realtime feeds use NYCT’s north / south stop directions, even on east-west lines like the L. mta.subway.direction always resolves to one of those two feed directions, and mta.subway.arrivals accepts the same direction value — along with the rider-facing east / west and uptown / downtown aliases.
This method is only available with a hosted apiKey. It calls the hosted endpoint and resolves against the managed static GTFS snapshot; it is not available in direct-feed mode.
Authorizations
bearerAuthapiKeyAuth
Authorization
string
header
required
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"MTA API","description":"Realtime NYC-area transit data — subway, bus, PATH, NJ Transit, NYC Ferry, Citi Bike, plus 22 more US transit agencies and 7 more bike shares — through one clean API.","colors":{"primary":"#004CB7","light":"#FFFFFF","dark":"#1E3A8A"},"logo":{"light":"https://mintcdn.com/humanintefacedesign/Q8YkInnS90xOtYky/images/logo2.svg?fit=max\u0026auto=format\u0026n=Q8YkInnS90xOtYky\u0026q=85\u0026s=6f8537a6423102044114a3759a1cf764","dark":"https://mintcdn.com/humanintefacedesign/Q8YkInnS90xOtYky/images/logo2.svg?fit=max\u0026auto=format\u0026n=Q8YkInnS90xOtYky\u0026q=85\u0026s=6f8537a6423102044114a3759a1cf764","href":"https://www.mtaapi.dev"},"favicon":"https://mintcdn.com/humanintefacedesign/U9SNkuqnZN8rjCjD/images/favicon-16x16.png?fit=max\u0026auto=format\u0026n=U9SNkuqnZN8rjCjD\u0026q=85\u0026s=5d1bc2d91e7baa872bfc6f9a29447863","api":{"openapi":"openapi.json","params":{"expanded":"all"},"playground":{"display":"interactive","proxy":true},"examples":{"languages":["typescript"],"prefill":true,"autogenerate":false},"url":"full","mdx":{"auth":{"method":"bearer","name":"Authorization"},"server":"https://www.mtaapi.dev"}},"appearance":{"default":"dark"},"background":{"color":{"light":"#fff","dark":"#000"}},"navbar":{"links":[{"href":"https://www.mtaapi.dev/dashboard","label":"Dashboard"},{"href":"https://www.mtaapi.dev/blog","label":"Blog"}],"primary":{"type":"github","href":"https://github.com/HumanInterfaceDesign/mta-js"}},"footer":{"socials":{"github":"https://github.com/HumanInterfaceDesign/mta-js"}},"icons":{"library":"tabler"},"integrations":{"telemetry":{"enabled":false}},"markdown":{"schema":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"humanintefacedesign","hasAudioNarration":false,"actualSubdomain":"humanintefacedesign","customDomains":["mtaapi.dev"],"gitSource":{"type":"github","owner":"humaninterfacedesign","repo":"mta-api","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6ae46ad2f259c4c964c4c6bd"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6af85f7209eaf940fce85a4d","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"API Reference","count":183},{"language":"default","tag":"Regional transit REST","count":171},{"language":"default","tag":"Documentation","count":23},{"language":"default","tag":"Guides","count":13},{"language":"default","tag":"SDK Reference","count":12},{"language":"default","tag":"Get Started","count":6},{"language":"default","tag":"Core Concepts","count":3},{"language":"default","tag":"Self-Hosting","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@mtaapi.dev","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/direction","slug":"/api-reference/direction","pageMetadata":{"title":"mta.subway.direction() — resolve a destination to a direction","description":"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.","sidebarTitle":"Direction","openapi":"openapi.json GET /api/v1/subway/direction","href":"/api-reference/direction"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`mta.subway.direction`}),` method resolves a rider-facing destination string (such as `,_jsx(_components.code,{children:`\"Union Sq\"`}),`) into a typed direction of travel, the terminal the train heads toward, and a ready-to-display label. Use it when a rider tells you `,_jsx(_components.em,{children:`where they want to go`}),` and you need to translate that into the `,_jsx(_components.code,{children:`north`}),` / `,_jsx(_components.code,{children:`south`}),` direction the realtime feed uses — for example, to pre-select the correct direction in an arrivals UI.`]}),`\n`,_jsx(_components.p,{children:`This method requires a hosted API key. It resolves destinations against the hosted API’s static GTFS route order and is not available in direct-feed mode.`}),`\n`,_jsx(Heading,{level:`2`,id:`mta-subway-direction-params`,children:_jsx(_components.code,{children:`mta.subway.direction(params)`})}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`route`}),` `,_jsx(_components.code,{children:`string`}),` `,_jsx(_components.em,{children:`required`})]}),`\n`,_jsxs(_components.p,{children:[`The subway route the rider is traveling on (for example, `,_jsx(_components.code,{children:`'L'`}),`).`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`fromStopId`}),` `,_jsx(_components.code,{children:`string`}),` `,_jsx(_components.em,{children:`required`})]}),`\n`,_jsxs(_components.p,{children:[`The stop ID the rider is departing from (for example, `,_jsx(_components.code,{children:`'L08'`}),` for Bedford Av).`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`destination`}),` `,_jsx(_components.code,{children:`string`}),` `,_jsx(_components.em,{children:`required`})]}),`\n`,_jsxs(_components.p,{children:[`A rider-facing destination string to resolve against the route’s stop order (for example, `,_jsx(_components.code,{children:`'Union Sq'`}),`). Matching tolerates casing and common station-name variations.`]}),`\n`,_jsx(Heading,{level:`3`,id:`typescript-signature`,children:`TypeScript signature`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`interface`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SubwayDirectionQuery`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` route`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SubwayRoute`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` fromStopId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SubwayStopId`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` destination`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Subway feed directions are always north/south, even on east-west lines`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SubwayResolvedDirection`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'north'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'south'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`interface`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SubwayDirectionResolution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` route`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Route`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` destination`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // the string you passed in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` normalizedDestination`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // cleaned form used for matching`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` resolved`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` boolean`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // whether a direction was determined`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` direction`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SubwayResolvedDirection`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` displayDirection`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // e.g. \"toward 8 Av\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` terminal`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // terminal station the train heads toward`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` fromStop`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Stop`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` destinationStop`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Stop`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` matches`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Stop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// candidate stops when the match is ambiguous`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reason`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // why resolution failed, when resolved is false`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`mta`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subway`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`direction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`SubwayDirectionQuery`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`): `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Promise`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`SubwayDirectionResolution`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The method always resolves to a `,_jsx(_components.code,{children:`SubwayDirectionResolution`}),` object — it does not return `,_jsx(_components.code,{children:`null`}),`. Branch on `,_jsx(_components.code,{children:`resolved`}),`: when `,_jsx(_components.code,{children:`true`}),`, `,_jsx(_components.code,{children:`direction`}),`, `,_jsx(_components.code,{children:`displayDirection`}),`, `,_jsx(_components.code,{children:`terminal`}),`, and `,_jsx(_components.code,{children:`destinationStop`}),` are populated; when `,_jsx(_components.code,{children:`false`}),`, `,_jsx(_components.code,{children:`reason`}),` explains why, and `,_jsx(_components.code,{children:`matches`}),` may list ambiguous candidates.`]}),`\n`,_jsx(Heading,{level:`3`,id:`response-fields`,children:`Response fields`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`route`}),` `,_jsx(_components.code,{children:`Route`}),` `,_jsx(_components.em,{children:`required`})]}),`\n`,_jsxs(_components.p,{children:[`The resolved route object: `,_jsx(_components.code,{children:`id`}),`, plus optional `,_jsx(_components.code,{children:`shortName`}),`, `,_jsx(_components.code,{children:`longName`}),`, `,_jsx(_components.code,{children:`color`}),`, `,_jsx(_components.code,{children:`textColor`}),`, and `,_jsx(_components.code,{children:`type`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`destination`}),` `,_jsx(_components.code,{children:`string`}),` `,_jsx(_components.em,{children:`required`})]}),`\n`,_jsx(_components.p,{children:`The destination string exactly as passed in.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`normalizedDestination`}),` `,_jsx(_components.code,{children:`string`}),` `,_jsx(_components.em,{children:`required`})]}),`\n`,_jsx(_components.p,{children:`The cleaned/normalized form of the destination used for matching.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`resolved`}),` `,_jsx(_components.code,{children:`boolean`}),` `,_jsx(_components.em,{children:`required`})]}),`\n`,_jsxs(_components.p,{children:[`Whether a direction was successfully determined. When `,_jsx(_components.code,{children:`false`}),`, inspect `,_jsx(_components.code,{children:`reason`}),` and `,_jsx(_components.code,{children:`matches`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`direction`}),` `,_jsx(_components.code,{children:`string`})]}),`\n`,_jsxs(_components.p,{children:[`The resolved feed direction: `,_jsx(_components.code,{children:`'north'`}),` or `,_jsx(_components.code,{children:`'south'`}),`. Present when `,_jsx(_components.code,{children:`resolved`}),` is `,_jsx(_components.code,{children:`true`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`displayDirection`}),` `,_jsx(_components.code,{children:`string`})]}),`\n`,_jsxs(_components.p,{children:[`A human-readable label such as `,_jsx(_components.code,{children:`\"toward 8 Av\"`}),`. Present when `,_jsx(_components.code,{children:`resolved`}),` is `,_jsx(_components.code,{children:`true`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`terminal`}),` `,_jsx(_components.code,{children:`string`})]}),`\n`,_jsx(_components.p,{children:`The name of the terminal station the train heads toward in the resolved direction.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`fromStop`}),` `,_jsx(_components.code,{children:`Stop`})]}),`\n`,_jsxs(_components.p,{children:[`The resolved origin stop object for `,_jsx(_components.code,{children:`fromStopId`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`destinationStop`}),` `,_jsx(_components.code,{children:`Stop`})]}),`\n`,_jsxs(_components.p,{children:[`The resolved destination stop object that matched `,_jsx(_components.code,{children:`destination`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`matches`}),` `,_jsx(_components.code,{children:`Stop[]`})]}),`\n`,_jsx(_components.p,{children:`Candidate stops when the destination is ambiguous and could not be narrowed to a single stop.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`reason`}),` `,_jsx(_components.code,{children:`string`})]}),`\n`,_jsxs(_components.p,{children:[`A short explanation of why resolution failed. Present when `,_jsx(_components.code,{children:`resolved`}),` is `,_jsx(_components.code,{children:`false`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`code-example`,children:`Code example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`26`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`26`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MTA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'mta-js'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` mta`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` MTA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`MTA_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// A rider at Bedford Av (L08) wants to reach Union Sq — which way do they go?`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` resolution`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` mta`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subway`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`direction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` route:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'L'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fromStopId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'L08'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` destination:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Union Sq'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolved`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`direction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// \"north\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`displayDirection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// \"toward 8 Av\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`terminal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// \"8 Av\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Feed the resolved direction straight into arrivals`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` arrivals`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` mta`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subway`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`arrivals`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stopId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'L08'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` route:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'L'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` direction:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resolution`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`direction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`arrivals`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`warn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Couldn't resolve a direction: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolution`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reason`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`example-response`,children:`Example response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"route\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"L\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"shortName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"L\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"color\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"#A7A9AC\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"destination\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Union Sq\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"normalizedDestination\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"union sq\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"resolved\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"direction\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"north\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"displayDirection\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"toward 8 Av\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"terminal\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"8 Av\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"fromStop\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"L08\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bedford Av\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"destinationStop\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"L02\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"14 St-Union Sq\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`NYC Subway realtime feeds use NYCT’s `,_jsx(_components.code,{children:`north`}),` / `,_jsx(_components.code,{children:`south`}),` stop directions, even on east-west lines like the L. `,_jsx(_components.code,{children:`mta.subway.direction`}),` always resolves to one of those two feed directions, and `,_jsx(_components.a,{href:`/api-reference/subway`,children:_jsx(_components.code,{children:`mta.subway.arrivals`})}),` accepts the same `,_jsx(_components.code,{children:`direction`}),` value — along with the rider-facing `,_jsx(_components.code,{children:`east`}),` / `,_jsx(_components.code,{children:`west`}),` and `,_jsx(_components.code,{children:`uptown`}),` / `,_jsx(_components.code,{children:`downtown`}),` aliases.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`This method is only available with a hosted `,_jsx(_components.code,{children:`apiKey`}),`. It calls the hosted endpoint and resolves against the managed static GTFS snapshot; it is not available in direct-feed mode.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"mta.subway.direction() — resolve a destination to a direction","description":"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.","sidebarTitle":"Direction","openapi":"openapi.json GET /api/v1/subway/direction","href":"/api-reference/direction"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"mta.subway.direction(params)","slug":"mta-subway-direction-params","depth":2,"children":[{"title":"Parameters","slug":"parameters","depth":3,"children":[]},{"title":"TypeScript signature","slug":"typescript-signature","depth":3,"children":[]},{"title":"Response fields","slug":"response-fields","depth":3,"children":[]},{"title":"Code example","slug":"code-example","depth":3,"children":[]},{"title":"Example response","slug":"example-response","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Resolve subway direction from an intermediate destination","description":"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.","tags":["subway"],"parameters":["bb0b1671-0bda-429d-826d-ecc709367586","de8fbf1d-ff1c-47b5-94a8-1d56ad69e8e4","bb65f7d5-59ab-4c5d-a71d-b3e55c9c4516"],"responses":{"200":"9644316c-1ad9-4c11-8978-fa8bc267f828"},"operationId":"getApiV1SubwayDirection","method":"get","type":"path","servers":["0557b014-5191-4d70-bda5-11bc6a54b632"],"security":["63d21101-db75-4fd6-8ace-e7c6b309158b","4c8bf785-780f-4edb-bda9-133cf408118f"],"path":"/api/v1/subway/direction","baseUrlOptions":["https://www.mtaapi.dev"],"title":"Resolve subway direction from an intermediate destination","codeSamples":[],"requestExampleLanguages":["typescript"],"requiredOnlyExamples":false,"disableCodeSampleGeneration":true,"responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[],"urlDisplay":"full"},"dependencies":{"parameters":{"bb0b1671-0bda-429d-826d-ecc709367586":{"name":"route","in":"query","required":true,"schema":{"minLength":1,"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}},"de8fbf1d-ff1c-47b5-94a8-1d56ad69e8e4":{"name":"fromStopId","in":"query","required":true,"schema":{"minLength":1,"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}},"bb65f7d5-59ab-4c5d-a71d-b3e55c9c4516":{"name":"destination","in":"query","required":true,"schema":{"minLength":1,"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}}},"responses":{"9644316c-1ad9-4c11-8978-fa8bc267f828":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["route","destination","normalizedDestination","resolved"],"properties":{"route":{"type":"object","required":["id"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"route.id","typeLabel":"string"},"gtfsId":{"type":"string","uniqueKey":"route.gtfsId","typeLabel":"string"},"shortName":{"type":"string","uniqueKey":"route.shortName","typeLabel":"string"},"longName":{"type":"string","uniqueKey":"route.longName","typeLabel":"string"},"type":{"type":"number","uniqueKey":"route.type","typeLabel":"number"},"color":{"type":"string","uniqueKey":"route.color","typeLabel":"string"},"textColor":{"type":"string","uniqueKey":"route.textColor","typeLabel":"string"}},"isRequired":true,"uniqueKey":"route","typeLabel":"object"},"destination":{"type":"string","isRequired":true,"uniqueKey":"destination","typeLabel":"string"},"normalizedDestination":{"type":"string","isRequired":true,"uniqueKey":"normalizedDestination","typeLabel":"string"},"resolved":{"type":"boolean","isRequired":true,"uniqueKey":"resolved","typeLabel":"boolean"},"direction":{"type":"string","enum":["north","south"],"uniqueKey":"direction","typeLabel":"enum\u003cstring>"},"displayDirection":{"type":"string","uniqueKey":"displayDirection","typeLabel":"string"},"terminal":{"type":"string","uniqueKey":"terminal","typeLabel":"string"},"fromStop":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"fromStop.id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"fromStop.name","typeLabel":"string"},"displayName":{"type":"string","uniqueKey":"fromStop.displayName","typeLabel":"string"},"lat":{"type":"number","uniqueKey":"fromStop.lat","typeLabel":"number"},"lon":{"type":"number","uniqueKey":"fromStop.lon","typeLabel":"number"},"mode":{"enum":["subway","bus","path","nj-transit-rail","nyc-ferry","lirr","metro-north"],"type":"string","uniqueKey":"fromStop.mode","typeLabel":"enum\u003cstring>"},"parentId":{"type":"string","uniqueKey":"fromStop.parentId","typeLabel":"string"}},"uniqueKey":"fromStop","typeLabel":"object"},"destinationStop":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"destinationStop.id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"destinationStop.name","typeLabel":"string"},"displayName":{"type":"string","uniqueKey":"destinationStop.displayName","typeLabel":"string"},"lat":{"type":"number","uniqueKey":"destinationStop.lat","typeLabel":"number"},"lon":{"type":"number","uniqueKey":"destinationStop.lon","typeLabel":"number"},"mode":{"enum":["subway","bus","path","nj-transit-rail","nyc-ferry","lirr","metro-north"],"type":"string","uniqueKey":"destinationStop.mode","typeLabel":"enum\u003cstring>"},"parentId":{"type":"string","uniqueKey":"destinationStop.parentId","typeLabel":"string"}},"uniqueKey":"destinationStop","typeLabel":"object"},"matches":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"matches.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"matches.items.[INDEX].name","typeLabel":"string"},"displayName":{"type":"string","uniqueKey":"matches.items.[INDEX].displayName","typeLabel":"string"},"lat":{"type":"number","uniqueKey":"matches.items.[INDEX].lat","typeLabel":"number"},"lon":{"type":"number","uniqueKey":"matches.items.[INDEX].lon","typeLabel":"number"},"mode":{"enum":["subway","bus","path","nj-transit-rail","nyc-ferry","lirr","metro-north"],"type":"string","uniqueKey":"matches.items.[INDEX].mode","typeLabel":"enum\u003cstring>"},"parentId":{"type":"string","uniqueKey":"matches.items.[INDEX].parentId","typeLabel":"string"}},"uniqueKey":"matches.items.[INDEX]","typeLabel":"object"},"uniqueKey":"matches","typeLabel":"object[]"},"reason":{"type":"string","uniqueKey":"reason","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"route":{"id":"\u003cstring>","gtfsId":"\u003cstring>","shortName":"\u003cstring>","longName":"\u003cstring>","type":123,"color":"\u003cstring>","textColor":"\u003cstring>"},"destination":"\u003cstring>","normalizedDestination":"\u003cstring>","resolved":true,"direction":"north","displayDirection":"\u003cstring>","terminal":"\u003cstring>","fromStop":{"id":"\u003cstring>","name":"\u003cstring>","displayName":"\u003cstring>","lat":123,"lon":123,"mode":"subway","parentId":"\u003cstring>"},"destinationStop":{"id":"\u003cstring>","name":"\u003cstring>","displayName":"\u003cstring>","lat":123,"lon":123,"mode":"subway","parentId":"\u003cstring>"},"matches":[{"id":"\u003cstring>","name":"\u003cstring>","displayName":"\u003cstring>","lat":123,"lon":123,"mode":"subway","parentId":"\u003cstring>"}],"reason":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"63d21101-db75-4fd6-8ace-e7c6b309158b":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","scopes":[],"schemeName":"bearerAuth"}},"4c8bf785-780f-4edb-bda9-133cf408118f":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","scopes":[],"schemeName":"apiKeyAuth"}}},"servers":{"0557b014-5191-4d70-bda5-11bc6a54b632":{"url":"https://www.mtaapi.dev","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API Key","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","scopes":[],"schemeName":"apiKeyAuth"},"schema":{"title":"x-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"apiKeyAuth","name":"x-api-key"}],"title":"apiKeyAuth"}]},"originalFileLocation":"openapi.json"},"subdomain":"humanintefacedesign","siteName":"MTA API","title":"mta.subway.direction() — resolve a destination to a direction - MTA API","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-31T18:19:04.920Z","originalFileLocation":"api-reference/direction.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MTA API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"mta.subway.direction() — resolve a destination to a direction - MTA API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MTA API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://mtaapi.dev/docs/api-reference/direction\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://humanintefacedesign.mintlify.site/docs/_mintlify/api/og/v2?division=SDK+Reference\u0026amp;title=mta.subway.direction%28%29+%E2%80%94+resolve+a+destination+to+a+direction\u0026amp;description=Reference+for+mta.subway.direction+in+mta-js.+Resolve+a+rider-facing+destination+string+into+a+typed+north%2Fsouth+direction%2C+terminal%2C+and+display+label.\u0026amp;theme=0bac45188922c012362b8c6c\u0026amp;signature=16bca1ec22fa4769efea98eb293556a4b5f3d9b1009cba884edd35c31ef4573c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"mta.subway.direction() — resolve a destination to a direction - MTA API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://humanintefacedesign.mintlify.site/docs/_mintlify/api/og/v2?division=SDK+Reference\u0026amp;title=mta.subway.direction%28%29+%E2%80%94+resolve+a+destination+to+a+direction\u0026amp;description=Reference+for+mta.subway.direction+in+mta-js.+Resolve+a+rider-facing+destination+string+into+a+typed+north%2Fsouth+direction%2C+terminal%2C+and+display+label.\u0026amp;theme=0bac45188922c012362b8c6c\u0026amp;signature=16bca1ec22fa4769efea98eb293556a4b5f3d9b1009cba884edd35c31ef4573c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/humanintefacedesign/JAp0EAWeC0Ql7tpl/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MTA API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#004CB7\">\u003clink data-mint-head rel=\"canonical\" href=\"https://mtaapi.dev/docs/api-reference/direction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/direction.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://mtaapi.dev/#organization\",\"name\":\"MTA API\",\"url\":\"https://mtaapi.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/humanintefacedesign/Q8YkInnS90xOtYky/images/logo2.svg?fit=max\u0026auto=format\u0026n=Q8YkInnS90xOtYky\u0026q=85\u0026s=6f8537a6423102044114a3759a1cf764\"}},{\"@type\":\"WebSite\",\"@id\":\"https://mtaapi.dev/docs#website\",\"name\":\"MTA API\",\"url\":\"https://mtaapi.dev/docs\",\"publisher\":{\"@id\":\"https://mtaapi.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://mtaapi.dev/docs/api-reference/direction#webpage\",\"url\":\"https://mtaapi.dev/docs/api-reference/direction\",\"name\":\"mta.subway.direction() — resolve a destination to a direction\",\"description\":\"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.\",\"dateModified\":\"2026-10-31T18:19:04.920Z\",\"isPartOf\":{\"@id\":\"https://mtaapi.dev/docs#website\"},\"breadcrumb\":{\"@id\":\"https://mtaapi.dev/docs/api-reference/direction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://mtaapi.dev/docs/api-reference/direction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDK Reference\",\"item\":\"https://mtaapi.dev/docs/api-reference/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mta.subway.direction() — resolve a destination to a direction\",\"item\":\"https://mtaapi.dev/docs/api-reference/direction\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://mtaapi.dev/docs/api-reference/direction#apireference\",\"headline\":\"mta.subway.direction() — resolve a destination to a direction\",\"name\":\"mta.subway.direction() — resolve a destination to a direction\",\"description\":\"Reference for mta.subway.direction in mta-js. Resolve a rider-facing destination string into a typed north/south direction, terminal, and display label.\",\"url\":\"https://mtaapi.dev/docs/api-reference/direction\",\"mainEntityOfPage\":{\"@id\":\"https://mtaapi.dev/docs/api-reference/direction#webpage\"},\"dateModified\":\"2026-10-31T18:19:04.920Z\",\"publisher\":{\"@id\":\"https://mtaapi.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://mtaapi.dev/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MTA API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"MTA API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/api-reference/direction.md","siteName":"MTA API","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","groups":[{"group":"SDK Reference","pages":[{"title":"mta-js SDK reference: all namespaces and methods","sidebarTitle":"Overview","href":"/api-reference/overview"},{"title":"mta.subway.arrivals() — real-time subway predictions","description":"Reference for mta.subway in mta-js. Fetch real-time arrival predictions for any subway stop and route, with Unix timestamps and direction of travel.","sidebarTitle":"Subway","openapi":"openapi.json GET /api/v1/subway/arrivals","href":"/api-reference/subway"},{"title":"mta.subway.direction() — resolve a destination to a direction","sidebarTitle":"Direction","openapi":"openapi.json GET /api/v1/subway/direction","href":"/api-reference/direction"},{"title":"mta.bus.vehicles() — live bus positions by route","description":"Reference for mta.bus in mta-js. Retrieve live bus vehicle positions, GPS coordinates, heading, next stop, and occupancy for any MTA route.","sidebarTitle":"Bus","openapi":"openapi.json GET /api/v1/bus/vehicles","href":"/api-reference/bus"},{"title":"mta.alerts.current() — active MTA service alerts","sidebarTitle":"Alerts","openapi":"openapi.json GET /api/v1/alerts","href":"/api-reference/alerts"},{"title":"mta.stops.near() — find stops by geolocation","sidebarTitle":"Stops","openapi":"openapi.json GET /api/v1/stops/near","href":"/api-reference/stops"},{"title":"mta.subway.arrivalBoard() — nearby subway departure board","sidebarTitle":"Subway Arrival Board","openapi":"openapi.json GET /api/v1/subway/arrival-board","href":"/api-reference/subway-arrival-board"},{"title":"mta.subway.routeStations() — ordered stations on a route","sidebarTitle":"Subway Route Stations","openapi":"openapi.json GET /api/v1/subway/routes/{route}/stations","href":"/api-reference/subway-route-stations"},{"title":"mta.bus.arrivalBoard() — nearby bus departure board","sidebarTitle":"Bus Arrival Board","openapi":"openapi.json GET /api/v1/bus/arrival-board","href":"/api-reference/bus-arrival-board"},{"title":"mta.bus.routeStops() — ordered stops on a route","sidebarTitle":"Bus Route Stops","openapi":"openapi.json GET /api/v1/bus/routes/{route}/stops","href":"/api-reference/bus-route-stops"},{"title":"mta.routes.list() — list subway and bus routes","sidebarTitle":"Routes","openapi":"openapi.json GET /api/v1/routes","href":"/api-reference/routes"},{"title":"mta.stops.byIds() — batch stop lookup","sidebarTitle":"Stops by ID","openapi":"openapi.json GET /api/v1/stops","href":"/api-reference/stops-batch"}]},{"group":"Regional transit REST","pages":[{"title":"List NJ PATH stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/path/stations","href":"/api-reference/path/list-nj-path-stations"},{"title":"List PATH routes serving New Jersey","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/path/routes","href":"/api-reference/path/list-path-routes-serving-new-jersey"},{"title":"Get PATH arrivals for NJ stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/path/arrivals","href":"/api-reference/path/get-path-arrivals-for-nj-stations"},{"title":"Get ordered PATH stations for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/path/routes/{route}/stations","href":"/api-reference/path/get-ordered-path-stations-for-a-route"},{"title":"List NJ Transit rail stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nj-transit/rail/stations","href":"/api-reference/nj-transit-rail/list-nj-transit-rail-stations"},{"title":"Get NJ Transit rail departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nj-transit/rail/departures","href":"/api-reference/nj-transit-rail/get-nj-transit-rail-departures"},{"title":"Get NJ Transit rail vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nj-transit/rail/vehicles","href":"/api-reference/nj-transit-rail/get-nj-transit-rail-vehicles"},{"title":"Get NJ Transit rail alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nj-transit/rail/alerts","href":"/api-reference/nj-transit-rail/get-nj-transit-rail-alerts"},{"title":"Get ordered NJ Transit rail stations for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nj-transit/rail/routes/{route}/stations","href":"/api-reference/nj-transit-rail/get-ordered-nj-transit-rail-stations-for-a-route"},{"title":"List NYC Ferry stops","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nyc-ferry/stops","href":"/api-reference/nyc-ferry/list-nyc-ferry-stops"},{"title":"List NYC Ferry routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nyc-ferry/routes","href":"/api-reference/nyc-ferry/list-nyc-ferry-routes"},{"title":"Get NYC Ferry stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nyc-ferry/routes/{route}/stops","href":"/api-reference/nyc-ferry/get-nyc-ferry-stops-for-a-route"},{"title":"Get NYC Ferry arrivals","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nyc-ferry/arrivals","href":"/api-reference/nyc-ferry/get-nyc-ferry-arrivals"},{"title":"Get NYC Ferry vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nyc-ferry/vehicles","href":"/api-reference/nyc-ferry/get-nyc-ferry-vehicles"},{"title":"Get NYC Ferry alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/nyc-ferry/alerts","href":"/api-reference/nyc-ferry/get-nyc-ferry-alerts"},{"title":"Find Citi Bike stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/citi-bike/stations","href":"/api-reference/citi-bike/find-citi-bike-stations"},{"title":"Get a Citi Bike station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/citi-bike/stations/{id}","href":"/api-reference/citi-bike/get-a-citi-bike-station"},{"title":"Get Citi Bike service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/citi-bike/alerts","href":"/api-reference/citi-bike/get-citi-bike-service-alerts"},{"title":"List LIRR stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lirr/stops","href":"/api-reference/lirr/list-lirr-stations"},{"title":"List LIRR routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lirr/routes","href":"/api-reference/lirr/list-lirr-routes"},{"title":"Get LIRR stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lirr/routes/{route}/stops","href":"/api-reference/lirr/get-lirr-stops-for-a-route"},{"title":"Get LIRR departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lirr/departures","href":"/api-reference/lirr/get-lirr-departures"},{"title":"Get LIRR vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lirr/vehicles","href":"/api-reference/lirr/get-lirr-vehicles"},{"title":"Get LIRR alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lirr/alerts","href":"/api-reference/lirr/get-lirr-alerts"},{"title":"List Metro-North stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-north/stops","href":"/api-reference/metro-north/list-metro-north-stations"},{"title":"List Metro-North routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-north/routes","href":"/api-reference/metro-north/list-metro-north-routes"},{"title":"Get Metro-North stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-north/routes/{route}/stops","href":"/api-reference/metro-north/get-metro-north-stops-for-a-route"},{"title":"Get Metro-North departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-north/departures","href":"/api-reference/metro-north/get-metro-north-departures"},{"title":"Get Metro-North vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-north/vehicles","href":"/api-reference/metro-north/get-metro-north-vehicles"},{"title":"Get Metro-North alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-north/alerts","href":"/api-reference/metro-north/get-metro-north-alerts"},{"title":"List MBTA stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/mbta/stops","href":"/api-reference/mbta/list-mbta-stations"},{"title":"List MBTA routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/mbta/routes","href":"/api-reference/mbta/list-mbta-routes"},{"title":"Get MBTA stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/mbta/routes/{route}/stops","href":"/api-reference/mbta/get-mbta-stops-for-a-route"},{"title":"Get MBTA departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/mbta/departures","href":"/api-reference/mbta/get-mbta-departures"},{"title":"Get MBTA vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/mbta/vehicles","href":"/api-reference/mbta/get-mbta-vehicles"},{"title":"Get MBTA alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/mbta/alerts","href":"/api-reference/mbta/get-mbta-alerts"},{"title":"List King County Metro stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/king-county-metro/stops","href":"/api-reference/king-county-metro/list-king-county-metro-stations"},{"title":"List King County Metro routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/king-county-metro/routes","href":"/api-reference/king-county-metro/list-king-county-metro-routes"},{"title":"Get King County Metro stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/king-county-metro/routes/{route}/stops","href":"/api-reference/king-county-metro/get-king-county-metro-stops-for-a-route"},{"title":"Get King County Metro departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/king-county-metro/departures","href":"/api-reference/king-county-metro/get-king-county-metro-departures"},{"title":"Get King County Metro vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/king-county-metro/vehicles","href":"/api-reference/king-county-metro/get-king-county-metro-vehicles"},{"title":"Get King County Metro alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/king-county-metro/alerts","href":"/api-reference/king-county-metro/get-king-county-metro-alerts"},{"title":"List CapMetro stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capmetro/stops","href":"/api-reference/capmetro/list-capmetro-stations"},{"title":"List CapMetro routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capmetro/routes","href":"/api-reference/capmetro/list-capmetro-routes"},{"title":"Get CapMetro stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capmetro/routes/{route}/stops","href":"/api-reference/capmetro/get-capmetro-stops-for-a-route"},{"title":"Get CapMetro departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capmetro/departures","href":"/api-reference/capmetro/get-capmetro-departures"},{"title":"Get CapMetro vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capmetro/vehicles","href":"/api-reference/capmetro/get-capmetro-vehicles"},{"title":"Get CapMetro alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capmetro/alerts","href":"/api-reference/capmetro/get-capmetro-alerts"},{"title":"List BART stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bart/stops","href":"/api-reference/bart/list-bart-stations"},{"title":"List BART routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bart/routes","href":"/api-reference/bart/list-bart-routes"},{"title":"Get BART stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bart/routes/{route}/stops","href":"/api-reference/bart/get-bart-stops-for-a-route"},{"title":"Get BART departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bart/departures","href":"/api-reference/bart/get-bart-departures"},{"title":"Get BART vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bart/vehicles","href":"/api-reference/bart/get-bart-vehicles"},{"title":"Get BART alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bart/alerts","href":"/api-reference/bart/get-bart-alerts"},{"title":"List Tri-Rail stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/tri-rail/stops","href":"/api-reference/tri-rail/list-tri-rail-stations"},{"title":"List Tri-Rail routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/tri-rail/routes","href":"/api-reference/tri-rail/list-tri-rail-routes"},{"title":"Get Tri-Rail stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/tri-rail/routes/{route}/stops","href":"/api-reference/tri-rail/get-tri-rail-stops-for-a-route"},{"title":"Get Tri-Rail departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/tri-rail/departures","href":"/api-reference/tri-rail/get-tri-rail-departures"},{"title":"Get Tri-Rail vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/tri-rail/vehicles","href":"/api-reference/tri-rail/get-tri-rail-vehicles"},{"title":"Get Tri-Rail alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/tri-rail/alerts","href":"/api-reference/tri-rail/get-tri-rail-alerts"},{"title":"List Brightline stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/brightline/stops","href":"/api-reference/brightline/list-brightline-stations"},{"title":"List Brightline routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/brightline/routes","href":"/api-reference/brightline/list-brightline-routes"},{"title":"Get Brightline stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/brightline/routes/{route}/stops","href":"/api-reference/brightline/get-brightline-stops-for-a-route"},{"title":"Get Brightline departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/brightline/departures","href":"/api-reference/brightline/get-brightline-departures"},{"title":"Get Brightline vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/brightline/vehicles","href":"/api-reference/brightline/get-brightline-vehicles"},{"title":"Get Brightline alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/brightline/alerts","href":"/api-reference/brightline/get-brightline-alerts"},{"title":"List Pace stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pace/stops","href":"/api-reference/pace/list-pace-stations"},{"title":"List Pace routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pace/routes","href":"/api-reference/pace/list-pace-routes"},{"title":"Get Pace stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pace/routes/{route}/stops","href":"/api-reference/pace/get-pace-stops-for-a-route"},{"title":"Get Pace departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pace/departures","href":"/api-reference/pace/get-pace-departures"},{"title":"Get Pace vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pace/vehicles","href":"/api-reference/pace/get-pace-vehicles"},{"title":"Get Pace alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pace/alerts","href":"/api-reference/pace/get-pace-alerts"},{"title":"List Denver RTD stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/rtd/stops","href":"/api-reference/rtd/list-denver-rtd-stations"},{"title":"List Denver RTD routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/rtd/routes","href":"/api-reference/rtd/list-denver-rtd-routes"},{"title":"Get Denver RTD stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/rtd/routes/{route}/stops","href":"/api-reference/rtd/get-denver-rtd-stops-for-a-route"},{"title":"Get Denver RTD departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/rtd/departures","href":"/api-reference/rtd/get-denver-rtd-departures"},{"title":"Get Denver RTD vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/rtd/vehicles","href":"/api-reference/rtd/get-denver-rtd-vehicles"},{"title":"Get Denver RTD alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/rtd/alerts","href":"/api-reference/rtd/get-denver-rtd-alerts"},{"title":"List Metro Transit stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-transit/stops","href":"/api-reference/metro-transit/list-metro-transit-stations"},{"title":"List Metro Transit routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-transit/routes","href":"/api-reference/metro-transit/list-metro-transit-routes"},{"title":"Get Metro Transit stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-transit/routes/{route}/stops","href":"/api-reference/metro-transit/get-metro-transit-stops-for-a-route"},{"title":"Get Metro Transit departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-transit/departures","href":"/api-reference/metro-transit/get-metro-transit-departures"},{"title":"Get Metro Transit vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-transit/vehicles","href":"/api-reference/metro-transit/get-metro-transit-vehicles"},{"title":"Get Metro Transit alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-transit/alerts","href":"/api-reference/metro-transit/get-metro-transit-alerts"},{"title":"List Pittsburgh Regional Transit stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/prt/stops","href":"/api-reference/prt/list-pittsburgh-regional-transit-stations"},{"title":"List Pittsburgh Regional Transit routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/prt/routes","href":"/api-reference/prt/list-pittsburgh-regional-transit-routes"},{"title":"Get Pittsburgh Regional Transit stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/prt/routes/{route}/stops","href":"/api-reference/prt/get-pittsburgh-regional-transit-stops-for-a-route"},{"title":"Get Pittsburgh Regional Transit departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/prt/departures","href":"/api-reference/prt/get-pittsburgh-regional-transit-departures"},{"title":"Get Pittsburgh Regional Transit vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/prt/vehicles","href":"/api-reference/prt/get-pittsburgh-regional-transit-vehicles"},{"title":"Get Pittsburgh Regional Transit alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/prt/alerts","href":"/api-reference/prt/get-pittsburgh-regional-transit-alerts"},{"title":"List MARTA stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marta/stops","href":"/api-reference/marta/list-marta-stations"},{"title":"List MARTA routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marta/routes","href":"/api-reference/marta/list-marta-routes"},{"title":"Get MARTA stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marta/routes/{route}/stops","href":"/api-reference/marta/get-marta-stops-for-a-route"},{"title":"Get MARTA departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marta/departures","href":"/api-reference/marta/get-marta-departures"},{"title":"Get MARTA vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marta/vehicles","href":"/api-reference/marta/get-marta-vehicles"},{"title":"Get MARTA alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marta/alerts","href":"/api-reference/marta/get-marta-alerts"},{"title":"List VIA Metropolitan Transit stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/via/stops","href":"/api-reference/via/list-via-metropolitan-transit-stations"},{"title":"List VIA Metropolitan Transit routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/via/routes","href":"/api-reference/via/list-via-metropolitan-transit-routes"},{"title":"Get VIA Metropolitan Transit stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/via/routes/{route}/stops","href":"/api-reference/via/get-via-metropolitan-transit-stops-for-a-route"},{"title":"Get VIA Metropolitan Transit departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/via/departures","href":"/api-reference/via/get-via-metropolitan-transit-departures"},{"title":"Get VIA Metropolitan Transit vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/via/vehicles","href":"/api-reference/via/get-via-metropolitan-transit-vehicles"},{"title":"Get VIA Metropolitan Transit alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/via/alerts","href":"/api-reference/via/get-via-metropolitan-transit-alerts"},{"title":"List GCRTA stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/gcrta/stops","href":"/api-reference/gcrta/list-gcrta-stations"},{"title":"List GCRTA routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/gcrta/routes","href":"/api-reference/gcrta/list-gcrta-routes"},{"title":"Get GCRTA stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/gcrta/routes/{route}/stops","href":"/api-reference/gcrta/get-gcrta-stops-for-a-route"},{"title":"Get GCRTA departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/gcrta/departures","href":"/api-reference/gcrta/get-gcrta-departures"},{"title":"Get GCRTA vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/gcrta/vehicles","href":"/api-reference/gcrta/get-gcrta-vehicles"},{"title":"Get GCRTA alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/gcrta/alerts","href":"/api-reference/gcrta/get-gcrta-alerts"},{"title":"List CATS stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/cats/stops","href":"/api-reference/cats/list-cats-stations"},{"title":"List CATS routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/cats/routes","href":"/api-reference/cats/list-cats-routes"},{"title":"Get CATS stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/cats/routes/{route}/stops","href":"/api-reference/cats/get-cats-stops-for-a-route"},{"title":"Get CATS departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/cats/departures","href":"/api-reference/cats/get-cats-departures"},{"title":"Get CATS vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/cats/vehicles","href":"/api-reference/cats/get-cats-vehicles"},{"title":"Get CATS alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/cats/alerts","href":"/api-reference/cats/get-cats-alerts"},{"title":"List SacRT stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/sacrt/stops","href":"/api-reference/sacrt/list-sacrt-stations"},{"title":"List SacRT routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/sacrt/routes","href":"/api-reference/sacrt/list-sacrt-routes"},{"title":"Get SacRT stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/sacrt/routes/{route}/stops","href":"/api-reference/sacrt/get-sacrt-stops-for-a-route"},{"title":"Get SacRT departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/sacrt/departures","href":"/api-reference/sacrt/get-sacrt-departures"},{"title":"Get SacRT vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/sacrt/vehicles","href":"/api-reference/sacrt/get-sacrt-vehicles"},{"title":"Get SacRT alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/sacrt/alerts","href":"/api-reference/sacrt/get-sacrt-alerts"},{"title":"List MARC stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marc/stops","href":"/api-reference/marc/list-marc-stations"},{"title":"List MARC routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marc/routes","href":"/api-reference/marc/list-marc-routes"},{"title":"Get MARC stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marc/routes/{route}/stops","href":"/api-reference/marc/get-marc-stops-for-a-route"},{"title":"Get MARC departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marc/departures","href":"/api-reference/marc/get-marc-departures"},{"title":"Get MARC vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marc/vehicles","href":"/api-reference/marc/get-marc-vehicles"},{"title":"Get MARC alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/marc/alerts","href":"/api-reference/marc/get-marc-alerts"},{"title":"List UTA stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/uta/stops","href":"/api-reference/uta/list-uta-stations"},{"title":"List UTA routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/uta/routes","href":"/api-reference/uta/list-uta-routes"},{"title":"Get UTA stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/uta/routes/{route}/stops","href":"/api-reference/uta/get-uta-stops-for-a-route"},{"title":"Get UTA departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/uta/departures","href":"/api-reference/uta/get-uta-departures"},{"title":"Get UTA vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/uta/vehicles","href":"/api-reference/uta/get-uta-vehicles"},{"title":"Get UTA alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/uta/alerts","href":"/api-reference/uta/get-uta-alerts"},{"title":"List JTA stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/jta/stops","href":"/api-reference/jta/list-jta-stations"},{"title":"List JTA routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/jta/routes","href":"/api-reference/jta/list-jta-routes"},{"title":"Get JTA stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/jta/routes/{route}/stops","href":"/api-reference/jta/get-jta-stops-for-a-route"},{"title":"Get JTA departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/jta/departures","href":"/api-reference/jta/get-jta-departures"},{"title":"Get JTA vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/jta/vehicles","href":"/api-reference/jta/get-jta-vehicles"},{"title":"Get JTA alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/jta/alerts","href":"/api-reference/jta/get-jta-alerts"},{"title":"List Muni stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/muni/stops","href":"/api-reference/muni/list-muni-stations"},{"title":"List Muni routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/muni/routes","href":"/api-reference/muni/list-muni-routes"},{"title":"Get Muni stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/muni/routes/{route}/stops","href":"/api-reference/muni/get-muni-stops-for-a-route"},{"title":"Get Muni departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/muni/departures","href":"/api-reference/muni/get-muni-departures"},{"title":"Get Muni vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/muni/vehicles","href":"/api-reference/muni/get-muni-vehicles"},{"title":"Get Muni alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/muni/alerts","href":"/api-reference/muni/get-muni-alerts"},{"title":"List Caltrain stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/caltrain/stops","href":"/api-reference/caltrain/list-caltrain-stations"},{"title":"List Caltrain routes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/caltrain/routes","href":"/api-reference/caltrain/list-caltrain-routes"},{"title":"Get Caltrain stops for a route","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/caltrain/routes/{route}/stops","href":"/api-reference/caltrain/get-caltrain-stops-for-a-route"},{"title":"Get Caltrain departures","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/caltrain/departures","href":"/api-reference/caltrain/get-caltrain-departures"},{"title":"Get Caltrain vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/caltrain/vehicles","href":"/api-reference/caltrain/get-caltrain-vehicles"},{"title":"Get Caltrain alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/caltrain/alerts","href":"/api-reference/caltrain/get-caltrain-alerts"},{"title":"Find Bay Wheels stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bay-wheels/stations","href":"/api-reference/bay-wheels/find-bay-wheels-stations"},{"title":"Get a Bay Wheels station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bay-wheels/stations/{id}","href":"/api-reference/bay-wheels/get-a-bay-wheels-station"},{"title":"Get Bay Wheels service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bay-wheels/alerts","href":"/api-reference/bay-wheels/get-bay-wheels-service-alerts"},{"title":"Find Divvy stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/divvy/stations","href":"/api-reference/divvy/find-divvy-stations"},{"title":"Get a Divvy station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/divvy/stations/{id}","href":"/api-reference/divvy/get-a-divvy-station"},{"title":"Get Divvy service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/divvy/alerts","href":"/api-reference/divvy/get-divvy-service-alerts"},{"title":"Find Bluebikes stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bluebikes/stations","href":"/api-reference/bluebikes/find-bluebikes-stations"},{"title":"Get a Bluebikes station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bluebikes/stations/{id}","href":"/api-reference/bluebikes/get-a-bluebikes-station"},{"title":"Get Bluebikes service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/bluebikes/alerts","href":"/api-reference/bluebikes/get-bluebikes-service-alerts"},{"title":"Find Capital Bikeshare stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capital-bikeshare/stations","href":"/api-reference/capital-bikeshare/find-capital-bikeshare-stations"},{"title":"Get a Capital Bikeshare station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capital-bikeshare/stations/{id}","href":"/api-reference/capital-bikeshare/get-a-capital-bikeshare-station"},{"title":"Get Capital Bikeshare service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/capital-bikeshare/alerts","href":"/api-reference/capital-bikeshare/get-capital-bikeshare-service-alerts"},{"title":"Find Biketown stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/biketown/stations","href":"/api-reference/biketown/find-biketown-stations"},{"title":"Get a Biketown station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/biketown/stations/{id}","href":"/api-reference/biketown/get-a-biketown-station"},{"title":"Get Biketown service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/biketown/alerts","href":"/api-reference/biketown/get-biketown-service-alerts"},{"title":"Find Indego stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/indego/stations","href":"/api-reference/indego/find-indego-stations"},{"title":"Get a Indego station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/indego/stations/{id}","href":"/api-reference/indego/get-a-indego-station"},{"title":"Get Indego service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/indego/alerts","href":"/api-reference/indego/get-indego-service-alerts"},{"title":"Find Metro Bike Share stations","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-bike-share/stations","href":"/api-reference/metro-bike-share/find-metro-bike-share-stations"},{"title":"Get a Metro Bike Share station","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-bike-share/stations/{id}","href":"/api-reference/metro-bike-share/get-a-metro-bike-share-station"},{"title":"Get Metro Bike Share service alerts","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/metro-bike-share/alerts","href":"/api-reference/metro-bike-share/get-metro-bike-share-service-alerts"}]}]}]},"basePath":"","title":"mta.subway.direction() — resolve a destination to a direction - MTA API","deploymentId":"dpl_DPZjiNpvAcGiwobuijLfKPtJL4Ux","buildId":"dpl_DPZjiNpvAcGiwobuijLfKPtJL4Ux","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-Cn6jN7s-.js","snippetPresets-DjcjTu_l.js","utils-CgDfAybK.js","style-to-object-BY3JEAdk.js","utils-BRh9RHH1.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-ekgQXnrs.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DQ8efB5G.js","_Uint8Array-DxysT0ia.js","isObject-FP1Yky1u.js","Page-tKmt1iGP.js","api-description-markdown-KtPg6U4T.js","DynamicMarkdown-Ch7bkVSN.js","CodeSnippet-NZAMx71T.js","use-playground-group-access-BeZ_TnTl.js","SectionHeading-Cj70Qp9A.js","ApiExamples-B4Dcm0cf.js","usePlaygroundInputsStore-CDeMD38v.js","shallow-BG_m8ALL.js","isEqual-DPm32SJd.js","CodeSnippets-DQz1R-UZ.js","MethodPill-BAy1jSVY.js","getPastedJson-BX84PZ05.js","Check2Icon-B6AWYcHm.js","axios-CsQoIw0U.js","Markdown-CfiTBZoc.js","AssistantPageLink-SRAvT1Bg.js","dist-CnoXsf9u.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}