Introduction
Microsoft Excel can be used together with the Piano Insight API in several ways, e.g.:
-
As a dictionary management system. The platform can be customized to make use of customer-specific dictionaries (e.g., for applying custom taxonomies or for various search features), and these dictionaries can be supplied as Excel workbooks. API methods for this are described, e.g., here.
-
As a "GUI" over the API. I.e., data emitted by the platform can be represented as tables in Excel, where the data can be further manipulated (e.g., filtered or joined with other tables) or graphed. How to do this is the main topic of this page.
Power Query
|
In the following, we'll assume that you have a Microsoft Excel installation running on Windows that is recent enough to be able to run the Power Query add-in for Excel. This add-in was previously known as Data Explorer. |
The steps required for importing data from the Piano Insight API into Microsoft Excel are as follows:
-
Download and install the Power Query add-in for Excel.
-
Prepare a persisted authenticated request that retrieves the data you want to have imported into Excel. The purpose of this step is to enable the Power Query add-in to retrieve the data from the API without authentication getting in the way. You can create a persisted authenticated request in two different ways:
-
Using the API and the /persisted/create API method.
-
Using the GUI available at https://audience-insight.piano.io/ under the tab named "API". In the GUI, a persisted authenticated request is referred to as a "stored query".
-
-
Having prepared a persisted authenticated request, you now have an identifier that can be used together with the /persisted/execute API method. In the following, let's assume that this identifier is
abc123. -
In Excel, go to the Power Query add-in and select "From Web".
-
In the dialog that appears, paste in the URL https://api.cxense.com/persisted/execute?persisted=abc123 (replacing
abc123with your own identifier). You can also add parameters to the URL, if you when you created the persisted request specified that the parameters were mutable. -
Hit the "OK" button and follow the import wizard to shape and transform the API's JSON response into a table.
CSV
Another option is to export data from the Insight API to a CSV file, and then import that into Excel. The Insight API returns JSON, but tools like jq can be used to conveniently transform this to CSV format.
|
|
|