Sites
Update site meta-data
Update site meta-data
To update a site’s meta-data, use the following python code:
import requests
site_id = 'Put the site ID here'
url = f'https://api.rebase.energy/platform/v2/sites/{site_id}'
site = {
'type': 'wind',
'name': 'My wind site',
'latitude': 53.41,
'longitude': 5.94,
'capacity': [
{'value': 4000, 'validFrom': '2020-12-01T00:00:00Z'}, # capacity of site changed to 4000 kW at this date
{'value': 3000, 'validFrom': '2019-10-10T00:00:00Z'}, # capacity of site changed to 3000 kW at this date
{'value': 2000, 'validFrom': '2019-04-03T00:00:00Z'}, # site with capacity 2000 kW was installed at this date
],
}
response = requests.put(url, headers=headers, data=json.dumps(site))
response.raise_for_status()
response = response.json()