ReMoni knowledge Center

Search for answers to your questions by entering keywords below, or look through our knowledge center.

Retrieve data from the API


This guide covers how to get a URL string out of ReMonis API. With the URL string, you can retrieve data from the API, e.g. in Excel or just by inserting it into a browser's address bar.

 

Find the Unit from which to retrieve data.

  1. Login to ReCalc.

  2. Under Installations, click Units.
    ReCalc-Untis.jpg

  3. Find the unit from which to retrieve data. The "ID" column contains the Unit ID to be used later in this guide.
    ReCalc-Units_ID.jpg

  4. To find the type of unit created, click the View button of the unit in which you want to retrieve data.
    ReCalc_-_View_knap.jpg

  5. Here is the Unit type.
    ReCalc_-_View_Unit.jpg

API step by step.

  1. Open the page api.remoni.com.

  2. Click Authorize in the upper right corner.
    API_-Authorize.jpg

  3. Login with the same login information as on ReCalc.

  4. Locate and click Get /Data.
    API_-_Data_sektion.jpg

  5. In the unfolded tab, find the following fields:
    Timestamp: The starting point from which data is to be retrieved. Year-month-day.
    UnitId: The ID of the unit from which data is to be retrieved. Unique 4 digit number from ReCalc.
    AggregateType: The type of aggregate to retrieve data in. Raw, Minutes5, Hour, Day.
    DataType: The type of data to be retrieved.
    UnitTypeInputId: Consists of two numbers put together, e.g. 3001. The first 2 digits are the unit type ID, e.g. is 30 a Generic PowerMoniMain. The last two digits are the channel number 01, 02, 03, etc.

    In order to retrieve data, UnitId, DataType and UnitTypeInputId must match. In the table below you can see the connection between the three parameters. First, find which UnitType is created in ReCalc, then select which type of data to retrieve and then which channel to retrieve from.

    UnitType

    DataType

    UnitTypeInputId

     

     

    Sum*1

    Channel 1

    Channel 2

    Channel 3

    Generic PowerMoniMain

    power

    null

    3001

    3002

    3003

    current

    null

    3001

    3002

    3003

     

     

    Generic PowerMoniSpot

    uncalibrated-current

     

    2801

     

     

    apparent-power*2

     

    2801

     

     

     

     

    Generic HeatMoniSpot

    temperature

     

    3101

    3102

    3103

     

     

    GatewayAir

    CO2

     

    4701

     

     

     

    temperature

     

     

    4702

     

     

    humidity

     

     

     

    4703

    * 1 The summed value for all three channels.
    * 2 To be able to retrieve apparent power, a PowerMoniSpot must be calibrated to level2.

  6. In the field, Timestamp write le(2030-01-01). le stands for less than or equal to. This means that all data from before the date will be retrieved. See the example below:
    API_-_Timestamp.jpg

  7. In UnitId write the 4 digit number we found in ReCalc. Write it like this eq(0002). eq stands for equal / straight and this means that it only retrieves data from this number. See the example below:
    API_-_UnitID.jpg

  8. In AggregateType, type eq(Hour). It can be Raw, Minutes5, Hour or Day. See the example below:
    API_-_AggregateType.jpg

  9. DataType is written as eq(power). See the example below:
    API_-_DataaType.jpg

  10. UnitTypeInputId is written as eq(3001). See example below:
    API_-_UnitTypeInputId.jpg

  11. Then click Try it out!
    API_-_Try_it_out_.jpg

  12. If everything is entered correctly, the Response Body field should look like this:
    API_-_Response.jpg

    If there is an error in the entry, the Response Body field looks like this:
    API_-_BadRequestErrors.jpg

  13. If everything is entered correctly, the URL in the Request URL field can be copied and used, for example, in Excel.
    API_-_Request_URL.jpg

Examples:
Below are a few examples of a URL string that retrieves data from three demo Units.

1. Temperature:
Here we retrieve the data that is later than 2017-01-01, from Unit 1258 (Generic HeatMoniSpot), it retrieves hourly data, the data type is temperature, it is on the unit channel 3101 and it retrieves the latest 10000 rows.

https://api.remoni.com/v1/Data?Timestamp=gt(2017-01-01)&UnitId=eq(1258)&AggregateType=eq(Hour)&DataType=eq(temperature)&UnitTypeInputId=eq(3101)&top=10000

 

2. Uncalibrated-current:
Here we retrieve the data that is later than 2017-01-01, from Unit 2343 (Generic PowerMoniSpot), it retrieves hourly data, the data type is uncalibrated-current, it is on unit channel 2801 and it retrieves the latest 10000 rows.

https://api.remoni.com/v1/Data?Timestamp=gt(2017-01-01)&UnitId=eq(2343)&AggregateType=eq(Hour)&DataType=eq(uncalibrated-current)&UnitTypeInputId=eq(2801)&top=10000

 

3. Power:
Here we retrieve the data that is data that is before 2040-01-01 from Unit 6415 (Generic PowerMoniMain), it retrieves hourly data, the data type is Power, data is on unit channel null (a summation of the 3 channels) and it retrieves the latest 20 rows.

https://api.remoni.com/v1/Data?orderbydesc=Timestamp&Timestamp=lt(2040-01-01)&UnitId=eq(6415)&AggregateType=eq(Hour)&DataType=eq(Power)&UnitTypeInputId=eq(null)&top=20