{"data":{"billing":{"currency":"USD","mode":"rules","parameters":[],"policy_version":2,"sale":{"addons":[],"base_price_micro_usd":"0","max_cost_micro_usd":"2000","quantities":[{"id":"upstream_credits","label":"Actual API.SH credits consumed","max_quantity":"1","measure":"value","pointer":"/credits_used","price_micro_usd":"2000","quantity_scale":0,"source":"response","unit":"credit","unit_quantity":"1"}],"rounding":"ceil","variants":[]}},"capabilityId":"d998d9b9-1bb8-4a2e-9134-145643488581","catalogType":"api","categories":["travel","data"],"dataPlatform":"trainline","dataPlatformLogoUrl":"https://api.sh/logos/trainline.png","dataPlatformTranslations":{},"dataProduct":"ground-transport","description":"Search Trainline stations and city groups by name and locale via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, q, raw, and retrieve structured data including source location reference, source short station code, source navigation slug, source location type, and source timezone for location picker, and navigation labels.","descriptionTranslations":{"ar":"ابحث عن محطات ومجموعات مدن Trainline بالاسم واللغة، مع الأنواع والمسارات والمناطق الزمنية لتمييز مجموعة المحطات عن رمز محطة منفردة. استخدم السجلات المنظمة لبناء واجهة اكتشاف قطارات أو ربط المحطات والخدمات، مع توضيح تواريخ المصدر والأوقات ونطاق الأجرة وأمثلة الطلبات المدعومة وتسعير التنفيذ الحالي في صفحة API.","ja":"名称とロケールで Trainline 駅・都市グループを検索し、区分・スラッグ・時刻帯から駅群と単独駅を区別できます。 構造化記録を鉄道検索画面や駅・運行参照の連携に使い、出典日付・時刻ラベル・運賃範囲を明示できます。API 詳細ページには対応リクエスト例と選択した実装の料金があります。","zh":"按名称和语言环境搜索 Trainline 车站及城市组，获取地点类型、slug 和时区，区分车站组身份与单站代码。 可利用结构化记录构建铁路发现界面或关联车站与服务引用，保留来源日期、时间标签和票价范围；API 详情页提供受支持的请求示例及当前实现价格。"},"effectContentHtml":"","executionMode":"sync","id":"6dc64d26-d486-4a37-9155-cf28f997507b","includedContentHtml":"","inputs":[{"description":"Station or city name (2+ characters).","location":"query","name":"q","nullable":false,"required":true,"type":"string"},{"description":"Language of the names. Default `en-GB`.","enum_values":["en-GB","en-US","fr-FR","de-DE","it-IT","es-ES","nl-NL","pt-PT","pl-PL","cs-CZ","sv-SE","da-DK"],"location":"query","name":"locale","nullable":false,"required":false,"type":"string"},{"description":"Only one location type, e.g. `station` or `stationGroup`.","location":"query","name":"type","nullable":false,"required":false,"type":"string"},{"description":"0 leaves out the bulky `raw` source blocks (often 10-30x smaller).","enum_values":["0","1"],"location":"query","name":"raw","nullable":false,"required":false,"type":"string"},{"description":"Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.","location":"query","name":"fields","nullable":false,"required":false,"type":"string"},{"description":"1 skips the 24-hour cache and fetches live.","enum_values":["1"],"location":"query","name":"fresh","nullable":false,"required":false,"type":"string"},{"description":"JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.","enum_values":["json"],"location":"query","name":"output","nullable":false,"required":false,"type":"string"},{"description":"With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.","location":"query","name":"records","nullable":false,"required":false,"type":"string"}],"logoUrl":"https://api.sh/logos/trainline.png","method":"GET","name":"Trainline station and city search API","nameTranslations":{},"overviewHtml":"\u003ch2\u003eTrainline Location Search API\u003c/h2\u003e\n\u003cp\u003eUse q with at least two characters, optionally locale and type. code, short_code and slug are distinct source references; score is a match measure rather than a physical distance.\u003c/p\u003e\n\u003ch2\u003eQuick Facts\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eFact\u003c/th\u003e\n\u003cth\u003eValue\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eAccess\u003c/td\u003e\n\u003ctd\u003eOpenAny REST\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAuthentication\u003c/td\u003e\n\u003ctd\u003eOpenAny API key in the Authorization header\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCore inputs\u003c/td\u003e\n\u003ctd\u003eRequired: q. Optional: locale, type. JSON output; fresh=1 bypasses cache and raw=0 omits raw source blocks.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSelected implementation\u003c/td\u003e\n\u003ctd\u003eapish · Trainline station and city search API\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eBilling\u003c/td\u003e\n\u003ctd\u003eSee the pricing area for the selected implementation and request options\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eWhat You Can Build\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eLocation picker\u003c/strong\u003e: Keep station groups and individual stations distinct.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eNavigation labels\u003c/strong\u003e: Use source names and slugs with their locale context.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003eReturned Data\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eField\u003c/th\u003e\n\u003cth\u003eMeaning\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003elocations[].code\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSource location reference\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003elocations[].short_code\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSource short station code\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003elocations[].slug\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSource navigation slug\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003elocations[].type\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSource location type\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003elocations[].time_zone\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSource timezone\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003elocations[].score\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSource match score\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eQuick Start\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eSet OPENANY_API_KEY to your OpenAny API key.\u003c/li\u003e\n\u003cli\u003eReview the selected implementation and pricing, then adapt the request below to your target.\u003c/li\u003e\n\u003cli\u003eCheck the HTTP response and business result before reading optional fields.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode class=\"language-bash\"\u003ecurl --request GET --get \\\n  https://api.openany.si/v1/agent-apis/apish/trainline/v1/locations \\\n  -H \u0026#34;Authorization: Bearer ${OPENANY_API_KEY}\u0026#34; \\\n  --data-urlencode output=json \\\n  --data-urlencode q=manchester \\\n  --data-urlencode raw=0\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch2\u003eRequest and Response Examples\u003c/h2\u003e\n\u003cp\u003eThe response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://openany.si/api/v1/agent-apis/6dc64d26-d486-4a37-9155-cf28f997507b\"\u003ePublished Trainline Location Search API implementation contract\u003c/a\u003e.\u003c/p\u003e\n\u003ch2\u003ePricing and Billing\u003c/h2\u003e\n\u003cp\u003eThe pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service\u0026#39;s public availability does not determine OpenAny billing.\u003c/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c/h2\u003e\n\u003ch3\u003eWhat locale is used by default?\u003c/h3\u003e\n\u003cp\u003elocale defaults to en-GB and controls source name language.\u003c/p\u003e\n\u003ch3\u003eCan I select city groups?\u003c/h3\u003e\n\u003cp\u003eUse the documented type value stationGroup; station selects individual station results.\u003c/p\u003e\n\u003ch3\u003eIs score the distance from my location?\u003c/h3\u003e\n\u003cp\u003eNo. It is a source match score, not a distance measure.\u003c/p\u003e\n\u003ch3\u003eWhat query length is required?\u003c/h3\u003e\n\u003cp\u003eq requires at least two characters. Keep each returned type and identifier together.\u003c/p\u003e\n\u003ch3\u003eHow do I bypass cached results?\u003c/h3\u003e\n\u003cp\u003ePass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.\u003c/p\u003e\n\u003ch3\u003eCan I request CSV or NDJSON?\u003c/h3\u003e\n\u003cp\u003eThis OpenAny implementation serves JSON only. Omit output or set output=json.\u003c/p\u003e\n\u003ch2\u003eRelated APIs\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/trainline/trainline-uk-live-arrivals-api\"\u003eTrainline UK live arrivals API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/trainline/trainline-uk-live-departures-api\"\u003eTrainline UK live departures API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/trainline/trainline-route-times-trains-per-day-fares-from-api\"\u003eTrainline route: times, trains per day, fares from API\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","pagePath":"/markets/apis/trainline/trainline-station-and-city-search-api?offering=6dc64d26-d486-4a37-9155-cf28f997507b","providerId":"apish","publicPath":"/v1/agent-apis/apish/trainline/v1/locations","requestContentType":"none","revision":3,"samples":[{"http_status":200,"name":"Official example · Live API.SH response · Minimal request","request":{"body":null,"headers":{},"path":{},"query":{"output":"json","q":"manchester","raw":"0"}},"response_body":{"cached":false,"count":17,"credits_used":1,"fetched_at":"2026-11-19T12:25:30.813Z","locale":"en-GB","locations":[{"attributes":["MainStation","BusStation","category:train"],"code":"urn:trainline:generic:loc:MAN2968gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Manchester Piccadilly","score":0.40811986,"short_code":"MAN","slug":"manchester-piccadilly","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:point"],"code":"urn:trainline:generic:loc:115gb","connections":["atoc","distribusion","nationalexpress"],"country_code":"GB","language":"en","name":"Manchester","score":0.21027617,"short_code":"115","slug":"manchester","subtitle":"Any","time_zone":"Europe/London","type":"stationGroup"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:MCV2970gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Manchester Victoria","score":0.098572984,"short_code":"MCV","slug":"manchester-victoria","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["Airport","BusStation","category:airport"],"code":"urn:trainline:generic:loc:MIA2961gb","connections":["atoc","distribusion","nationalexpress"],"country_code":"GB","language":"en","name":"Manchester Airport","score":0.079529606,"short_code":"MIA","slug":"manchester-airport","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:MCO2966gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Manchester Oxford Road","score":0.067757465,"short_code":"MCO","slug":"manchester-oxford-road","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:DGT2963gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Deansgate","score":0.018400094,"short_code":"DGT","slug":"deansgate","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:BYM2549gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Burnley Manchester Road","score":0.011640855,"short_code":"BYM","slug":"burnley-manchester-road","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:ECC2950gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Eccles (Manchester)","score":0.005212082,"short_code":"ECC","slug":"eccles-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:MIH2920gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Mills Hill (Manchester)","score":0.004510977,"short_code":"MIH","slug":"mills-hill-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:SNN2800gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Swinton (Manchester)","score":0.0033513077,"short_code":"SNN","slug":"swinton-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:MSL2903gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Mossley (Manchester)","score":0.0031016893,"short_code":"MSL","slug":"mossley-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:CAS2919gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Castleton (Manchester)","score":0.0020112034,"short_code":"CAS","slug":"castleton-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:HAL2845gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Hale (Manchester)","score":0.0016560154,"short_code":"HAL","slug":"hale-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:KSL2605gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Kearsley (Manchester)","score":0.0010937756,"short_code":"KSL","slug":"kearsley-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:INC2236gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Ince (Manchester)","score":0.00065584667,"short_code":"INC","slug":"ince-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:MCZ0451gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Manchester Central Zone","score":0.00017734477,"short_code":"MCZ","slug":"manchester-central-zone","subtitle":null,"time_zone":"Europe/London","type":"station"},{"attributes":["BusStation","category:train"],"code":"urn:trainline:generic:loc:CLI2795gb","connections":["atoc","nationalexpress"],"country_code":"GB","language":"en","name":"Clifton (Manchester)","score":0.000055625846,"short_code":"CLI","slug":"clifton-manchester","subtitle":null,"time_zone":"Europe/London","type":"station"}],"q":"manchester"}}],"seoDescription":"Search Trainline stations and city groups by name via REST or MCP powered by Apish. Pay per call, no subscription. Built for location picker workflows.","updatedAt":"2026-12-03T02:46:55.340Z","usageInstructionsHtml":""}}