Skip to content
Nick Laws edited this page Sep 16, 2021 · 24 revisions

Welcome to the REopt-API-Analysis wiki!

This wiki is a work in progress. Check back soon for a full documentation.

For now please see https://developer.nrel.gov/docs/energy-optimization/reopt-v1/

NOTE: The documentation in this wiki is for using the API. For documentation on developing the REopt Lite API please go here.

Accessing the API

The API is hosted at https://developer.nrel.gov/api/reopt. In order to access the API you need to get an API key. Once you have a key you can access the API with something like:

https://developer.nrel.gov/api/reopt/stable/help?API_KEY=DEMO_KEY

You will have to replace DEMO_KEY with your own key (the DEMO_KEY only allows a few hits per day).

Running a REopt "job" in the API

The REopt API includes many endpoints. However, the main use case is running an optimization job and getting the results of the job, which is a two-step process.

Step 1: POST a job

First, you POST your REopt Scenario to the job endpoint, i.e. https://developer.nrel.gov/api/reopt/stable/job. POST'ing can be done with many tools. This repository includes python functions to make it easy to POST your jobs to the API.

The job endpoint will return a run_uuid in JSON format, like

{"run_uuid": "288523d9-b3ca-491b-a490-27b10c384ce1"}

Go here for information on all the inputs for a job.

Step 2: GET results

The second step is to GET your results at the results endpoint using your run_uuid. The URL will look like:

https://developer.nrel.gov/api/reopt/stable/job/288523d9-b3ca-491b-a490-27b10c384ce1/results

Note that it can take some time to optimize your Scenario. While the job is running the Scenario.status will be "Optimizing...". Once the job is complete the status will be "optimal" (assuming no problems were encountered).

The API response will contain three top level keys:

  • "inputs": all of the inputs that you provided in addition to all the other default values that were used;
  • "outputs": the optimization results; and
  • "messages": information on input validation as well as errors if they occured.

Go here for information on all the outputs for a job.