Nested JSON and API Data to Tidy Tables
Flatten messy nested data reliably.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
Help me turn nested JSON into tidy tables. A sample of the JSON (remove personal data): [JSON_SAMPLE]. What analysis I need: [ANALYSIS_GOAL]. Describe the structure in plain language: levels, repeated elements, optional fields. Propose a set of tables (one per entity) with keys that link them, and explain why. Provide pandas code using json_normalize and explode where suitable, handling missing fields and lists of different lengths. Include checks for row counts and key uniqueness, and show how to handle changes in the API's fields over time. Add error handling for failed or paginated requests in general terms and a reminder to respect the provider's terms of use and rate limits. Add a short test plan with three hand-made JSON records that cover a missing field, an empty list, and an unexpected type, and the expected output tables for each. Include a note on storing the raw responses unchanged before flattening so the process can be replayed, and a schema check that raises a clear message when a new field appears.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.