> For the complete documentation index, see [llms.txt](https://docs.stakewiz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stakewiz.com/reference/api-reference/epoch.md).

# Epoch

## Epoch Info (current epoch)

Receive a JSON object with information for the current epoch

<mark style="color:blue;">`GET`</mark> `https://api.stakewiz.com/epoch_info`

Includes start time and slot, current slot height, epoch duration in seconds as well as seconds elapsed and remaining in the epoch, and the estimated epochs per year based on this epoch's current estimated duration.

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "epoch": 353,
    "start_slot": 152496000,
    "start_time": "2022-09-26 15:13:55.35934+00",
    "slot_height": 127916,
    "duration_seconds": 236696,
    "elapsed_seconds": 70157,
    "remaining_seconds": 166539,
    "epochs_per_year": 133.32544698685234
}
```

{% endtab %}
{% endtabs %}

## Epoch history (any epoch)

Receive a JSON object with information on a past epoch.

<mark style="color:blue;">`GET`</mark> `https://api.stakewiz.com/epoch_history/{EPOCH}`

Includes start and end times as well as its duration in seconds.\
\
If the epoch passed is the current epoch the end time and duration are estimates based on average slot times in the current epoch.

Returns false if the epoch isn't found (HTTP 200 OK with payload of false). Some historical epochs don't have block times available to provide start and end times.&#x20;

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "epoch": 340,
    "start_time": "2022-08-20 19:30:01.763991+00",
    "end_time": "2022-08-23 15:53:01.337229+00",
    "duration_seconds": 246180
}
```

{% endtab %}
{% endtabs %}

## Epoch history (all epochs)

Receive a JSON object with all available historical epochs.

<mark style="color:blue;">`GET`</mark> `https://api.stakewiz.com/all_epochs_history`

Returns all available historical epochs with their start and end times as well as duration in seconds.

{% tabs %}
{% tab title="200: OK " %}

```javascript
[
    {
        "epoch": 353,
        "start": "2022-09-26 15:13:55.35934+00",
        "end": "2022-09-29 08:54:20+00",
        "duration_seconds": 236425
    },
    {
        "epoch": 352,
        "start": "2022-09-24 00:22:01.95102+00",
        "end": "2022-09-26 15:13:02+00",
        "duration_seconds": 226261
    },
    {
        "epoch": 351,
        "start": "2022-09-21 04:41:01.679778+00",
        "end": "2022-09-24 00:21:01.973181+00",
        "duration_seconds": 243600
    },
    [...]
]
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.stakewiz.com/reference/api-reference/epoch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
