Skip to content

Commit f5314ab

Browse files
novotnyjTC-MO
andauthored
feat: add maxTotalChargeUsd param (#1485)
The `maxTotalChargeUsd` param is missing in API doc. I've searched for `ACTOR_MAX_PAID_DATASET_ITEMS` and added info about `maxTotalChargeUsd` to all relevant places. --------- Co-authored-by: Michał Olender <92638966+TC-MO@users.noreply.github.com>
1 parent b95f050 commit f5314ab

File tree

8 files changed

+123
-4
lines changed

8 files changed

+123
-4
lines changed

apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@run-sync-get-dataset-items.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,20 @@ post:
462462
type: number
463463
format: double
464464
example: 1000
465+
- name: maxTotalChargeUsd
466+
in: query
467+
description: |
468+
Specifies the maximum cost of the task run. This is
469+
useful for pay-per-event tasks, as it allows you to limit the amount
470+
charged to your subscription. You can access the
471+
maximum cost in your Actor by using the
472+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
473+
style: form
474+
explode: true
475+
schema:
476+
type: number
477+
format: double
478+
example: 5
465479
- name: build
466480
in: query
467481
description: |

apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@run-sync.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,20 @@ post:
209209
type: number
210210
format: double
211211
example: 1000
212+
- name: maxTotalChargeUsd
213+
in: query
214+
description: |
215+
Specifies the maximum cost of the task run. This parameter is
216+
useful for pay-per-event tasks, as it allows you to limit the amount
217+
charged to your subscription. You can access the
218+
maximum cost in your Actor by using the
219+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
220+
style: form
221+
explode: true
222+
schema:
223+
type: number
224+
format: double
225+
example: 5
212226
- name: build
213227
in: query
214228
description: |

apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,20 @@ post:
201201
type: number
202202
format: double
203203
example: 1000
204+
- name: maxTotalChargeUsd
205+
in: query
206+
description: |
207+
Specifies the maximum cost of the Actor run. This parameter is
208+
useful for pay-per-event Actors, as it allows you to limit the amount
209+
charged to your subscription. You can access the
210+
maximum cost in your Actor by using the
211+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
212+
style: form
213+
explode: true
214+
schema:
215+
type: number
216+
format: double
217+
example: 5
204218
- name: build
205219
in: query
206220
description: |

apify-api/openapi/paths/actors/acts@{actorId}@run-sync-get-dataset-items.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ post:
7474
type: number
7575
format: double
7676
example: 1000
77+
- name: maxTotalChargeUsd
78+
in: query
79+
description: |
80+
Specifies the maximum cost of the Actor run. This parameter is
81+
useful for pay-per-event Actors, as it allows you to limit the amount
82+
charged to your subscription. You can access the
83+
maximum cost in your Actor by using the
84+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
85+
style: form
86+
explode: true
87+
schema:
88+
type: number
89+
format: double
90+
example: 5
7791
- name: build
7892
in: query
7993
description: |
@@ -462,6 +476,20 @@ get:
462476
type: number
463477
format: double
464478
example: 1000
479+
- name: maxTotalChargeUsd
480+
in: query
481+
description: |
482+
Specifies the maximum cost of the Actor run. This parameter is
483+
useful for pay-per-event Actors, as it allows you to limit the amount
484+
charged to your subscription. You can access the
485+
maximum cost in your Actor by using the
486+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
487+
style: form
488+
explode: true
489+
schema:
490+
type: number
491+
format: double
492+
example: 5
465493
- name: build
466494
in: query
467495
description: |

apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ post:
8080
type: number
8181
format: double
8282
example: 1000
83+
- name: maxTotalChargeUsd
84+
in: query
85+
description: |
86+
Specifies the maximum cost of the Actor run. This parameter is
87+
useful for pay-per-event Actors, as it allows you to limit the amount
88+
charged to your subscription. You can access the
89+
maximum cost in your Actor by using the
90+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
91+
style: form
92+
explode: true
93+
schema:
94+
type: number
95+
format: double
96+
example: 5
8397
- name: build
8498
in: query
8599
description: |
@@ -227,6 +241,20 @@ get:
227241
type: number
228242
format: double
229243
example: 1000
244+
- name: maxTotalChargeUsd
245+
in: query
246+
description: |
247+
Specifies the maximum cost of the Actor run. This parameter is
248+
useful for pay-per-event Actors, as it allows you to limit the amount
249+
charged to your subscription. You can access the
250+
maximum cost in your Actor by using the
251+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
252+
style: form
253+
explode: true
254+
schema:
255+
type: number
256+
format: double
257+
example: 5
230258
- name: build
231259
in: query
232260
description: |

apify-api/openapi/paths/actors/acts@{actorId}@runs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,20 @@ post:
194194
type: number
195195
format: double
196196
example: 1000
197+
- name: maxTotalChargeUsd
198+
in: query
199+
description: |
200+
Specifies the maximum cost of the Actor run. This parameter is
201+
useful for pay-per-event Actors, as it allows you to limit the amount
202+
charged to your subscription. You can access the
203+
maximum cost in your Actor by using the
204+
`ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
205+
style: form
206+
explode: true
207+
schema:
208+
type: number
209+
format: double
210+
example: 5
197211
- name: build
198212
in: query
199213
description: |

sources/platform/actors/development/programming_interface/environment_variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Here's a table of key system environment variables:
3535
| `ACTOR_DEFAULT_REQUEST_QUEUE_ID` | Unique identifier for the default request queue associated with the current Actor run. |
3636
| `ACTOR_INPUT_KEY` | Key of the record in the default key-value store that holds the [Actor input](/platform/actors/running/input-and-output#input). |
3737
| `ACTOR_MAX_PAID_DATASET_ITEMS` | For paid-per-result Actors, the user-set limit on returned results. Do not exceed this limit. |
38+
| `ACTOR_MAX_TOTAL_CHARGE_USD` | For pay-per-event Actors, the user-set limit on run cost. Do not exceed this limit. |
3839
| `APIFY_HEADLESS` | If **1**, web browsers inside the Actor should run in headless mode (no windowing system available). |
3940
| `APIFY_IS_AT_HOME` | Contains **1** if the Actor is running on Apify servers. |
4041
| `ACTOR_MEMORY_MBYTES` | Size of memory allocated for the Actor run, in megabytes. Can be used to optimize memory usage or finetuning of low-level external libraries. |

sources/platform/api_v2/api_v2_reference.apib

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,8 @@ received in the response JSON to the [Get items](#reference/datasets/item-collec
984984
+ token: `soSkq9ekdmfOslopH` (string, optional) - API authentication token. Public actors that are configured to be anonymously runnable do not require the token.
985985
+ timeout: 60 (number, optional) - Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the actor.
986986
+ memory: 256 (number, optional) - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the actor.
987-
+ maxItems: 1000 (number, optional) - The maximum number of items that the actor run should return. This is useful for pay-per-result actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
987+
+ maxItems: 1000 (number, optional) - The maximum number of items that the Actor run should return. This is useful for pay-per-result Actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
988+
+ maxTotalChargeUsd: 5 (number, optional) - Specifies the maximum cost of the Actor run. This is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
988989
+ build: `0.1.234` (string, optional) - Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the actor (typically `latest`).
989990
+ waitForFinish: 60 (number, optional) - The maximum number of seconds the server waits for the run to finish. By default, it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS -->
990991
If the build finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`),
@@ -1021,7 +1022,8 @@ received in the response JSON to the [Get items](#reference/datasets/item-collec
10211022
in the response. By default, it is `OUTPUT`.
10221023
+ timeout: 60 (number, optional) - Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the actor.
10231024
+ memory: 256 (number, optional) - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the actor.
1024-
+ maxItems: 1000 (number, optional) - The maximum number of items that the actor run should return. This is useful for pay-per-result actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1025+
+ maxItems: 1000 (number, optional) - The maximum number of items that the Actor run should return. This is useful for pay-per-result Actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1026+
+ maxTotalChargeUsd: 5 (number, optional) - Specifies the maximum cost of the Actor run. This is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
10251027
+ build: `0.1.234` (string, optional) - Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the actor (typically `latest`).
10261028
+ webhooks: `dGhpcyBpcyBqdXN0IGV4YW1wbGUK...` (string, optional) - Specifies optional webhooks associated with the actor run, which can be used to receive a notification
10271029
e.g. when the actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see
@@ -1139,7 +1141,8 @@ To run the actor asynchronously, use the [Run actor](#reference/actors/run-colle
11391141
+ token: `soSkq9ekdmfOslopH` (string, optional) - API authentication token. Public actors that are configured to be anonymously runnable do not require token parameter.
11401142
+ timeout: 60 (number, optional) - Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the actor.
11411143
+ memory: 256 (number, optional) - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the actor.
1142-
+ maxItems: 1000 (number, optional) - The maximum number of items that the actor run should return. This is useful for pay-per-result actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1144+
+ maxItems: 1000 (number, optional) - The maximum number of items that the Actor run should return. This is useful for pay-per-result Actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1145+
+ maxTotalChargeUsd: 5 (number, optional) - Specifies the maximum cost of the Actor run. This is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
11431146
+ build: `0.1.234` (string, optional) - Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the actor (typically `latest`).
11441147
+ webhooks: `dGhpcyBpcyBqdXN0IGV4YW1wbGUK...` (string, optional) - Specifies optional webhooks associated with the actor run, which can be used to receive a notification
11451148
e.g. when the actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see
@@ -1751,7 +1754,8 @@ received in the response JSON to the [Get items](#reference/datasets/item-collec
17511754
+ token: `soSkq9ekdmfOslopH` (string, optional) - API authentication token.
17521755
+ timeout: 60 (number, optional) - Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the task settings.
17531756
+ memory: 256 (number, optional) - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the task settings.
1754-
+ maxItems: 1000 (number, optional) - The maximum number of items that the actor run should return. This is useful for pay-per-result actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1757+
+ maxItems: 1000 (number, optional) - The maximum number of items that the Actor run should return. This is useful for pay-per-result Actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1758+
+ maxTotalChargeUsd: 5 (number, optional) - Specifies the maximum cost of the Actor run. This is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
17551759
+ build: `0.1.234` (string, optional) - Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically `latest`).
17561760
+ waitForFinish: 60 (number, optional) - The maximum number of seconds the server waits for the run to finish. By default, it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS -->
17571761
If the build finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`),
@@ -1789,6 +1793,7 @@ received in the response JSON to the [Get items](#reference/datasets/item-collec
17891793
+ timeout: 60 (number, optional) - Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the task settings.
17901794
+ memory: 256 (number, optional) - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the task settings.
17911795
+ maxItems: 1000 (number, optional) - The maximum number of items that the task run should return. This is useful for pay-per-result tasks, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1796+
+ maxTotalChargeUsd: 5 (number, optional) - Specifies the maximum cost of the task run. This is useful for pay-per-event tasks, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
17921797
+ build: `0.1.234` (string, optional) - Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically `latest`).
17931798
+ outputRecordKey: `OUTPUT` (string, optional) - Key of the record from run's default key-value store to be returned
17941799
in the response. By default, it is `OUTPUT`.
@@ -1897,6 +1902,7 @@ To run the Task asynchronously, use the [Run task asynchronously](#reference/act
18971902
+ timeout: 60 (number, optional) - Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the task settings.
18981903
+ memory: 256 (number, optional) - Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the task settings.
18991904
+ maxItems: 1000 (number, optional) - The maximum number of items that the task run should return. This is useful for pay-per-result tasks, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your actor by using the `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable.
1905+
+ maxTotalChargeUsd: 5 (number, optional) - Specifies the maximum cost of the task run. This is useful for pay-per-event tasks, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the `ACTOR_MAX_TOTAL_CHARGE_USD` environment variable.
19001906
+ build: `0.1.234` (string, optional) - Specifies the actor build to run. It can be either a build tag or build number. By default, the run uses the build specified in the task settings (typically `latest`).
19011907
+ webhooks: `dGhpcyBpcyBqdXN0IGV4YW1wbGUK...` (string, optional) - Specifies optional webhooks associated with the actor run, which can be used to receive a notification
19021908
e.g. when the actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see

0 commit comments

Comments
 (0)