This page guides you inhow to loading your own data in PowerBI through the CarbonSpace API, and in creatinge customiszed visualisations of a carbon assessment. It assumes basic knowledge of PowerBI and PowerQuery, and covers how to load data automatically, but does not cover visualisations in PowerBI.
What is an API?
All data in CarbonSpace is accessible both through the user interface and through a machine-readable interface: the web APIapi.
To customisze to your own workflows, CarbonSpace features an open API on which you can build your tools to ensure the right fit. Using you can create API calls for your software, such as PowerBI, Revit, and Grasshopper for Rhino. The Swagger interface allows testing with the connection.
The web API is still in developmentexperimental and may be subject to changes
Step 1: Creating your API key
Under the User header
Use the GetMe function by clicking on Execute.
In the response body locate the ID. Your account will have it’s own ID, for the demo this is 32, as you can see in the image below.
Use GenerateApiKey to generate your key using the ID from above.
In the response body you should find your API key. It should look something like user@email.com|{key}
Step 2: Connect PowerBI to CarbonSpace
Upon opening the template you will be prompted for the ApiURL, ApiKey and CalculationID.
Use the prefilled ApiURL and fill in your API key from step one.
You can retrieve the CalculationID from the URL in CarbonSpace when you have a calculation open: https://public.carbonspace.earth/.../calculation/225
In- depth: Retrieving Bill of Materials using GetBom in PowerQuery
This power query example shows how to fetch a bill of materials from CarbonSpace with PowerQuery.
In the template, you should see three parameters: ApiURL, ApiKey, and CalculationID.
PowerQuery will prompt you for Credentials. Use the anonymous access for Web Content applied to
Unpacking the Bill of Materials (BoM)
The below example gets the CalculationLines from the BoM record. The same code should get you the other record items.
Creating relationships between tables
Find the relationships to establish in the table below, as also found in the template.
Alternative methods for retrieving multiple calculations at once