In order to do actions like getting a site’s forecast, uploading data to a site and others, you will need to provide the site ID when querying the relevant endpoints.
The example below shows how to get a list of meta data for all of your sites. The meta data include IDs of the sites among other parameter values.
Get meta list
Copy
import requestsapi_key = "Your API key" # Set your API keyurl = "https://api.rebase.energy/platform/v2/sites"headers = {"Authorization": api_key, "Content-Type": "application/json"}response = requests.get(url=url, headers=headers)response.raise_for_status()response = response.json()
To get meta data for a specific site use the ID of that site.
Get site meta
Copy
import requestsapi_key = "Your API key" # Set your API keysite_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site IDurl = f"https://api.rebase.energy/platform/v2/sites/{site_id}"headers = {"Authorization": api_key, "Content-Type": "application/json"}response = requests.get(url, headers=headers)response.raise_for_status()response = response.json()