Loading
Click to Buy

PowerGrid API Documentation

Authorization

For access endpoints, you must be authenticated.

Authentication:
Add the Authorization header to your request and set the value "ENIAN <token>"

cURL example
curl -H 'Authorization: ENIAN <token>' -L '<endpoint_url_with_query_parameters>'

PHP example
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"<endpoint_url_with_query_parameters>");
$headers = [
  'Authorization' => 'ENIAN <token>'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$server_output = curl_exec ($ch);
curl_close ($ch);
print_r($server_output);

Get power plants

The power plants endpoint allows querying of ENIAN's proprietary database, which includes more than 55,000 C&I-scale solar PV and wind projects from around the globe.

Request

  • Endpoint: https://api.enian.co/api/projects
  • Request method: GET
  • Request header: Authorization
  • Request query parameters:
    • lat (latitude, required, float, min -90, max 90)
    • lon (latitude, required, float, min -180, max 180)
    • query_type (required, "distance" or "nearest")
    • distance (float, required if query_type is "distance", max 100, min 1)
    • nearest_qty (float, required if query_type is "nearest", max 100, min 1)
    • filters (array, optional)
      • type (string, optional, "S" for solar or "W" for wind)
      • capacity (array, optional)
        • min (float, optional, min 1 [in kWh])
          greater or equals
        • max (float, optional, min 1 [in kWh])
          lower or equals
      • lcoe (array, optional)
        • min (float, optional, min 1 [in USD/MWh])
          greater or equals
        • max (float, optional, min 1 [in USD/MWh])
          lower or equals

Example cURL request

curl -H 'Authorization: ENIAN <token>' -L 'https://api.enian.co/api/projects?lat=43.1815&lon=19.61456&query_type=nearest&nearest_qty=20&filters[type]=S&filters[capacity][min]=20&filters[lcoe][max]=60.5'
This query shows the 20 nearest Solar PV projects to coordinates 19.1815, 43.61456, where capacity is greater or equals than 20 kWh and LCOE is lower than or equals 60.5 USD/MWh.

Responses

Attributes
projectname
String, the name of project
latitude
latitude
longitude
longitude
developer
Project developer's name
currency
Currency code (eg. USD)
technology_type
S (solar PV) or W (Wind)
capacity
float, maximum capacity in kWh
rate
float, rate
lifetime
int, lifetime
cap_service
float, cap_service
int_rate
float, int_rate
distance
float, distance in KM from passed coordinates
lcoe
object, lcoe data
lcoe -> lcoe
float, LCOE
lcoe -> ep
float, annual energy production, kWh
lcoe -> capex
float, capex
lcoe -> opex
float, opex
HTTP/1.1 401 Unauthorized
(if token is missing or expired)

Headers

Content-Type:application/json

Body

{
    "status": "error",
    "messages": {
        "token": [
            "invalid"
        ]
    }
}
HTTP/1.1 403 Forbidden
(if quota exceed)

Headers

Content-Type:application/json

Body

{
    "status": "error",
    "messages": {
        "quota": [
            "quota exceed"
        ]
    }
}
HTTP/1.1 400 Bad request
(missing required parameters, or invalid parameter)

Headers

Content-Type:application/json

Body

{
    "status": "error",
    "messages": {
        "lat": [
            "Latitude is required!"
        ],
        "lon": [
            "Longitude is required!"
        ],
        "query_type": [
            "Query type is required!"
        ]
    }
}
HTTP/1.1 200 Ok

Headers

Content-Type:application/json

Body

{
    "status": "ok",
    "data": [
        {
            "projectname": "Florina Solar Power Plant",
            "latitude": "40.8227",
            "longitude": "21.5178",
            "developer": "AES Solar Energy Ltd",
            "currency": "USD",
            "technology_type": "S",
            "project_stage": "In operation",
            "capacity": "4300",
            "rate": "0.066",
            "lifetime": "30",
            "eq": "0.25",
            "cap_service": "0.055",
            "int_rate": "0.02",
            "distance": "305.800852947695",
            "lcoe": {
                "lcoe": "35",
                "ep": "7802600.30940676",
                "capex": "3771100",
                "opex": "30100"
            }
        },
        ...
        ...
    ]
}

Get grid

The grid endpoint allows querying ENIAN's global power grid database, which includes millions of energy infrastructure data points, ranging from power lines through transmission and distribution substations to switchgear.

Request

  • Endpoint: https://api.enian.co/api/grid
  • Request method: GET
  • Request header: Authorization
  • Request query parameters:
    • lat (latitude, required, float, min -90, max 90)
    • lon (latitude, required, float, min -180, max 180)
    • query_type (required, "distance" or "nearest")
    • distance (float, required if query_type is "distance", max 100, min 1)
    • nearest_qty (float, required if query_type is "nearest", max 100, min 1)
    • power_type (string, required, (line, substation, transformer, switch, compensator))

Example cURL request

curl -H 'Authorization: ENIAN <token>' -L 'https://api.enian.co/api/grid?lat=43.1815&lon=19.61456&query_type=nearest&nearest_qty=20&power_type=line'
This query shows the 20 nearest power lines to the coordinates 19.1815, 43.61456.

Responses

Attributes
geometry
json, geometry data of grid
geometry -> types
String, in: Polygon, Point, LinePoint
geometry -> coordinates
array, contains arrays with coordinate pairs
properties
json, list of geometry's properties
properties -> id
String, ID of grid
properties -> city
String, City name of grid
properties -> power
String, in: 'line', 'line;minor_line', 'line_to_cable', 'minor_line', 'minor_line;line', 'minor_underground_cable', 'power_line', 'substation', 'sub_station', 'pole;transformer', 'portal;transformer', 'substation;transformer', 'tower;transformer', 'transformer', 'transformer_cabin', 'transformer;pole', 'transformer_tower', 'transformer;tower', 'voltage_transformer', 'current_transformer', 'instrument_transformer', 'disconnector_switch', 'disconnect_switch', 'pole;switch', 'switch', 'switch_bar', 'switchgear', 'switchhouse', 'switch;pole', 'switch;transformer', 'tower;switch', 'busbar_switch', 'compensator', 'phase_compensator'
properties -> country
String, alpha-2 country code of grid
properties -> building
String, Building name of grid
properties -> province
String, Province name of grid
properties -> zip_code
String, ZIP code of grid
properties -> street_name
String, Street name of grid
distance
float, distance in KM from passed coordinates
HTTP/1.1 401 Unauthorized
(if token is missing or expired)

Headers

Content-Type:application/json

Body

{
    "status": "error",
    "messages": {
        "token": [
            "invalid"
        ]
    }
}
HTTP/1.1 403 Forbidden
(if quota exceed)

Headers

Content-Type:application/json

Body

{
    "status": "error",
    "messages": {
        "quota": [
            "quota exceed"
        ]
    }
}
HTTP/1.1 400 Bad request
(missing required parameters, or invalid parameter)

Headers

Content-Type:application/json

Body

{
    'status': "error",
    'messages': {
        'lat': [
            "required",
            "must be greater than -90"
        ],
        'query_type': [
            "required",
            "must be 'distance' or 'nearest'"
        ],
        'filters.capacity.min': [
            "must be greater than 1"
        ]
    }
}
HTTP/1.1 200 Ok

Headers

Content-Type:application/json

Body

{
    "status": "ok",
    "data": [
        {
            "geometry": '{ "type":"LineString","coordinates":[[19.527986,43.0794421],[19.530429,43.081201],[19.5382886,43.0828936]] }',
            "properties": '{ "id": "way/236132752", "city": "NA", "power": "line", "country": "ME", "building": "NA", "province": "Mojkovac", "zip_code": "NA", "street_name": "Mojkovac" }',
            "distance": "12.59042212175"
        },
        ...
        ...
    ]
}