JSON
Data Format BeginnerWhat is JSON?
JSON (JavaScript Object Notation) is a lightweight data interchange format that’s easy for humans to read and write, and easy for machines to parse and generate. It became the de facto standard for APIs, configuration files, and data storage because of its simplicity and universality.
JSON is the universal language of data exchange. Lightweight, human-readable, and loved by developers worldwide. If XML is a formal letter, JSON is a quick Slack message — concise, clear, and gets the job done.
JSON Structure Deep Dive
{
"company": "Go4Scrap",
"services": ["scraping", "extraction", "proxies"],
"stats": {
"requests": 1000000,
"success_rate": 99.9,
"avg_response_ms": 234
},
"features": [
{
"name": "Residential Proxies",
"available": true
}
]
}
JSON vs XML: The Quick Comparison
| Feature | JSON | XML |
|---|---|---|
| Readability | Excellent | Good |
| File Size | Smaller | Verbose |
| Parsing Speed | Fast | Slower |
| Comments | No | Yes |
| Data Types | Native | String-based |
# Parsing JSON in Python
import json
# From API response
data = json.loads(response.text)
print(data['company'])
# Creating JSON
output = json.dumps(data, indent=2)
Scraping tip: Many modern sites load data via JSON API endpoints instead of rendering HTML. Use browser DevTools Network tab → XHR/Fetch to find these endpoints. They often contain cleaner data than the HTML itself!