Data lookup with Postman

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.

In our API documentation we describe how you can fetch data from your datastreams using cURL, in this guide we’ll show you an alternative method; using Postman.

Since cURL consists of single lines entered in your command prompt, it’s somewhat inconvenient to make quick adjustments, and it can be troublesome to see the parameters at a glance. Postman, with its graphic interface makes it easier to check values and and make small changes.

Below are instructions describing how you can fetch data from EnergyDataDK using Postman.

Setup

You can use Postman free of charge, but you must signup in order to be able to use it. You can sign up using this link.
Postman can be used as a web interface by logging in on the website, or by installing Postman as an app.

For the purposes of this guide, we’ll assume you’ve signup and are ready to get started.
If you’ve already been using Postman there may be steps in this guide which you can skip.

Adding a workspace

We’ll start by creating a new workspace. A workspace is the largest grouping, think of it as a common theme. So in this case, we’ll call it “EnergyDataDK”
Selecting the Workspaces option in the menu on the left of the screen.

On the Workspaces screen, press the Create workspace button.

Name your new workspace under Workspace name. for example “EnergyDataDK.
Select Internal under Select workspace type , and select Only you and invited people Under Who can Access.

These settings ensure that you maintain control over who can access your workspace and the information stored within it.

Finish by pressing the Create Workspace button.

Add a collection

A collection is a grouping of requests that share some commonality. In this case that will be fetching data using the EnergyDataDK API, so we will name it something like “Fetch data”.

In your collection, press the Create button.

We want to all requests in this collection to use the same API token. So first we’ll add the token to a variable.
Select the Variables tab, enter “API token” under Variable and enter your API key under Value.

Switch to the Authorization tab.

Select “Bearer Token” under Auth Type 1, and enter “{{API token}}” under Token 2. This references to the variable you’ve just created.

Now we can start adding requests.

Add a request by pressing the Add request button 3 on the left side of the screen.

Add requests

Latest data

This first request will be used to see the latest values in the datastream(s). This is useful if you want to see if there’s any data in the datastream at all, and/or to see when the latest data was added. This is particularly useful if you’re experimenting with uploading data to EnergyDataDK, and want to quickly check if you’ve been successful.

Name the new request “Fetch latest”.
Ensure the method is set to GET (default) and enter the the following URL in the URL field 1: “https://admin.energydata.dk/api/v1/datastreams/values”.

Select the Headers tab 2, select “Accept” under Key and enter “application/json” under Value 3.

Switch to the Params tab.

Add “latest” under Key and “true” under Value.
Add “ids” under Key and add the ID(s) of the datastream(s) you want to see the latest entry of. Separate your IDs with commas and without spaces. For example: “1234,2341,3412”.

Press the Save button to save your changes and finally press the Send button. You should now see a green “200 OK”.

If there is any data in your datastream you will see it at the bottom of the screen.
Please note: If the response is anything other than “200 OK” you have likely used an invalid ID or API token.

Range

If you don’t merely want the latest values, but instead want all data from a specific period, we can make a duplicate of this request and make a few small modifications.

Press the icon next the the request we created previously and select Duplicate.

Rename the request “Fetch range”.

Replace the “latest” key with “from” and replace “true” with the starting date of the range.

This needs to follow the following format: YYYY-MM-DDThh:mm:ss, for example “2026-08-01T00:00:00”.

Add a new key “to” and add the end date as its corresponding value.

Press the Save button to save your changes and finally press the Send button.
You should now see a green “200 OK” and the data from the specified period.