JSONPathテスター
JSONPath 式で JSON を抽出。フィルタ式にも対応。
JSONPathテスターとは
JSONPathテスターは、JSONPath 式($.store.book[*].author、$..price、フィルタ [?(@.price>40)] など)で JSON から値を抽出するツールです。jsonpath-plus ライブラリを使用し、マッチ件数と各値を一覧表示します。API レスポンスの調査やデータ抽出の学習に使えます。処理はブラウザ内で完結します。
🔒 処理はすべてブラウザ内で完結し、データは送信されません。
このツールの前提
- 処理場所
- このページのブラウザ内(JavaScript / Canvas)
- アップロード
- なし — ファイルは端末の外に出ません
- オフライン
- ページを開いた後は通信不要
JSONPath has dialects, and they disagree
The original Goessner proposal was never standardised; RFC 9535 finally defined a JSONPath in 2024, and implementations still differ on the edges. The biggest divergence is how $..name behaves, whether a filter can reference the root, and whether a missing path returns undefined, null or an empty list.
That means a path that works in one library can return a different result in another with no error. Recursive descent and filters are where the differences concentrate; simple child and index access is portable.
Filters are expressions, not queries
A filter such as [?(@.price < 10)] evaluates an expression against each candidate node. Comparison semantics follow the host language in many implementations, so string versus number comparison differs: "10" < 9 can be true in a language that coerces and false in one that does not.
Negative indices, slices and array unions are widely supported but not universally, and slice syntax [$start:$end:$step] is one of the later additions. If a path must run across languages, stick to child access, index access and a single filter.
Debugging a path that returns nothing
Start from $ and add one step at a time, checking the type at each stage. The usual causes are a path that assumed an object where the data has an array, a key with a hyphen that needs bracket notation, and a case mismatch — JSON keys are case-sensitive and most APIs use camelCase.
Then check whether the tool returns an empty list or an error for a missing path. Empty list is the useful behaviour for optional data; an error forces the caller to guard every access. Knowing which your production library does prevents a whole class of 500s.
使い方
- 1.JSON を貼り付け
- 2.JSONPath 式を入力
- 3.実行してマッチ結果を確認
他の方法との比較
同じ変換をする方法は 3 つあります。ブラウザ内(このページ)、サーバー側の変換サービス、デスクトップアプリ。差がつくのは速度ではなく、ファイルがどこへ行くかと、無料でどこまでできるかです。
| 観点 | このツール | サーバー側の変換サービス | デスクトップアプリ |
|---|---|---|---|
| ファイルの処理場所 | このページのブラウザ内 | ベンダーのサーバー(アップロード後) | 自分の PC(アプリをインストール) |
| アカウント | 不要 | 多くの場合必要(無料枠の制限解除に登録を求める) | 不要(ライセンス認証は必要な場合あり) |
| 無料で扱えるサイズ | サイズ制限なし(回数制限もなし) | 数ファイル/時間、または 5〜10MB 程度で課金 wall | ディスクとメモリ次第 |
| 料金 | 無料。Pro は月 $9(大きいファイルと AI 機能のみ) | サブスクが一般的。おおむね月 $7〜15(2026 年 11 月時点) | 買い切り、またはサブスク |
| オフライン | 一度開けば通信不要 | 不可 | 可 |
| 20MB を処理し始めるまで | 待ち時間なし(アップロードが無い) | アップロードが支配的(10Mbps 上りで約 16 秒) | アプリの起動のみ |
| 保証できないこと | 検査は保存済みのスナップショットではなく、現在の応答に対して行います | 同じ(変換の原理は変わらない) | 同じ。ただし書式の再現はより忠実な場合がある |
サーバー側のサービスが優れている点は明確にあります。巨大なファイル、チームでの共有、変換履歴の管理、スクリプトからの自動化。逆に「1 回だけ、手元のファイルを別形式にしたい」という今回の用途では、アップロードの待ち時間と登録の手間だけが増えます。
よくある質問
対応する構文は?
JSONPath 標準構文($ . .. [*] [?()] など)に jsonpath-plus で対応しています。
結果が多い場合は?
最初の 100 件まで表示し、各値は 300 文字で切り詰めます。
この変換で失われるもの
開発者向けツールは「静かに壊れるもの」を点検します。canonical の欠落、検索結果で切れる長さを超えた description、200 を返すが死んだ URL を載せた sitemap。各結果は該当行や URL を指します。行動できない警告は雑音だからです。