# This client's hashrate over time

`GET /stats/mining/workers/history` · Lithos client API · Statistics

Source: https://lithosprotocol.org/docs/api/get-local-mining-history

The same worker hashrate as `/stats/mining/workers`, measured per UTC hour or day so it can
be graphed. Each point sums the differences between consecutive stored observations that end
in its interval, divided by the time they cover. One point per interval.

Only observations from one producer session can be differenced — a restart resets the
counters — so intervals spanning a restart are left out rather than clamped. A gap therefore
means the interval was not measured, not that nothing was mined.

Range and interval rules match `/stats/mining/buckets`.

## Parameters

| Name | In | Type | Required | Description |

|---|---|---|---|---|

| `from` | query | integer · int64 | yes | Inclusive start in Unix milliseconds, on a UTC hour or day boundary to match `interval`. |

| `until` | query | integer · int64 | yes | Exclusive end in Unix milliseconds. On the same boundary, later than `from`, and at most 500 intervals after it. |

| `interval` | query | string | no | Bucket size. Both range boundaries must be a whole number of these since the Unix epoch. |

## Responses

### 200: Measured intervals, oldest first. The list may be empty.

`LocalHashrateHistory`

- `from` (integer · int64, required): The inclusive start you asked for, in Unix milliseconds.
- `until` (integer · int64, required): The exclusive end you asked for, in Unix milliseconds.
- `widthMs` (integer · int64, required, one of 3600000, 86400000)
- `points` (LocalHashratePoint[], required): Measured intervals, oldest first. Intervals spanning a producer restart are absent, since resetting counters makes them unmeasurable.
  - `start` (integer · int64, required): Inclusive UTC interval start in Unix milliseconds.
  - `widthMs` (integer · int64, required, one of 3600000, 86400000)
  - `hashesPerSecond` (string, required): Assigned work gained over this interval, divided by its elapsed time.
  - `acceptedShares` (integer · int64, required)
  - `superShares` (integer · int64, required)
  - `reducedReporting` (boolean, required): True when the interval's shares arrived under reduced reporting.
  - `measuredMs` (integer · int64, required): Milliseconds of work measured for this interval, which `hashesPerSecond` is rated over. Can exceed `widthMs` when the stretch began in an earlier interval.
- `status` (string, required, one of disabled, loading, ready, stale, unavailable, catching-up, recovering): How far collection has got. `ready` means it reached the last checked chain tip. `catching-up` and `recovering` mean replay or reorg work is still running, `stale` means the last successful check is too old, and `unavailable` means collection failed. On `disabled` or `loading` the numbers are not evidence that the period was quiet.

### 400: A timestamp is missing, malformed, off a bucket boundary, or the range is too long; or `interval` is not hour or day.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 503: History is loading, disabled, busy, or unreadable. Check `mining.status` in /stats before retrying.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

## Example request

```bash
curl -X GET "http://localhost:9000/stats/mining/workers/history?from=0&until=1"
```

## Example response

```json
{
  "from": 0,
  "until": 0,
  "widthMs": 3600000,
  "points": [
    {
      "start": 0,
      "widthMs": 3600000,
      "hashesPerSecond": "0",
      "acceptedShares": 0,
      "superShares": 0,
      "reducedReporting": true,
      "measuredMs": 0
    }
  ],
  "status": "disabled"
}
```
