Web Scraping20 min read
Saving Data to JSON
Store structured scraped data into JSON format for APIs and modern applications.
David Miller
December 21, 2025
0.0k0
JSON is best for structured and nested data.
Write JSON ```python import json
data = [ {"name": "Laptop", "price": 900}, {"name": "Phone", "price": 500} ]
with open("products.json", "w", encoding="utf-8") as f: json.dump(data, f, indent=2) ```
Flow ```mermaid flowchart LR A[Python Dict/List] --> B[JSON File] ```
Remember - JSON keeps structure - Ideal for APIs
#Python#Intermediate#Storage