import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
payload = {
"type": "wind",
"name": "My new solar site", # The new site name
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "1h",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"azimuth": 180,
"tilt": 30,
"capacity": 1000,
"install_date": "2020-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites/{site_id}"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.put(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()