Skip to content

Commit 4cc52db

Browse files
committed
use /v2/datasets/{datasetId}/statistics approach
1 parent 425bbbc commit 4cc52db

File tree

7 files changed

+69
-65
lines changed

7 files changed

+69
-65
lines changed

apify-api/openapi/components/schemas/datasets/GetDatasetFieldStatisticsResponse.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: GetDatasetStatisticsResponse
2+
required:
3+
- data
4+
type: object
5+
properties:
6+
data:
7+
type: object
8+
properties:
9+
fieldStatistics:
10+
type: object
11+
additionalProperties:
12+
$ref: ./DatasetFieldStatistics.yaml
13+
description: '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.
14+
This property provides statistics for each field from dataset fields schema.
15+
<br/></br>See dataset field statistics [documentation](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics) for more information.'

apify-api/openapi/components/tags.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,8 @@
758758
x-legacy-doc-urls:
759759
- '#/reference/datasets/item-collection'
760760
x-trait: 'true'
761-
- name: Datasets/Field statistics
762-
x-displayName: Field statistics
761+
- name: Datasets/Statistics
762+
x-displayName: Statistics
763763
x-parent-tag-name: Datasets
764764
x-trait: 'true'
765765
- name: Request queues

apify-api/openapi/components/x-tag-groups.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
- Datasets/Dataset collection
6363
- Datasets/Dataset
6464
- Datasets/Item collection
65-
- Datasets/Field statistics
65+
- Datasets/Statistics
6666
- name: Request queues
6767
tags:
6868
- Request queues

apify-api/openapi/openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ paths:
566566
$ref: 'paths/datasets/datasets@{datasetId}.yaml'
567567
'/v2/datasets/{datasetId}/items':
568568
$ref: 'paths/datasets/datasets@{datasetId}@items.yaml'
569-
'/v2/datasets/{datasetId}/field-statistics':
570-
$ref: 'paths/datasets/datasets@{datasetId}@field-statistics.yaml'
569+
'/v2/datasets/{datasetId}/statistics':
570+
$ref: 'paths/datasets/datasets@{datasetId}@statistics.yaml'
571571
/v2/request-queues:
572572
$ref: paths/request-queues/request-queues.yaml
573573
'/v2/request-queues/{queueId}':

apify-api/openapi/paths/datasets/datasets@{datasetId}@field-statistics.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
get:
2+
tags:
3+
- Datasets/Statistics
4+
summary: Get dataset statistics
5+
description: |
6+
Returns statistics for given dataset.
7+
Currently provides only [field statistics](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics).
8+
9+
operationId: dataset_statistics_get
10+
parameters:
11+
- name: datasetId
12+
in: path
13+
description: Dataset ID or `username~dataset-name`.
14+
required: true
15+
style: simple
16+
schema:
17+
type: string
18+
example: WkzbQMuFYuamGv3YF
19+
- name: token
20+
in: query
21+
description: |
22+
API authentication token. It is required only when using the `username~dataset-name` format for `datasetId`.
23+
style: form
24+
explode: true
25+
schema:
26+
type: string
27+
example: soSkq9ekdmfOslopH
28+
responses:
29+
'200':
30+
description: ''
31+
content:
32+
application/json:
33+
schema:
34+
$ref: "../../components/schemas/datasets/GetDatasetStatisticsResponse.yaml"
35+
example:
36+
data:
37+
fieldStatistics:
38+
name:
39+
nullCount: 122
40+
price:
41+
min: 59
42+
max: 89
43+
# TODO: add clients methods
44+
# x-js-parent: DatasetClient
45+
# x-js-name: statistics
46+
# x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/DatasetClient#statistics
47+
# x-py-parent: DatasetClientAsync
48+
# x-py-name: statistics
49+
# x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/DatasetClientAsync#statistics

0 commit comments

Comments
 (0)