import requests


def query_bulk_games_endpoint(username, year, month):
    """
    Get data from the chess.com bulk game API endpoint.

    Args:
        username (str): A valid chess.com username.
        year (str): Year in a YYYY format.
        month (str): Month in a MM format.

    Returns:
        requests.response: A ``requests.response`` object from the
        chess.com bulk download API.
    """
    url = f"https://api.chess.com/pub/player/{username}/games/{year}/{month:02d}/pgn"
    return requests.get(
        url=url,
        headers={
            "Content-Type": "application/x-chess-pgn",
            "Content-Disposition": 'attachment; filename="ChessCom_username_YYYYMM.pgn"',
        },
    )