# Get last run's dataset statistics


```
GET 
https://api.apify.com/v2/acts/:actorId/runs/last/dataset/statistics
```


Returns statistics for the last Actor run's default dataset.

This endpoint is a shortcut that resolves the last run's `defaultDatasetId` and proxies to the [Get dataset statistics](https://pr-2431.preview.docs.apify.com/api/v2/dataset-statistics-get.md) endpoint.

## Request

### Path Parameters

* **actorId** string required

  Actor ID or a tilde-separated owner's username and Actor name.

  **Example:** `janedoe~my-actor`

### Query Parameters

* **status** string

  Filter for the run status.

  **Example:** `SUCCEEDED`

<!-- -->

### Status 200


```
{
  "data": {
    "fieldStatistics": {
      "name": {
        "nullCount": 122
      },
      "price": {
        "min": 59,
        "max": 89
      }
    }
  }
}
```


**Schema**

* **data** object required

  * **fieldStatistics** object,null

    When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation), we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount` for each field. This property provides statistics for each field from dataset fields schema.\
    \
    See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics) for more information.

    * **property name\*** DatasetFieldStatistics

      * **min** number | null nullable

        Minimum value of the field. For numbers, this is calculated directly. For strings, this is the length of the shortest string. For arrays, this is the length of the shortest array. For objects, this is the number of keys in the smallest object.

      * **max** number | null nullable

        Maximum value of the field. For numbers, this is calculated directly. For strings, this is the length of the longest string. For arrays, this is the length of the longest array. For objects, this is the number of keys in the largest object.

      * **nullCount** integer | null nullable

        How many items in the dataset have a null value for this field.

      * **emptyCount** integer | null nullable

        How many items in the dataset are `undefined`, meaning that for example empty string is not considered empty.

### Status 400

Bad request - invalid input parameters or request body.


```
{
  "error": {
    "type": "invalid-input",
    "message": "Invalid input: The request body contains invalid data."
  }
}
```


**Schema**

* **error** object required

  * **type** ErrorType (string)

    Machine-processable error type identifier.

    **Possible values:** \[`actor-memory-limit-exceeded`, `actor-not-found`, `invalid-input`, `method-not-allowed`, `page-not-found`, `permission-denied`, `rate-limit-exceeded`, `record-not-found`, `record-not-unique`, `record-or-token-not-found`, `request-id-invalid`, `request-too-large`, `run-failed`, `run-timeout-exceeded`, `schedule-actor-not-found`, `schedule-actor-task-not-found`, `token-not-valid`, `unknown-build-tag`, `unsupported-content-encoding`, `user-not-found`]

  * **message** string

    Human-readable error message describing what went wrong.

### Status 401

Unauthorized - authentication required or invalid token.


```
{
  "error": {
    "type": "token-not-valid",
    "message": "Authentication token is not valid."
  }
}
```


**Schema**

* **error** object required

  * **type** ErrorType (string)

    Machine-processable error type identifier.

    **Possible values:** \[`actor-memory-limit-exceeded`, `actor-not-found`, `invalid-input`, `method-not-allowed`, `page-not-found`, `permission-denied`, `rate-limit-exceeded`, `record-not-found`, `record-not-unique`, `record-or-token-not-found`, `request-id-invalid`, `request-too-large`, `run-failed`, `run-timeout-exceeded`, `schedule-actor-not-found`, `schedule-actor-task-not-found`, `token-not-valid`, `unknown-build-tag`, `unsupported-content-encoding`, `user-not-found`]

  * **message** string

    Human-readable error message describing what went wrong.

### Status 403

Forbidden - insufficient permissions to perform this action.


```
{
  "error": {
    "type": "permission-denied",
    "message": "You do not have permission to perform this action."
  }
}
```


**Schema**

* **error** object required

  * **type** ErrorType (string)

    Machine-processable error type identifier.

    **Possible values:** \[`actor-memory-limit-exceeded`, `actor-not-found`, `invalid-input`, `method-not-allowed`, `page-not-found`, `permission-denied`, `rate-limit-exceeded`, `record-not-found`, `record-not-unique`, `record-or-token-not-found`, `request-id-invalid`, `request-too-large`, `run-failed`, `run-timeout-exceeded`, `schedule-actor-not-found`, `schedule-actor-task-not-found`, `token-not-valid`, `unknown-build-tag`, `unsupported-content-encoding`, `user-not-found`]

  * **message** string

    Human-readable error message describing what went wrong.

### Status 404

Not found - the requested resource does not exist.


```
{
  "error": {
    "type": "record-not-found",
    "message": "The requested resource was not found."
  }
}
```


**Schema**

* **error** object required

  * **type** ErrorType (string)

    Machine-processable error type identifier.

    **Possible values:** \[`actor-memory-limit-exceeded`, `actor-not-found`, `invalid-input`, `method-not-allowed`, `page-not-found`, `permission-denied`, `rate-limit-exceeded`, `record-not-found`, `record-not-unique`, `record-or-token-not-found`, `request-id-invalid`, `request-too-large`, `run-failed`, `run-timeout-exceeded`, `schedule-actor-not-found`, `schedule-actor-task-not-found`, `token-not-valid`, `unknown-build-tag`, `unsupported-content-encoding`, `user-not-found`]

  * **message** string

    Human-readable error message describing what went wrong.

### Status 405

Method not allowed.


```
{
  "error": {
    "type": "method-not-allowed",
    "message": "This API end-point can only be accessed using the following HTTP methods: OPTIONS,GET"
  }
}
```


**Schema**

* **error** object required

  * **type** ErrorType (string)

    Machine-processable error type identifier.

    **Possible values:** \[`actor-memory-limit-exceeded`, `actor-not-found`, `invalid-input`, `method-not-allowed`, `page-not-found`, `permission-denied`, `rate-limit-exceeded`, `record-not-found`, `record-not-unique`, `record-or-token-not-found`, `request-id-invalid`, `request-too-large`, `run-failed`, `run-timeout-exceeded`, `schedule-actor-not-found`, `schedule-actor-task-not-found`, `token-not-valid`, `unknown-build-tag`, `unsupported-content-encoding`, `user-not-found`]

  * **message** string

    Human-readable error message describing what went wrong.

### Status 429

Too many requests - rate limit exceeded.


```
{
  "error": {
    "type": "rate-limit-exceeded",
    "message": "You have exceeded the rate limit. Please try again later."
  }
}
```


**Schema**

* **error** object required

  * **type** ErrorType (string)

    Machine-processable error type identifier.

    **Possible values:** \[`actor-memory-limit-exceeded`, `actor-not-found`, `invalid-input`, `method-not-allowed`, `page-not-found`, `permission-denied`, `rate-limit-exceeded`, `record-not-found`, `record-not-unique`, `record-or-token-not-found`, `request-id-invalid`, `request-too-large`, `run-failed`, `run-timeout-exceeded`, `schedule-actor-not-found`, `schedule-actor-task-not-found`, `token-not-valid`, `unknown-build-tag`, `unsupported-content-encoding`, `user-not-found`]

  * **message** string

    Human-readable error message describing what went wrong.
