Skip to content
  • There are no suggestions because the search field is empty.

Krunchbox API

Introduction

You now have the option to access your data via a selection of APIs, giving you control of when and how to pull data directly from your krunchbox data warehouse.

For example, from within MS Excel or PowerBI you can select to get data from Web, and using the krunchbox API token generator, you will receive an API key which gives you direct access to your data.

For this initial phase we have provided three APIs:

  • Product Master
  • Store Master
  • Weekly data (ie sales, stock etc)

With these three components, you can link the data within your application using common attributes (eg. product code / Store code) to display your data.

Full documentation is provided below to guide you through the process of generating the key and fetching your data.

Authentication

Krunchbox API uses a bearer token for authentication purpose.  To get your personal Authentication Token, you will find a "API Key" menu under the Admin section within your krunchbox web application.

On the page, you can view and manage all the existing keys that have been generated:

To generate a new key, press the "Generate a New API Key" button.  You will be asked for a name for the key (for your own identity purpose) and a key will then be generated.

Please note that the key will only be displayed once and cannot be retrieved after the popup window is closed.

To use the API key, please use the authentication token name "bearer".

Technical Guide

Our API technical guide can be found here using: https://extractapi.krunchbox.com/

SwaggerUI

You can use the SwaggerUI within the technical guide to test the APIs.  The API Key can be entered in the Authorize section in the form of "bearer <your token>"

PowerBI

The following is an example on how to use the APIs in PowerBI.  To connect to one of our API (the following example shows the Product API)

Get Data

  1. From the "Get Data" menu, select "Web".
  2. Select "Advance".
  3. In the "URL Parts" input box, type in the API URL.  You can generate this by using SwaggerUI. In this case, the URL is https://extractapi.krunchbox.com/Extract/Sales?Offset=0&NumRecords=10000&weekEndDate=2024-04-13
  4. Under "HTTP request header parameters", on left hand box - type in "Bearer".   On the right hand box, paste in the API key generated above.
  5. Press "OK"

Result Set

The result should then be displayed in the Power Query Editor similar to the below: