import json
import requests


def userEarnings(apikey,year=None,month=None,day=None):
	"""
	Returns statistics from user income and the total available balance on the account
	apikey: Your ApiKey from FileCrypt
	year(optional): year (YYYY) (2019)
	month(optional): month (MM) (06)
	day(optional): month (DD) (13)
	"""
	data={"api_key":apikey,"sub":"earnings","fn":"user"}
	if year != None:
		data["year"] = str(year)
	if month != None:
		data["month"] = str(month)
	if day != None:
		data["day"] = str(day)
	return json.loads(requests.post("https://filecrypt.cc/api.php",data=data).text)