import requests, json from app import DEFAULT_API_URL QUESTIONS = requests.get(f"{DEFAULT_API_URL}/questions", timeout=15).json() with open("questions.json", "w") as f: json.dump(QUESTIONS, f, indent=2) print(f"Saved {len(QUESTIONS)} questions")