> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexenergie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Started with Nexenergie: First API Call in 5 Minutes

> Sign up for Nexenergie, generate your API token, and retrieve your first day-ahead electricity price forecast for the Spanish OMIE market.

This guide takes you from zero to a working forecast API call in roughly five minutes. By the end you will have a Nexenergie account, a valid API token, and a live JSON response containing 24 hourly day-ahead price forecasts for the Spanish OMIE market.

<Steps>
  <Step title="Create Your Account">
    Go to [app.nexenergie.ai/signup](https://app.nexenergie.ai/signup) and register with your email address and a password. After submitting the form, check your inbox for a confirmation email and click the activation link. Once your account is active, log in to the dashboard.
  </Step>

  <Step title="Generate an API Token">
    In the dashboard, navigate to **Account → API Keys** (or go directly to [app.nexenergie.ai/account/api-keys](https://app.nexenergie.ai/account/api-keys)). Click **Generate New Key**, enter a label such as `my-trading-app`, and click **Create**. Copy the token immediately — it is shown in full only once.

    <Tip>
      Store your token in an environment variable rather than hard-coding it in your source files:

      ```bash theme={null}
      export NEXENERGIE_API_KEY="your_api_key_here"
      ```

      Then reference it in your code as `$NEXENERGIE_API_KEY` (shell), `os.environ["NEXENERGIE_API_KEY"]` (Python), or `process.env.NEXENERGIE_API_KEY` (Node.js).
    </Tip>
  </Step>

  <Step title="Request a Day-Ahead Forecast">
    Call `GET /forecasts/day-ahead` with your token in the `Authorization` header and today's date as the `date` query parameter. Replace `YOUR_TOKEN` with the key you just generated.

    ```bash cURL theme={null}
    curl -X GET "https://app.nexenergie.ai/api/v1/forecasts/day-ahead?date=2025-07-14" \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -H "Accept: application/json"
    ```

    ```python Python theme={null}
    import os
    import requests

    token = os.environ["NEXENERGIE_API_KEY"]

    response = requests.get(
        "https://app.nexenergie.ai/api/v1/forecasts/day-ahead",
        params={"date": "2025-07-14"},
        headers={"Authorization": f"Bearer {token}"},
    )
    response.raise_for_status()
    forecast = response.json()
    print(forecast)
    ```

    ```javascript JavaScript theme={null}
    const token = process.env.NEXENERGIE_API_KEY;

    const response = await fetch(
      "https://app.nexenergie.ai/api/v1/forecasts/day-ahead?date=2025-07-14",
      {
        headers: {
          Authorization: `Bearer ${token}`,
          Accept: "application/json",
        },
      }
    );

    const forecast = await response.json();
    console.log(forecast);
    ```
  </Step>

  <Step title="Explore the Response">
    A successful request returns HTTP `200` with a JSON object containing metadata and an array of 24 hourly price forecasts. Each entry includes the UTC hour, the forecast price in EUR/MWh, and the unit label.

    ```json Response theme={null}
    {
      "market": "OMIE",
      "session": "day-ahead",
      "date": "2025-07-14",
      "currency": "EUR",
      "unit": "EUR/MWh",
      "generated_at": "2025-07-13T14:22:05Z",
      "hours": [
        { "hour": 0,  "forecast_price": 58.32, "unit": "EUR/MWh" },
        { "hour": 1,  "forecast_price": 54.17, "unit": "EUR/MWh" },
        { "hour": 2,  "forecast_price": 51.84, "unit": "EUR/MWh" },
        { "hour": 3,  "forecast_price": 49.63, "unit": "EUR/MWh" },
        { "hour": 4,  "forecast_price": 48.91, "unit": "EUR/MWh" },
        { "hour": 5,  "forecast_price": 52.40, "unit": "EUR/MWh" },
        { "hour": 6,  "forecast_price": 61.75, "unit": "EUR/MWh" },
        { "hour": 7,  "forecast_price": 74.28, "unit": "EUR/MWh" },
        { "hour": 8,  "forecast_price": 82.14, "unit": "EUR/MWh" },
        { "hour": 9,  "forecast_price": 79.56, "unit": "EUR/MWh" },
        { "hour": 10, "forecast_price": 71.03, "unit": "EUR/MWh" },
        { "hour": 11, "forecast_price": 65.89, "unit": "EUR/MWh" },
        { "hour": 12, "forecast_price": 60.44, "unit": "EUR/MWh" },
        { "hour": 13, "forecast_price": 63.17, "unit": "EUR/MWh" },
        { "hour": 14, "forecast_price": 67.82, "unit": "EUR/MWh" },
        { "hour": 15, "forecast_price": 70.11, "unit": "EUR/MWh" },
        { "hour": 16, "forecast_price": 74.95, "unit": "EUR/MWh" },
        { "hour": 17, "forecast_price": 83.60, "unit": "EUR/MWh" },
        { "hour": 18, "forecast_price": 91.34, "unit": "EUR/MWh" },
        { "hour": 19, "forecast_price": 95.72, "unit": "EUR/MWh" },
        { "hour": 20, "forecast_price": 88.46, "unit": "EUR/MWh" },
        { "hour": 21, "forecast_price": 79.13, "unit": "EUR/MWh" },
        { "hour": 22, "forecast_price": 68.57, "unit": "EUR/MWh" },
        { "hour": 23, "forecast_price": 61.20, "unit": "EUR/MWh" }
      ]
    }
    ```

    The `hour` field is zero-indexed UTC (0 = 00:00–01:00 UTC). The `generated_at` timestamp tells you when the forecast was produced.
  </Step>

  <Step title="View in the Dashboard">
    Open the [Nexenergie dashboard](https://app.nexenergie.ai) to see the same forecast rendered as an interactive price curve. You can overlay actual OMIE settlement prices once the market closes, switch between day-ahead and intraday sessions, and export any date range as a CSV file — all without writing additional code.
  </Step>
</Steps>

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Learn about token expiry, API keys, and error handling
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Explore all available endpoints and parameters
  </Card>
</CardGroup>
