Catalog / 12go Public Travel Read

12go Public Travel Read API

12go.asia

Live, read-only access to 12go's public location typeahead and date-specific train results. Start with location discovery using familiar text, pass returned canonical slugs to train search, and use returned booking links only as source references. No login, booking, cart, seat hold, or other website mutation is performed. The source feed is a complete date-specific response without a verified cursor.

  • Other
  • travel
  • trains
  • transport
  • 12go
  • read-only
2 endpointsDocs updated

Endpoint health

Loading verification…

Connect your agent

Connect through MCP so your agent can find this API, read its docs, and call its endpoints.

Setup guide

Add the server from your terminal.

Claude Code · terminal
claude mcp add --transport http agent-data https://agent-data.motie.dev/mcp

In Claude Code, run /mcp, select agent-data, then Authenticate. Sign in to your agent-data account in the browser.

Then ask your agent to use the 12go Public Travel Read API for your task.

Call it over HTTP

Get an API key

Sign up free, generate an API key, and set it as AGENT_DATA_API_KEY in your environment. Your first 100 calls each month are free.

Resolve familiar free text through 12go's live typeahead. Results retain source ordering and candidate distinctions such as city, airport, and station. Select a returned `slug` and pass it unchanged as `origin` or `destination` to `search-trains`; do not infer a slug from the display name. An empty list means the source returned no candidates for this query.

Partial or natural-language location text accepted by 12go typeahead.

View call pricing
cURL · Search locations
curl --request GET --get 'https://3kpkg0jfvk.execute-api.us-east-2.amazonaws.com/prod/f7650ef8-8f81-48e6-9f40-6bbf9b7f3d47/v1/locations/search' \
  --header "Authorization: Bearer $AGENT_DATA_API_KEY" \
  --data-urlencode 'query=Bangkok'

Endpoints

Inputs and response fields for every endpoint in this API.

GETSearch locations/v1/locations/search

Resolve familiar free text through 12go's live typeahead. Results retain source ordering and candidate distinctions such as city, airport, and station. Select a returned `slug` and pass it unchanged as `origin` or `destination` to `search-trains`; do not infer a slug from the display name. An empty list means the source returned no candidates for this query.

Input

queryRequiredQuery · string

Partial or natural-language location text accepted by 12go typeahead.

Example: Bangkok

Response

querystring
totalinteger
locationsobject[]
locations[].idstring
locations[].code?string | null
locations[].name?string | null
locations[].slugstring
locations[].aliases?string | null
locations[].country?string | null
locations[].name_en?string | null
locations[].type_id?string | null
locations[].local_name?string | null
locations[].type_value?string | null
locations[].source_kind?string | null
locations[].country_code?string | null
locations[].country_slug?string | null

Fields marked ? are optional.

GETSearch trains/v1/trains/search

Search the date-specific public 12go feed for two canonical location slugs. Obtain those slugs from `search-locations` so cities, airports, and stations are not conflated. Every source trip whose structured vehicle-class list contains `train` is retained, including non-bookable rows; class options already present in the response remain nested. There is no local pagination or hidden per-result detail fetch.

Input

dateRequiredQuery · string (date)

Travel date in ISO format YYYY-MM-DD as interpreted by 12go's date-specific feed.

Example: 2026-11-13

originRequiredQuery · string

Canonical 12go origin slug returned by search-locations, for example `bangkok`.

Example: bangkok

destinationRequiredQuery · string

Canonical 12go destination slug returned by search-locations, for example `chiang-mai`.

Example: chiang-mai

Response

totalinteger
trainsobject[]
trains[].idstring
trains[].originstring
trains[].classesobject[]
trains[].classes[].pricenumber | null
trains[].classes[].photos?unknown[]
trains[].classes[].rating?number | null
trains[].classes[].baggage?object
trains[].classes[].baggage.icon?string | null
trains[].classes[].baggage.value?integer | number | null
trains[].classes[].baggage.message?string | null
trains[].classes[].bookableboolean
trains[].classes[].class_idinteger | null
trains[].classes[].currencystring | null
trains[].classes[].features?unknown[]
trains[].classes[].amenities?unknown[]
trains[].classes[].class_namestring | null
trains[].classes[].buy_options?object[]
trains[].classes[].buy_options[].date?string | null
trains[].classes[].buy_options[].date2?string | null
trains[].classes[].buy_options[].date3?string | null
trains[].classes[].buy_options[].to_id?integer | null
trains[].classes[].buy_options[].from_id?integer | null
trains[].classes[].buy_options[].trip_id?string | null
trains[].classes[].ticket_type?string | null
trains[].classes[].booking_linkstring | null
trains[].classes[].cancellation?integer | null
trains[].classes[].rating_count?integer | null
trains[].classes[].sales_sorting?integer | null
trains[].classes[].available_seatsinteger | null
trains[].classes[].confirmation_time?integer | null
trains[].classes[].full_refund_untilstring | null
trains[].classes[].bookings_last_month?integer | null
trains[].classes[].cancellation_message?string | null
trains[].classes[].confirmation_message?string | null
trains[].classes[].confirmation_minutes?integer | null
trains[].classes[].is_generally_refundable?boolean | null
trains[].classes[].is_api_cancellation_policy_applied?boolean | null
trains[].bookableboolean
trains[].operatorstring | null
trains[].destinationstring
trains[].operator_idinteger | null
trains[].arrival_timestring
trains[].booking_linkstring | null
trains[].train_numberstring | null
trains[].departure_timestring
trains[].available_seatsinteger | null
trains[].duration_minutesinteger | null
trains[].availability_reasonstring | null

Fields marked ? are optional.

Don’t see the endpoint you need?

Ask agent-data to add an endpoint or return more fields. Extensions are free and keep existing endpoints working.