Working with JSON in Python: Read, Write, and Use APIs (Full Tutorial)

837 views Jun 19, 2025
publisher-openvideo

usandopy.com

In this Python tutorial, you’ll learn how to work with JSON (JavaScript Object Notation), a lightweight and widely-used data format for data exchange. What you'll learn: ✅ How JSON works and its structure ✅ Converting JSON strings to Python dictionaries with json.loads() ✅ Writing Python objects to JSON with json.dump() ✅ Reading JSON files with json.load() ✅ Real-world API example using ExchangeRate-API to convert currency 💱 We also walk through practical use cases, including modifying JSON files, formatting output, and removing specific fields like area_code. ✅ This is a perfect tutorial for beginners and developers who want to understand how to use JSON for APIs, configuration files, and data pipelines. data_initial = { "states": [ {"name": "São Paulo", "abbreviation": "SP", "area_code": 11}, {"name": "Rio de Janeiro", "abbreviation": "RJ", "area_code": 21}, {"name": "Minas Gerais", "abbreviation": "MG", "area_code": 31}, {"name": "Bahia", "abbreviation": "BA", "area_code": 71}, {"name": "Paraná", "abbreviation": "PR", "area_code": 41}


View Video Transcript