import requests
import os
from dotenv import load_dotenv

def query_api(url, params=None, headers=None, timeout=10):
    response = requests.get(
        url,
        params=params,
        headers=headers,
        timeout=timeout
    )
    response.raise_for_status()  # Raises an error for 4xx/5xx responses
    return response.json()

if __name__ == "__main__":
    load_dotenv()

    url = "https://api.example.com/users"
    params = {"limit": 10}

    data = query_api(url, params=params)
    print(data)