raptor
{
  "id": "raptor_v79BL9qV2Zmdh1FJ",
  "project": "project_x1gTb1fQ",
  "user": "user_a85ca5da",
  "refdate": "2020-12-25",
  "valuation_model": "PlusStorageAsset",
  "capacity": "200.000",
  "energy": "200.000",
  "startdate": "2024-01-01",
  "enddate": "2038-12-31",
  "value": "123456789.000"
}
raptor_inputs
{
  "raptor_id": "raptor_v79BL9qV2Zmdh1FJ",
  "refdate": "2020-12-25",
  "fordate": "2023-01-01",
  "asset": {
    "charge_speed": 300.0,
    "discharge_speed": 300.0,
    "asset_efficiency": 0.88,
    "discharge_capacity": 300.0
  },
  "margin": {
    "weekday": 945055.85,
    "weekend": 343692.19,
    "total": 1288748.04
  },
  "days": {
    "weekday": 21,
    "weekend": 10
  },
  "price": {
    "wdpk": 56.79,
    "wepk": 44.45,
    "7x8": 21.34
  },
  "scalars": {
    "wdpk": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    "wdop": [1, 1, 1, 1, 1, 1, 1, 1],
    "wepk": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    "weop": [1, 1, 1, 1, 1, 1, 1, 1]
  },
  "vol": {
    "wdpk": 0.65,
    "wepk": 0.5,
    "7x8": 0.2
  },
  "correlation": {
    "wdpk_7x8": 0.5,
    "wepk_7x8": 0.5
  }
}
raptor_result_header
{
  "id": 39033,
  "dtm_created": "2021-12-30T14:10:04.431840Z",
  "dtm_updated": "2021-12-30T14:10:04.431885Z",
  "refdate": "2020-12-25",
  "fordate": "2038-12-01",
  "price_wdpk": "32.170",
  "price_wepk": "24.060",
  "price_7x8": "20.670",
  "vol_wdpk": "0.600",
  "vol_wepk": "0.400",
  "vol_7x8": "0.200",
  "corr_wdpk_7x8": "0.500",
  "corr_wepk_7x8": "0.500",
  "days_wd": 23,
  "days_we": 8,
  "scalars_wdpk": null,
  "scalars_wdop": null,
  "scalars_wepk": null,
  "scalars_weop": null,
  "discharge_capacity": "151.156",
  "charge_speed": "151.156",
  "discharge_speed": "151.156",
  "asset_efficiency": "0.880",
  "margin_wd": "323618.980",
  "margin_we": "80099.070",
  "margin_total": "403718.060",
  "delta_wd": "0.070",
  "delta_we": "0.070",
  "delta_total": "0.000",
  "delta_wd_hourly": "0.0,0.0,0.0,0.0,-168.33,117.59,30.55,0.0,0.0,0.0,0.0,0.0,-6.82,0.0,-161.51,0.0,0.0,0.0,0.0,148.13,0.0,-153.54,135.12,0.0",
  "delta_we_hourly": "0.0,0.0,0.0,0.0,-168.33,74.45,73.68,0.0,0.0,0.0,0.0,0.0,-11.93,0.0,-156.4,0.0,0.0,0.0,0.0,148.13,0.0,-136.73,120.32,0.0",
  "weekday_scalars": "1.15,0.9,0.85,0.75,0.65,1.0,2.0,1.5,1.25,1.0,0.9,0.75,0.5,0.55,0.5,0.6,0.8,1.1,1.25,1.5,1.2,0.85,1.5,1.2",
  "weekend_scalars": "1.15,0.9,0.85,0.75,0.65,1.0,2.0,1.5,1.25,1.0,0.9,0.75,0.5,0.55,0.5,0.6,0.8,1.1,1.25,1.5,1.2,0.85,1.5,1.2",
  "forecast": 275
}
GET /v1/raptor

Raptor results


Result

Return a list of raptor objects

curl --location \
  --request GET \
  --header "Authorization: Token ${FINMACHINES_TOKEN}" \
  "https://api.finmachines.com/v1/raptor/"
import os
import requests
url = "https://api.finmachines.com/v1/raptor"
payload={}
headers = {
  "Authorization": f"Token {os.getenv('FINMACHINES_TOKEN')}"
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
[
  {
    "slug": "raptor_eXUXcj3z1Sqa1XWy",
    "project": 14,
    "dtm_created": "2022-01-19T08:14:58.759557Z",
    "dtm_updated": "2022-01-19T08:14:58.759567Z",
    "refdate": "2020-12-25",
    "startdate": "2023-01-01",
    "enddate": "2023-12-31",
    "capacity": 300.0,
    "energy": 300.0,
    "value": null,
    "valuation_model": "PlusStorageAsset"
  },
  {...},
  {...}
]
GET /v1/raptor/{raptor-slug}/

Raptor calculation results


Parameters

raptor-slug string

Format is raptor_abcd1234efgh5678.


Result

Returns a list of raptor_result_header objects.

curl --location \
  --request GET \
  --header "Authorization: Token ${FINMACHINES_TOKEN}" \
  "https://api.finmachines.com/v1/raptor/raptor_eXUXcj3z1Sqa1XWy/"
import os
import requests
url = "https://api.finmachines.com/v1/raptor/raptor_eXUXcj3z1Sqa1XWy/"
headers = {
  "Authorization": f"Token {os.getenv('FINMACHINES_TOKEN')}"
}
payload={}
response = requests.request("GET", url, headers=headers, data=payload)
raptor_results = response.text
[
  {
    "id": 39033,
    "dtm_created": "2021-12-30T14:10:04.431840Z",
    "dtm_updated": "2021-12-30T14:10:04.431885Z",
    "refdate": "2020-12-25",
    "fordate": "2038-12-01",
    "price_wdpk": "32.170",
    "price_wepk": "24.060",
    "price_7x8": "20.670",
    "vol_wdpk": "0.600",
    "vol_wepk": "0.400",
    "vol_7x8": "0.200",
    "corr_wdpk_7x8": "0.500",
    "corr_wepk_7x8": "0.500",
    "days_wd": 23,
    "days_we": 8,
    "scalars_wdpk": null,
    "scalars_wdop": null,
    "scalars_wepk": null,
    "scalars_weop": null,
    "discharge_capacity": "151.156",
    "charge_speed": "151.156",
    "discharge_speed": "151.156",
    "asset_efficiency": "0.880",
    "margin_wd": "323618.980",
    "margin_we": "80099.070",
    "margin_total": "403718.060",
    "delta_wd": "0.070",
    "delta_we": "0.070",
    "delta_total": "0.000",
    "delta_wd_hourly": "0.0,0.0,0.0,0.0,-168.33,117.59,30.55,0.0,0.0,0.0,0.0,0.0,-6.82,0.0,-161.51,0.0,0.0,0.0,0.0,148.13,0.0,-153.54,135.12,0.0",
    "delta_we_hourly": "0.0,0.0,0.0,0.0,-168.33,74.45,73.68,0.0,0.0,0.0,0.0,0.0,-11.93,0.0,-156.4,0.0,0.0,0.0,0.0,148.13,0.0,-136.73,120.32,0.0",
    "weekday_scalars": "1.15,0.9,0.85,0.75,0.65,1.0,2.0,1.5,1.25,1.0,0.9,0.75,0.5,0.55,0.5,0.6,0.8,1.1,1.25,1.5,1.2,0.85,1.5,1.2",
    "weekend_scalars": "1.15,0.9,0.85,0.75,0.65,1.0,2.0,1.5,1.25,1.0,0.9,0.75,0.5,0.55,0.5,0.6,0.8,1.1,1.25,1.5,1.2,0.85,1.5,1.2",
    "forecast": 275
  }
  {...},
  {...}
]
POST /v1/raptor/calc/

Launch Raptor calculation


Parameters

files list

List of XLSX files.


Result

Returns a task-status that can be used to check on the status of a calculation until it is completed.

curl --location \
  --request POST \
  --header "Authorization: Token ${FINMACHINES_TOKEN}" \
  --form "source=@'/path/to/raptor-input-file.xlsx'" \
  "https://api.finmachines.com/v1/raptor/calc/"
import os
import requests
url = "https://api.finmachines.com/v1/raptor/calc/"
filepath = "/path/to/excel-file.xlsx"
content_type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
headers = {
  "Authorization": f"Token {os.getenv('FINMACHINES_TOKEN')}"
}
payload = {}
files = [("source", (os.path.basename(filepath), open(filepath, "rb"), content_type))]
response = requests.request("POST", url, headers=headers, data=payload, files=files)
{
  "task_id": "task_wQ9zWgFM72xH81bL"
}
GET /v1/raptor/task/{task-status}/status

Check calculation status

Check the status of a calculation initiated either from the website or via the /calc/ API.


Result

error dict

status dict

success dict

curl --location \
  --request GET \
  --header "Authorization: Token ${FINMACHINES_TOKEN}" \
  "https://api.finmachines.com/v1/raptor/task/task_wQ9zWgFM72xH81bL/status/"
import os
import requests
url = "https://api.finmachines.com/v1/raptor/task/task_wQ9zWgFM72xH81bL"
headers = {
  "Authorization": f"Token {os.getenv('FINMACHINES_TOKEN')}"
}
payload={}
response = requests.request("GET", url, headers=headers, data=payload)
task_status = response.text
{
  "error": ""
}
{
  "status": "Crunching numbers ... please check back in a while"
}
{
  "slug": "raptor_eXUXcj3z1Sqa1XWy",
  "dtm_created": "2022-01-19T08:14:58.759557Z",
  "dtm_updated": "2022-01-19T08:14:58.759567Z",
  "project": 14,
  "energy": "300.000",
  "capacity": "300.000",
  "refdate": "2020-12-25",
  "startdate": "2023-01-01",
  "enddate": "2023-12-31",
  "nodes": 20,
  "value": None,
  "valuation_model": "PlusStorageAsset"
}
GET /v1/raptor/{raptor-slug}/{datatype}

Revenue Forecast with datatype


Parameters

raptor-slug string

Format is raptor_abcd1234efgh5678.


datatype string

Allowed values are

  • volatility
  • regup
  • regdown
  • spin
  • revenue

Result

Returns a list of dictionaries.

curl --location \
  --request GET \
  --header "Authorization: Token ${FINMACHINES_TOKEN}" \
  "https://api.finmachines.com/v1/raptor/raptor_eXUXcj3z1Sqa1XWy/revenue/"
import os
import requests
url = "https://api.finmachines.com/v1/raptor/task/raptor_eXUXcj3z1Sqa1XWy/revenue/"
headers = {
  "Authorization": f"Token {os.getenv('FINMACHINES_TOKEN')}"
}
payload={}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
[
  [
    {
      "dart": 0, 
      "spin": 86954.45999999999, 
      "regup": 10137.6, 
      "total": 1526389.9300000002, 
      "energy": 819660.8400000001, 
      "fordate": "2023-01-01", 
      "nonspin": 0, 
      "regdown": 6208.75, 
      "capacity": 0, 
      "energy_negative": -101376.41, 
      "energy_positive": 704804.69
    }
  ], 
  11891287.8, 
  {
    "spin": 1182488.13, 
    "regup": 69901.43, 
    "energy": 10554710.5, 
    "regdown": 84187.74000000002
  }
]
GET /v1/raptor/{raptor-slug}/{file-type}/

Download files


Parameters

raptor-slug string

Format is raptor_abcd1234efgh5678.

file-type string

Allowed values are:

  • upload
  • result

Result

Returns an XLSX file

curl --location \
  --request GET \
  --header "Authorization: Token ${FINMACHINES_TOKEN}" \
  "https://api.finmachines.com/v1/raptor/raptor_vbsIJlwkBM2rFqGa/download/upload_file"
import os
import requests
url = "https://api.finmachines.com/v1/raptor/raptor_vbsIJlwkBM2rFqGa/download/upload/"
headers = {
  "Authorization": f"Token {os.getenv('FINMACHINES_TOKEN')}"
}
payload={}
response = requests.request("GET", url, headers=headers, data=payload)