# API Methods

## Get terminal info

<mark style="color:blue;">`GET`</mark> `http://localhost:5000/api/load-flow/0/terminals/all`

This endpoint allows you to voltages from all nodes.

#### Path Parameters

| Name    | Type    | Description                                                      |
| ------- | ------- | ---------------------------------------------------------------- |
| project | integer | This is project you wish to activate in order shown in DigSilent |

{% tabs %}
{% tab title="200 Terminal info recieved" %}

```javascript
{
    "terminals": {
        "Bus_0012": {
            "reactive_gen": {
                "value": 0.0,
                "unit": "Mvar"
            },
            "active_flow": {
                "value": 7.7102326679141315,
                "unit": "MW"
            },
            "magnitude": {
                "value": 1.05522051228861,
                "unit": "p.u."
            },
            "angle": {
                "value": -15.077414289317803,
                "unit": "deg"
            },
            "active_gen": {
                "value": 0.0,
                "unit": "MW"
            },
            "reactive_out": {
                "value": 2.343011708584044,
                "unit": "Mvar"
            },
            "active_out": {
                "value": 7.7102326679141315,
                "unit": "MW"
            },
            "line": {
                "value": 34.822276905524134,
                "unit": "kV"
            },
            "reactive_flow": {
                "value": 2.343011708584044,
                "unit": "Mvar"
            }
        },
        "Bus_0014": {
        ...
        },
        ...
    }
}
```

{% endtab %}

{% tab title="404 Could not connect to powerfactory" %}

```
{    "message": "pf not defined"}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pierpuccini.gitbook.io/ems-api/api-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
