NAV
  • Introduction
  • Production
  • Forecast
  • Commitment
  • Tariff
  • Status codes
  • Examples
  • Introduction

    Welcome to EDF Store & Forecast API v1 documentation !

    We have tried to make this documentation user-friendly and example-filled, but if you have any questions, please head to our support team: support@edf-sf.com.

    Version 2 of the API is out ! You can find the documentation here

    Production

    Production endpoint enables to get or put site production data.

    Get production

    GET renewable equipment example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    "https://api-preprod.edf-sf.com/v1/100/production/renewable/1?from=1535104800000&to=1535133600000"
    

    The above command returns JSON structured like this:

    {
      "status_code": 1000,
      "status_message": "success",
      "results": [
        {
          "timestamp": 1535104800000,
          "id": 1,
          "p": 401.92,
          "q": 9.43
        },
        {
          "timestamp": 1535104801000,
          "id": 1,
          "p": 399.54,
          "q": 8.86
        }
      ]
    }
    

    GET method on this endpoint retrieves equipment records for the requested site ID, equipment type and equipment ID.

    HTTP Request

    GET https://api.edf-sf.com/v1/<site_id>/production/<equipment_type>/<equipment_id>

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID
    equipment_typestringequipment type
    equipment_idunsigned intequipment ID

    Query Parameters

    ParameterTypeMandatoryDescription
    fromunsigned intnofilter records from this ms timestamp - use with to
    tounsigned intnofilter records to this ms timestamp - use with from
    aggstringnoaggregate records with min, max or avg function - use with from, to and agg
    periodstringnoaggregate records over this duration (ex. 30s, 15m or 1h) - use with agg

    Put production

    PUT method on this endpoint pushes equipment records for the given site ID and equipment type. Several equipment IDs can be pushed in a single request.

    PUT renewable equipment example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    -X PUT -H "Content-Type: application/json" -d
    '{
      "values": [
       {
         "timestamp": 1535104800000,
         "id": 1,
         "p": 401.92,
         "q": 9.43
       }
      ]
    }' "https://api-preprod.edf-sf.com/v1/100/production/renewable"
    

    The above command returns JSON structured like this:

    {
      "status_code": 1000,
      "status_message": "success"
    }
    

    HTTP Request

    PUT https://api.edf-sf.com/v1/<site_id>/production/<equipment_type>

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID
    equipment_typestringequipment type

    Equipment types

    Supported equipment types

    anemometer

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "speed": 12.67,
      "direction": 182
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-anemometer id
    speedfloatm/swind speed
    directionfloat°wind direction

    battery

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "soc": 78.21,
      "e": 425.3,
      "p": 209.44,
      "p_ch": -1000.0,
      "p_disch": 1000.0,
      "q": -6.37,
      "q_max": 100.0,
      "q_min": -100.0,
      "state": 4
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-battery id
    socfloat%battery SoC (state of charge)
    efloatkWhbattery stored energy
    pfloatkWbattery active power output (p>0: discharge, p<0: charge)
    p_chfloatkWbattery maximal charging active power capability
    p_dischfloatkWbattery maximal discharging active power capability
    qfloatkvarbattery reactive power output (q<0: capacitive, q>0: inductive)
    q_maxfloatkvarbattery maximal reactive power output capability
    q_minfloatkvarbattery minimal reactive power output capability
    stateunsigned int-battery state

    state possible values:

    StateDescription
    0battery disabled locally (config), remotely (PCS) or failed
    1battery is offline, inverter is disconnected from the grid
    2battery is starting up
    3battery is starting up in black start mode
    4battery is ready and in P/Q mode (grid-following)
    5battery is ready and on power saving mode (idle mode)
    6battery is ready and under manual control
    7battery is ready and in U/f mode (grid-forming)

    flexible-load

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "p": 31.25,
      "state": 3
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-flexible load id
    pfloatkWflexible load active power consumption
    stateunsigned int-flexible load state

    state possible values:

    ValueDescription
    0flexible load controller is unreachable, has failed or is disabled
    1flexible load is off
    2flexible load is on with a maximum power cap
    3flexible load is on without power cap

    genset

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "p": 82.36,
      "q": -7.12,
      "state": 3
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-genset id
    pfloatkWgenset active power output
    qfloatkvargenset reactive power output
    stateunsigned int-genset state

    state possible values:

    ValueDescription
    0genset controller is unreachable, has failed or is disabled
    1genset engine is stopped
    2genset engine has started, genset is syncing to grid frequency
    3genset is operational and injecting power into the grid

    hygrometer

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "h": 65.25
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-hygrometer id
    hfloat%hygrometry measure

    meter

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "p": 52.07,
      "q": -4.98,
      "f": 50.01,
      "u": 399.56,
      "i": 0.27
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-meter id
    pfloatkWactive power measure
    qfloatkvarreactive power measure
    ffloatHzfrequency measure
    ufloatVvoltage measure
    ifloatAintensity measure

    meter-dc

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "p": 52.07,
      "u": 401.84
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-meter id
    pfloatkWactive power measure
    ufloatVvoltage measure

    meter-3p

    Example:

    {
      "timestamp": 1535104800000,
      "id": 2,
      "l1_p": 48.34,
      "l2_p": 49.63,
      "l3_p": 50.88,
      "l1_q": 0.08,
      "l2_q": -0.41,
      "l3_q": 0.72,
      "l1_i": 0.52,
      "l2_i": 0.51,
      "l3_i": 0.49,
      "l12_u": 399.47,
      "l23_u": 401.21,
      "l31_u": 399.95,
      "f": 50.01
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-three phase meter id
    l1_pfloatkWphase 1 active power measure
    l2_pfloatkWphase 2 active power measure
    l3_pfloatkWphase 3 active power measure
    l1_qfloatkvarphase 1 reactive power measure
    l2_qfloatkvarphase 2 reactive power measure
    l3_qfloatkvarphase 3 reactive power measure
    l1_ifloatAphase 1 current measure
    l2_ifloatAphase 2 current measure
    l3_ifloatAphase 3 current measure
    l12_ufloatVphase 1-2 voltage measure
    l23_ufloatVphase 2-3 voltage measure
    l31_ufloatVphase 3-1 voltage measure
    ffloatHzfrequency measure

    metric

    Example:

    {
      "timestamp": 1535104800000,
      "id": 54,
      "value": 49.97
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-metric id
    valuefloat-metric value

    pyranometer

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "irr": 1338.50
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-pyranometer id
    irrfloatw/m²irradiance

    renewable

    Example:

    {
      "timestamp": 1535104800000,
      "id": 1,
      "p": 561.77,
      "q": 17.91
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-renewable asset id
    pfloatkWrenewable asset active power output
    qfloatkvarrenewable asset reactive power output

    setpoint

    Example:

    {
      "timestamp": 1535104800000,
      "id": 3,
      "p": 269.96,
      "q": 0.00,
      "command": 5
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-setpoint id
    pfloatkWactive power setpoint
    qfloatkvarreactive power setpoint
    commandunsigned int-command word

    status

    Example:

    {
      "timestamp": 1535104800000,
      "id": 102,
      "value": 3
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-status id
    valueunsigned int-status value

    thermometer

    Example:

    {
      "timestamp": 1535104800000,
      "id": 10,
      "t": 25.50
    }
    
    AttributeTypeUnitDescription
    timestampunsigned intmsrecord UTC timestamp
    idunsigned int-thermometer id
    tfloat°Ctemperature measure

    Forecast

    The forecast endpoint can be used to GET or PUT forecast data for a given site.

    Forecasts are stored as vectors of forecast periods.

    Forecast periods obey the left convention (or beginning convention), which means that a forecast period is effective starting from its timestamp until the timestamp of the next forecast period.

    Forecast attributes:

    AttributeTypeUnitDescription
    creation_timestampunsigned intmsforecast generation time (UTC timestamp)
    idunsigned int-forecast id
    valueslist-forecast periods list (see forecast types section for more details on forecast periods attributes)

    Get forecast

    GET method on this endpoint returns forecast vector for the requested site ID, forecast type and forecast ID.

    GET solar forecast example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    "https://api-preprod.edf-sf.com/v1/100/forecast/solar/1?from=1535104800000&to=1535106600000"
    

    The above command returns JSON structured like this:

    {
      "status_code": 1000,
      "status_message": "success",
      "results": [
        {
          "creation_timestamp": 1535104800000,
          "id": 1,
          "values": [
            {
              "timestamp": 1535104800000,
              "p": 1572.64,
              "quality": 1
            },
            {
              "timestamp": 1535106600000,
              "p": 1650.94,
              "quality": 1
            }
          ]
        }
      ]
    }
    

    Forecast vectors can be filtered according to their creation date with generated-after and generated-before parameters. A selected forecast vector can be filtered with from, to parameters.

    See examples to get a visual example.

    HTTP Request

    GET https://api.edf-sf.com/v1/<site_id>/forecast/<forecast_type>/<forecast_id>

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID
    forecast_typestringforecast type
    forecast_idunsigned intforecast ID

    Query Parameters

    ParameterTypeMandatoryDescription
    generated-afterunsigned intnofilter forecast created after this ms timestamp - use with generated-before
    generated-beforeunsigned intnofilter forecast created before this ms timestamp - use with generated-after
    generate-allboolnoif set to true, request returns all vectors in [generated-after; generated-before[, otherwise only the latest in the considered interval - use with generated-after and generated-before
    fromunsigned intnofilter records from this ms timestamp - use with to
    tounsigned intnofilter records to this ms timestamp - use with from
    aggstringnoaggregate records with min, max or avg function - use with from, to and agg
    periodstringnoaggregate records over this duration (ex. 30s, 15m or 1h) - use with agg

    Put forecast

    PUT method on this endpoint pushes forecast vectors for the given site ID and forecast type. Several forecast vectors with different forecast IDs can be pushed in a single request.

    PUT wind forecast example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    -X PUT -H "Content-Type: application/json" -d
    '{
      "values": [
         {
            "creation_timestamp": 1535104800000,
            "id": 1,
            "values": [
              {
                "timestamp": 1535104800000,
                "p": 1572.64,
                "quality": 1
              },
              {
                "timestamp": 1535106600000,
                "p": 1650.94,
                "quality": 1
              }
            ]
         }
      ]
    }' "https://api-preprod.edf-sf.com/v1/100/forecast/wind"
    

    The above command returns JSON structured like this:

    {
      "status_code": 1000,
      "status_message": "success",
    }
    

    HTTP Request

    PUT https://api.edf-sf.com/v1/<site_id>/forecast/<forecast_type>

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID
    forecast_typestringforecast type

    Forecast types

    Demand

    Example:

    {
      "timestamp": 1535104800000,
      "p": 411.08,
      "quality": 1
    }
    

    Forecast type: demand

    AttributeTypeUnitDescription
    timestampunsigned intmsforecast UTC timestamp
    pfloatkWdemand forecast
    qualityunsigned int-forecast quality

    Solar

    Example:

    {
      "timestamp": 1535104800000,
      "p": 350.66,
      "quality": 1
    }
    

    Forecast type: solar

    AttributeTypeUnitDescription
    timestampunsigned intmsforecast UTC timestamp
    pfloatkWsolar production forecast
    qualityunsigned int-forecast quality

    Wind

    Example:

    {
      "timestamp": 1535104800000,
      "p": 1475.58,
      "quality": 1
    }
    

    Forecast type: wind

    AttributeTypeUnitDescription
    timestampunsigned intmsforecast UTC timestamp
    pfloatkWwind production forecast
    qualityunsigned int-forecast quality

    Aggregate

    Example:

    {
      "timestamp": 1535104800000,
      "p": 627.34,
      "quality": 1
    }
    

    Forecast type: aggregate

    AttributeTypeUnitDescription
    timestampunsigned intmsforecast UTC timestamp
    pfloatkWproduction forecast
    qualityunsigned int-forecast quality

    Commitment

    The commitment endpoint can be used to GET or PUT commitment data for a given site.

    Commitments are stored as vectors of commitment periods.

    Commitment periods obey the left convention (or beginning convention), which means that a commitment period is effective starting from its timestamp until the timestamp of the next commitment period.

    Commitment attributes:

    AttributeTypeUnitDescription
    creation_timestampunsigned intmscommitment generation time (UTC timestamp)
    idunsigned int-commitment id
    qualityunsigned int-quality of the forecast used to generate the commitment
    valueslist-commitment periods list

    Commitment period attributes:

    AttributeTypeUnitDescription
    timestampunsigned intmscommitment period start time (UTC timestamp)
    valuefloat-commitment value, unit depends on the commitment (i.e. kW, kvar, kWh)

    Get commitment

    GET method on this endpoint returns commitment vector for the requested site ID and commitment ID.

    GET commitment example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    "https://api-preprod.edf-sf.com/v1/100/commitment/1?from=1535104800000&to=1535106600000"
    

    The above command returns JSON structured like this:

    {
      "status_code": 1000,
      "status_message": "success",
      "results": [
        {
          "creation_timestamp": 1535104800000,
          "id": 1,
          "quality": 1,
          "values": [
            {
              "timestamp": 1535104800000,
              "value": 1100.0
            },
            {
              "timestamp": 1535106600000,
              "value": 950.4
            }
          ]
        }
      ]
    }
    

    Commitment vectors can be selected according to their creation date with generated-after and generated-before parameters. A selected commitment vector can be filtered with from, to parameters.

    See examples to get a visual example.

    HTTP Request

    GET https://api.edf-sf.com/v1/<site_id>/commitment/<commitment_id>

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID
    commitment_idunsigned intcommitment ID

    Query Parameters

    ParameterTypeMandatoryDescription
    generated-afterunsigned intnofilter commitment created after this ms timestamp - use with generated-before
    generated-beforeunsigned intnofilter commitment created before this ms timestamp - use with generated-after
    generate-allboolnoif set to true, request returns all vectors in [generated-after; generated-before[, otherwise only the latest in the considered interval - use with generated-after and generated-before
    fromunsigned intnofilter records from this ms timestamp - use with to
    tounsigned intnofilter records to this ms timestamp - use with from
    aggstringnoaggregate records with min, max or avg function - use with from, to and agg
    periodstringnoaggregate records over this duration (ex. 30s, 15m or 1h) - use with agg

    Put commitment

    PUT method on this endpoint pushes commitment vectors for the given site ID. Several commitment vectors with different commitment ID can be pushed in a single request.

    PUT commitment example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    -X PUT -H "Content-Type: application/json" -d
    '{
      "values": [
         {
            "creation_timestamp": 1535104800000,
            "id": 1,
            "quality": 1,
            "values": [
                {
                  "timestamp": 1535104800000,
                  "value": 1100.0
                },
                {
                  "timestamp": 1535106600000,
                  "value": 950.4
                }
            ]
         }
      ]
    }' "https://api-preprod.edf-sf.com/v1/100/commitment"
    

    The above command returns JSON structured like this:

    {
      "status_code": 1000,
      "status_message": "success"
    }
    

    HTTP Request

    PUT https://api.edf-sf.com/v1/<site_id>/commitment

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID

    Tariff

    The tariff endpoint can be used to GET or PUT tariff data for a given site.

    Tariffs are stored as vectors of tariff periods.

    Tariff periods obey the left convention (or beginning convention), which means that a tariff period is effective starting from its timestamp until the timestamp of the next tariff period.

    Tariff attributes:

    ParameterTypeUnitDescription
    idunsigned int-tariff id
    valueslist-tariff periods list

    Tariff period attributes:

    ParameterTypeUnitDescription
    timestampunsigned intmstariff period start time (UTC timestamp)
    labelstringkWtariff period label, used to identify specific period (i.e. on-peak)
    valuefloat-tariff period value, unit depends on the tariff (currency/kW or currency/kWh)

    Example:

    {
        "id": 1,
        "values": [
            {
            "timestamp": 1535104800000,
            "label": "on-peak",
            "value": 9.85
            }
        ]
    }
    

    Get tariff

    GET method on this endpoint returns tariff periods for the requested site ID and tariff ID.

    GET tariff example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    "https://api-preprod.edf-sf.com/v1/100/tariff/1?from=1535104800000&to=1535107000000"
    

    The above command returns JSON structured like this:

    {
        "status_code": 1000,
        "status_message": "success",
        "results": [
            {
                "id": 1,
                "values": [
                    {
                        "timestamp": 1540486800000,
                        "label": "on-peak",
                        "value": 9.85
                    },
                    {
                        "timestamp": 1540501200000,
                        "label": "off-peak",
                        "value": 5.2
                    },
                    {
                        "timestamp": 1540573200000,
                        "label": "on-peak",
                        "value": 9.85
                    },
                    {
                        "timestamp": 1540587600000,
                        "label": "off-peak",
                        "value": 5.2
                    }
                ]
            }
        ]
    }
    

    Tariff periods can be filtered with from, to parameters.

    HTTP Request

    GET https://api.edf-sf.com/v1/<site_id>/tariff/<tariff_id>

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID
    tariff_idunsigned inttariff ID

    Query Parameters

    ParameterTypeMandatoryDescription
    fromunsigned intnofilter records from this ms timestamp - use with to
    tounsigned intnofilter records to this ms timestamp - use with from

    Put tariff

    PUT method on this endpoint pushes tariff periods for the requested site ID. Several tariffs periods with different tariff IDs can be pushed in a single request.

    PUT tariff example:

    curl --cacert ca.cert.pem --cert cert.pem --key key.pem
    -X PUT -H "Content-Type: application/json" -d
    '{
        "values": [
            {
                "id": 1,
                "values": [
                    {
                        "timestamp": 1540486800000,
                        "label": "on-peak",
                        "value": 9.85
                    },
                    {
                        "timestamp": 1540501200000,
                        "label": "off-peak",
                        "value": 5.2
                    }
                ]
            }
        ]
    }' "https://api-preprod.edf-sf.com/v1/100/tariff"
    

    The above command returns JSON structured like this:

    {
      "status_code": 1000,
      "status_message": "success"
    }
    

    HTTP Request

    PUT https://api.edf-sf.com/v1/<site_id>/tariff

    URL Parameters

    ParameterTypeDescription
    site_idunsigned intrequested site ID

    Status codes

    HTTP status codes

    Here are the HTTP status codes that can be returned by our API:

    StatusDescriptionReturned when
    200OKGET request succeeded
    201CreatedPUT request succeeded
    206Partial contentGET request response content is incomplete
    400Bad requestrequested id is unknown, parameters are not consistent or payload is malformed
    403Forbiddenclient certificate does not have the necessary permissions for the requested resource
    404Not foundendpoint requested does not match with EDF S&F API endpoints pattern
    405Method Not Allowedrequest HTTP method is not GET or PUT
    500Internal server errorsomething went wrong on EDF S&F API server side

    API status codes

    Here are the API status codes that can be returned by our API in response payloads:

    StatusDescriptionReturned when
    1000successrequest succeeded
    1001partial responseGET request response content is incomplete. Response has been truncated because the request returned too many records
    1101invalid endpointendpoint requested is invalid
    1102invalid methodrequest HTTP method is not GET or PUT
    1103invalid headerrequest header is missing or invalid
    1104invalid site_idsite_id used in request is invalid
    1105invalid categorycategory in request endpoint is not equipment, forecast, commitment or tariff
    1106invalid typeequipment or forecast type used in request is invalid
    1107invalid idequipment, forecast, commitment or tariff id used in request is invalid
    1200invalid parametersparameters combination used in request is invalid
    1201invalid fromfrom parameter used in request is invalid
    1202invalid toto parameter used in request is invalid
    1203invalid generated-aftergenerated-after parameter used in request is invalid
    1204invalid generated-beforegenerated-before parameter used in request is invalid
    1205invalid aggagg parameter used in request is invalid
    1206invalid periodperiod parameter used in request is invalid
    1301payload encoding errorserver failed to decode the PUT request payload
    1302payload empty errorPUT request payload is empty
    1303payload content errorPUT request payload content is invalid
    1400permission errorclient certificate is missing or does not have the necessary permissions to access the requested resource
    1500server errorEDF S&F API server internal error

    Examples

    Forecast and commitments parameters

    The vector extracted is the most recent created in the [generated_after, generated_before[ interval.

    The vector contains exclusively data with timestamps in the [from, to[ interval.

    Python

    Python GET request example on production endpoint:

    import requests
    
    # certification authority certificate
    ca_cert = 'ca.cert.pem'
    
    # client certificate and private key
    client_certs = ('cert.pem', 'pkey.pem')
    
    # request to production endpoint for site 100 and battery 1
    endpoint = "https://api-preprod.edf-sf.com/v1/100/production/battery/1"
    
    headers = {
        'Accept': 'application/json',
    }
    
    # request data interval [2018-11-10 12:00:00 UTC, 2018-11-12 20:00:00 UTC[
    # aggregated with average function over 1mn periods
    params = {
        'from': 1541851200000,
        'to': 1541880000000,
        'agg': 'avg',
        'period': '1m'
    }
    
    r = requests.get(endpoint,
                     verify=ca_cert,
                     cert=client_certs,
                     headers=headers,
                     params=params)
    
    if r.status_code != 200:
        print('request failed: unexpected HTTP status ({})'.format(r.status_code))
    else:
        print(r.json())