{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Train Route & Fare Finder",
    "description": "Station-to-station train routes anywhere in Japan, JR and Shinkansen included - duration, fare, transfers and every leg with platforms.",
    "version": "0.1",
    "x-build-id": "0AXB7O1PNnCYBVwKf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/superslowsloth~japan-train-route-fare-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-superslowsloth-japan-train-route-fare-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/superslowsloth~japan-train-route-fare-finder/runs": {
      "post": {
        "operationId": "runs-sync-superslowsloth-japan-train-route-fare-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/superslowsloth~japan-train-route-fare-finder/run-sync": {
      "post": {
        "operationId": "run-sync-superslowsloth-japan-train-route-fare-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "origin",
          "destination"
        ],
        "properties": {
          "origin": {
            "title": "From station",
            "type": "string",
            "description": "Departure station, in Japanese kanji or kana, e.g. 東京 or とうきょう. Romaji is not matched by the source and will silently return a different station - see the README."
          },
          "destination": {
            "title": "To station",
            "type": "string",
            "description": "Arrival station, in Japanese kanji or kana, e.g. 新大阪 or しんおおさか."
          },
          "datetime": {
            "title": "Date and time (Japan time)",
            "type": "string",
            "description": "ISO-8601 only, e.g. 2026-09-01T10:00. Plain language such as \"next tuesday\" is rejected before the run is charged. A value with no timezone is read as Japan time. Leave empty for right now."
          },
          "searchType": {
            "title": "Depart at or arrive by",
            "enum": [
              "depart",
              "arrive"
            ],
            "type": "string",
            "description": "Whether the date and time above is when you want to leave or when you need to be there.",
            "default": "depart"
          },
          "preference": {
            "title": "Sort routes by",
            "enum": [
              "fastest",
              "cheapest",
              "fewest_transfers"
            ],
            "type": "string",
            "description": "Which route the source should put first: the earliest arrival, the lowest fare, or the fewest transfers.",
            "default": "fastest"
          },
          "maxRoutes": {
            "title": "Max routes",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How many route options to return. The source offers at most 3 per search.",
            "default": 3
          },
          "via": {
            "title": "Via stations",
            "maxItems": 3,
            "type": "array",
            "description": "Optional stations the route must pass through, in order. In Japanese, like the origin and destination. At most three; any beyond the third are dropped.",
            "items": {
              "type": "string"
            }
          },
          "useShinkansen": {
            "title": "Allow Shinkansen",
            "type": "boolean",
            "description": "Turn off to price the journey on ordinary trains only. Off makes Tokyo to Shin-Osaka a nine-hour trip.",
            "default": true
          },
          "useLimitedExpress": {
            "title": "Allow limited express (特急)",
            "type": "boolean",
            "description": "Paid limited-express services such as 特急きぬがわ or the Narita Express.",
            "default": true
          },
          "useHighwayBus": {
            "title": "Allow highway bus",
            "type": "boolean",
            "description": "Long-distance buses. Often the cheapest option and much slower.",
            "default": true
          },
          "useLocalBus": {
            "title": "Allow local bus",
            "type": "boolean",
            "description": "Local city buses, used to reach stations off the rail network.",
            "default": true
          },
          "includeRomaji": {
            "title": "Add romaji station names",
            "type": "boolean",
            "description": "Fetch each station's own kana reading and transliterate it to Hepburn romaji. Costs one extra request per distinct station, so it is off by default.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The source served 12 back-to-back searches from a datacenter address with no block, so a proxy is not required."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}