0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

やること

Xユーザーのてるきちさん: 「乗換案内APIをつくりました 交通データは各事業者の GTFS / ODPT 等に基づき、ライセンスと帰属表示は /api/v1/feeds および /api/v1/operators で取得できます あなたのエビに食わせてレッツ道案内 https://t.co/puKXQgDgtu」 / X
image.png
 これをEXCELで試用してみる。以下、試用手順のメモ。

事前確認:Qiitaでの記事

 ということで、以下の検索をしたところ、2件ヒットした。(2026/06/27時点)

「EXCEL 乗換案内API」の検索結果 - Qiita

Webブラウザを自動操作

[Excel VBA]WebDriver経由でブラウザ操作(SeleniumVBA使い方メモ) #ExcelVBA - Qiita
最終更新日 2023年10月14日 投稿日 2023年02月05日

参加レポート

CAMPFIRE iOS #1 参加レポート #Swift - Qiita
投稿日 2017年03月19日

とりあえず試用

webへのアクセス

Transit API
image.png

以下の例が紹介されているので、これを試してみる。

curl "https://api.transit.ls8h.com/api/v1/plan?from=geo:35.681,139.767&to=geo:35.690,139.700"

Power Queryでのデータ取得

image.png
 ↓ Excelの[データ]→[データの取得]→[その他のソース]→[Webから]を選択
image.png
 ↓ クイックスタートで紹介されているURLを入力し、[OK]をクリック
image.png
 ↓ journeysのListをクリック
image.png
 ↓ [テーブルへの変換]をクリック
image.png
 ↓ [OK]をクリック
image.png
 ↓ 右上にある [展開アイコン(↔)]をクリック
image.png
 ↓ ☑legs以外のチェックを外して[OK]をクリック
image.png
 ↓ 右上にある [展開アイコン(↔)]をクリック
image.png
 ↓ [新しい行に展開する]をクリック
image.png
 ↓ 右上にある [展開アイコン(↔)]をクリック
image.png
 ↓ 「表示したいもの」以外のチェックを外して[OK]をクリック
image.png
 ↓ 「Record」の残っているところを検索
image.png
 ↓ 「from」の右上にある [展開アイコン(↔)]をクリック
image.png
 ↓ ☑name以外のチェックを外して[OK]をクリック
image.png
 ↓ 「Record」の残っているところを検索
image.png
 ↓ 「to」の右上にある [展開アイコン(↔)]をクリック
image.png
 ↓ ☑name以外のチェックを外して[OK]をクリック
image.png
 ↓ 「Record」の残っていないことを確認
image.png
 ↓ [列の追加]→[カスタム列]をクリック
image.png
 ↓ [新しい列名]、[カスタム列の式]を入力し、[OK]をクリック
 ↓ (#time(0,0,0) + #duration(0,0,0,[使用できる列からdepartureSecsを選択]))
image.png
 ↓ 同様にarrivalSecsも対応
image.png
 ↓ [閉じて読み込む]のアイコンをクリック
image.png
※追加した「departureSecs」、「arrivalSecs」の書式は「時刻」にしてください。

ドキュメントより

Transit API リファレンス

200
{
  "date": "string",
  "type": "departure",
  "timezone": "string",
  "from": {
    "id": "string",
    "name": "string"
  },
  "to": {
    "id": "string",
    "name": "string"
  },
  "journeys": [
    {
      "departureSecs": 1,
      "arrivalSecs": 1,
      "durationSecs": 1,
      "transferCount": 1,
      "fare": {
        "currency": "string",
        "ticket": 1,
        "ic": 1
      },
      "accessWalkSecs": 1,
      "egressWalkSecs": 1,
      "legs": [
        {
          "kind": "transit",
          "routeName": "string",
          "mode": "string",
          "color": "string",
          "headsign": "string",
          "tripId": "string",
          "from": {
            "id": "string",
            "name": "string",
            "platformCode": "string"
          },
          "to": {
            "id": "string",
            "name": "string",
            "platformCode": "string"
          },
          "departureSecs": 1,
          "arrivalSecs": 1,
          "headwayBased": true
        }
      ]
    }
  ]
}

 ↓ こんなイメージ

root
 ├─ date
 ├─ type
 ├─ timezone
 ├─ from { id, name }
 ├─ to   { id, name }
 └─ journeys [ … ]
        ├─ departureSecs
        ├─ arrivalSecs
        ├─ durationSecs
        ├─ transferCount
        ├─ accessWalkSecs
        ├─ egressWalkSecs
        └─ legs [ … ]
               ├─ kind
               ├─ routeName
               ├─ mode
               ├─ headsign
               ├─ from { id, name }
               ├─ to   { id, name }
               ├─ departureSecs
               └─ arrivalSecs

 journeysのList → legsのList → kind ,routeName ,headsign ,from ,to ,departureSecs ,arrivalSecs を選んだ流れになります。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?