Inspect JSON structure
inspect_jsonUse this when the user asks what a JSON file contains, which keys or nesting it has, how many records it holds, or why it does not parse, before converting it. Takes the same file or json_text, records_path and orient as json_to_excel and returns the record count, the key paths with their types and fill rate, nesting depth, the lists inside the records, duplicate keys, an estimate of sheets, columns and cells, and suggestions (for example a records_path). Invalid JSON is reported with its line and column. Does not make a file and does not change the JSON.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | The JSON file to convert, e.g. orders.json (UTF-8, or UTF-16 with a byte order mark), up to 5 MB. | |
| orient | No | How records are laid out, e.g. records. records (default): a list of objects, one row each (a single object is one row). columns: an object of equal-length lists, {"name":["Ann","Bo"],"age":[31,40]}. index: an object of objects keyed by id, {"u1":{...},"u2":{...}}; the key goes in column _key. | |
| json_text | No | Instead of a file: the JSON itself, e.g. [{"name":"Ann","age":31},{"name":"Bo","age":40}]. Use either file or json_text. | |
| records_path | No | Dotted key path to the part that holds the records, e.g. "data.items" for {"data":{"items":[...]}}. Use a number for a list item, e.g. "results.0.rows". Default: the whole document. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | Yes | ||
| lists | Yes | ||
| notes | Yes | ||
| paths | Yes | ||
| shape | Yes | ||
| source | Yes | ||
| records | Yes | ||
| estimate | Yes | ||
| json_values | Yes | ||
| paths_total | Yes | ||
| suggestions | Yes | ||
| records_from | Yes | ||
| duplicate_keys | Yes |