You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/02_concepts/02_actor_input.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ import ApiLink from '@site/src/components/ApiLink';
12
12
13
13
The Actor gets its [input](https://docs.apify.com/platform/actors/running/input) from the input record in its default [key-value store](https://docs.apify.com/platform/storage/key-value-store).
14
14
15
-
To access it, instead of reading the record manually, you can use the [`Actor.get_input`](../../reference/class/Actor#get_input) convenience method. It will get the input record key from the Actor configuration, read the record from the default key-value store,and decrypt any [secret input fields](https://docs.apify.com/platform/actors/development/secret-input).
15
+
To access it, instead of reading the record manually, you can use the <ApiLinkto="class/Actor#get_input">`Actor.get_input`</ApiLink> convenience method. It will get the input record key from the Actor configuration, read the record from the default key-value store,and decrypt any [secret input fields](https://docs.apify.com/platform/actors/development/secret-input).
16
16
17
17
For example, if an Actor received a JSON input with two fields, `{ "firstNumber": 1, "secondNumber": 2 }`, this is how you might process it:
18
18
@@ -32,6 +32,6 @@ Actors commonly receive a list of URLs to process via their input. The <ApiLink
32
32
33
33
The Apify platform supports [secret input fields](https://docs.apify.com/platform/actors/development/secret-input) that are encrypted before being stored. When you mark an input field as `"isSecret": true` in your Actor's [input schema](https://docs.apify.com/platform/actors/development/input-schema), the platform encrypts the value with the Actor's public key.
34
34
35
-
No special handling is needed in your code — when you call [`Actor.get_input`](../../reference/class/Actor#get_input), encrypted fields are automatically decrypted using the Actor's private key, which is provided by the platform via environment variables. You receive the plaintext values directly.
35
+
No special handling is needed in your code — when you call <ApiLinkto="class/Actor#get_input">`Actor.get_input`</ApiLink>, encrypted fields are automatically decrypted using the Actor's private key, which is provided by the platform via environment variables. You receive the plaintext values directly.
36
36
37
37
For more details on Actor input and how to define input schemas, see the [Actor input](https://docs.apify.com/platform/actors/running/input) and [input schema](https://docs.apify.com/platform/actors/development/input-schema) documentation on the Apify platform.
Copy file name to clipboardExpand all lines: docs/02_concepts/03_storages.mdx
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,11 @@ The `Actor` class provides methods to work either with the default storages of t
23
23
24
24
There are three types of storages available to Actors.
25
25
26
-
First are [datasets](https://docs.apify.com/platform/storage/dataset), which are append-only tables for storing the results of your Actors. You can open a dataset through the [`Actor.open_dataset`](../../reference/class/Actor#open_dataset) method, and work with it through the resulting [`Dataset`](../../reference/class/Dataset) class instance.
26
+
First are [datasets](https://docs.apify.com/platform/storage/dataset), which are append-only tables for storing the results of your Actors. You can open a dataset through the <ApiLinkto="class/Actor#open_dataset">`Actor.open_dataset`</ApiLink> method, and work with it through the resulting <ApiLinkto="class/Dataset">`Dataset`</ApiLink> class instance.
27
27
28
-
Next there are [key-value stores](https://docs.apify.com/platform/storage/key-value-store), which function as a read/write storage for storing file-like objects, typically the Actor state or binary results. You can open a key-value store through the [`Actor.open_key_value_store`](../../reference/class/Actor#open_key_value_store) method, and work with it through the resulting [`KeyValueStore`](../../reference/class/KeyValueStore) class instance.
28
+
Next there are [key-value stores](https://docs.apify.com/platform/storage/key-value-store), which function as a read/write storage for storing file-like objects, typically the Actor state or binary results. You can open a key-value store through the <ApiLinkto="class/Actor#open_key_value_store">`Actor.open_key_value_store`</ApiLink> method, and work with it through the resulting <ApiLinkto="class/KeyValueStore">`KeyValueStore`</ApiLink> class instance.
29
29
30
-
Finally, there are [request queues](https://docs.apify.com/platform/storage/request-queue). These are queues into which you can put the URLs you want to scrape, and from which the Actor can dequeue them and process them. You can open a request queue through the [`Actor.open_request_queue`](../../reference/class/Actor#open_request_queue) method, and work with it through the resulting [`RequestQueue`](../../reference/class/RequestQueue) class instance.
30
+
Finally, there are [request queues](https://docs.apify.com/platform/storage/request-queue). These are queues into which you can put the URLs you want to scrape, and from which the Actor can dequeue them and process them. You can open a request queue through the <ApiLinkto="class/Actor#open_request_queue">`Actor.open_request_queue`</ApiLink> method, and work with it through the resulting <ApiLinkto="class/RequestQueue">`RequestQueue`</ApiLink> class instance.
31
31
32
32
Each Actor run has its default dataset, default key-value store and default request queue.
33
33
@@ -43,7 +43,7 @@ Each dataset item, key-value store record, or request in a request queue is then
43
43
44
44
## Local Actor run with remote storage
45
45
46
-
When developing locally, opening any storage will by default use local storage. To change this behavior and to use remote storage you have to use `force_cloud=True` argument in [`Actor.open_dataset`](../../reference/class/Actor#open_dataset), [`Actor.open_request_queue`](../../reference/class/Actor#open_request_queue) or [`Actor.open_key_value_store`](../../reference/class/Actor#open_key_value_store). Proper use of this argument allows you to work with both local and remote storages.
46
+
When developing locally, opening any storage will by default use local storage. To change this behavior and to use remote storage you have to use `force_cloud=True` argument in <ApiLinkto="class/Actor#open_dataset">`Actor.open_dataset`</ApiLink>, <ApiLinkto="class/Actor#open_request_queue">`Actor.open_request_queue`</ApiLink> or <ApiLinkto="class/Actor#open_key_value_store">`Actor.open_key_value_store`</ApiLink>. Proper use of this argument allows you to work with both local and remote storages.
47
47
48
48
Calling another remote Actor and accessing its default storage is typical use-case for using `force-cloud=True` argument to open remote Actor's storages.
49
49
@@ -59,14 +59,14 @@ apify run --purge
59
59
60
60
There are several methods for directly working with the default key-value store or default dataset of the Actor.
61
61
62
-
-[`Actor.get_value('my-record')`](../../reference/class/Actor#get_value) reads a record from the default key-value store of the Actor.
63
-
-[`Actor.set_value('my-record', 'my-value')`](../../reference/class/Actor#set_value) saves a new value to the record in the default key-value store.
64
-
-[`Actor.get_input`](../../reference/class/Actor#get_input) reads the Actor input from the default key-value store of the Actor.
65
-
-[`Actor.push_data([{'result': 'Hello, world!'}, ...])`](../../reference/class/Actor#push_data) saves results to the default dataset of the Actor. When using the [pay-per-event pricing model](./pay-per-event), `push_data` returns a `ChargeResult` object that indicates whether the charge limit has been reached. You can also pass a `charged_event_name` parameter to charge for a custom event for each pushed item.
62
+
-<ApiLinkto="class/Actor#get_value">`Actor.get_value('my-record')`</ApiLink> reads a record from the default key-value store of the Actor.
63
+
-<ApiLinkto="class/Actor#set_value">`Actor.set_value('my-record', 'my-value')`</ApiLink> saves a new value to the record in the default key-value store.
64
+
-<ApiLinkto="class/Actor#get_input">`Actor.get_input`</ApiLink> reads the Actor input from the default key-value store of the Actor.
65
+
-<ApiLinkto="class/Actor#push_data">`Actor.push_data([{'result': 'Hello, world!'}, ...])`</ApiLink> saves results to the default dataset of the Actor. When using the [pay-per-event pricing model](./pay-per-event), `push_data` returns a `ChargeResult` object that indicates whether the charge limit has been reached. You can also pass a `charged_event_name` parameter to charge for a custom event for each pushed item.
66
66
67
67
## Opening named and unnamed storages
68
68
69
-
The [`Actor.open_dataset`](../../reference/class/Actor#open_dataset), [`Actor.open_key_value_store`](../../reference/class/Actor#open_key_value_store) and [`Actor.open_request_queue`](../../reference/class/Actor#open_request_queue) methods can be used to open any storage for reading and writing. You can either use them without arguments to open the default storages, or you can pass a storage ID or name to open another storage.
69
+
The <ApiLinkto="class/Actor#open_dataset">`Actor.open_dataset`</ApiLink>, <ApiLinkto="class/Actor#open_key_value_store">`Actor.open_key_value_store`</ApiLink> and <ApiLinkto="class/Actor#open_request_queue">`Actor.open_request_queue`</ApiLink> methods can be used to open any storage for reading and writing. You can either use them without arguments to open the default storages, or you can pass a storage ID or name to open another storage.
@@ -153,27 +153,27 @@ In this section we will show you how to work with [request queues](https://docs.
153
153
154
154
### Adding requests to a queue
155
155
156
-
To add a request into the queue, you can use the [`RequestQueue.add_request`](../../reference/class/RequestQueue#add_request) method.
156
+
To add a request into the queue, you can use the <ApiLinkto="class/RequestQueue#add_request">`RequestQueue.add_request`</ApiLink> method.
157
157
158
158
You can use the `forefront` boolean argument to specify whether the request should go to the beginning of the queue, or to the end.
159
159
160
160
You can use the `unique_key` of the request to uniquely identify a request. If you try to add more requests with the same unique key, only the first one will be added.
161
161
162
-
Check out the [`Request`](../../reference/class/Request) for more information on how to create requests and what properties they have.
162
+
Check out the <ApiLinkto="class/Request">`Request`</ApiLink> for more information on how to create requests and what properties they have.
163
163
164
164
### Reading requests
165
165
166
-
To fetch the next request from the queue for processing, you can use the [`RequestQueue.fetch_next_request`](../../reference/class/RequestQueue#fetch_next_request) method.
166
+
To fetch the next request from the queue for processing, you can use the <ApiLinkto="class/RequestQueue#fetch_next_request">`RequestQueue.fetch_next_request`</ApiLink> method.
167
167
168
-
To get info about a specific request from the queue, you can use the [`RequestQueue.get_request`](../../reference/class/RequestQueue#get_request) method.
168
+
To get info about a specific request from the queue, you can use the <ApiLinkto="class/RequestQueue#get_request">`RequestQueue.get_request`</ApiLink> method.
169
169
170
170
### Handling requests
171
171
172
-
To mark a request as handled, you can use the [`RequestQueue.mark_request_as_handled`](../../reference/class/RequestQueue#mark_request_as_handled) method.
172
+
To mark a request as handled, you can use the <ApiLinkto="class/RequestQueue#mark_request_as_handled">`RequestQueue.mark_request_as_handled`</ApiLink> method.
173
173
174
-
To mark a request as not handled, so that it gets retried, you can use the [`RequestQueue.reclaim_request`](../../reference/class/RequestQueue#reclaim_request) method.
174
+
To mark a request as not handled, so that it gets retried, you can use the <ApiLinkto="class/RequestQueue#reclaim_request">`RequestQueue.reclaim_request`</ApiLink> method.
175
175
176
-
To check if all the requests in the queue are handled, you can use the [`RequestQueue.is_finished`](../../reference/class/RequestQueue#is_finished) method.
176
+
To check if all the requests in the queue are handled, you can use the <ApiLinkto="class/RequestQueue#is_finished">`RequestQueue.is_finished`</ApiLink> method.
Copy file name to clipboardExpand all lines: docs/02_concepts/05_proxy_management.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ If you want to use Apify Proxy locally, make sure that you run your Actors via t
36
36
37
37
## Proxy configuration
38
38
39
-
All your proxy needs are managed by the [`ProxyConfiguration`](../../reference/class/ProxyConfiguration) class. You create an instance using the [`Actor.create_proxy_configuration()`](../../reference/class/Actor#create_proxy_configuration) method. Then you generate proxy URLs using the [`ProxyConfiguration.new_url()`](../../reference/class/ProxyConfiguration#new_url) method.
39
+
All your proxy needs are managed by the <ApiLinkto="class/ProxyConfiguration">`ProxyConfiguration`</ApiLink> class. You create an instance using the <ApiLinkto="class/Actor#create_proxy_configuration">`Actor.create_proxy_configuration()`</ApiLink> method. Then you generate proxy URLs using the <ApiLinkto="class/ProxyConfiguration#new_url">`ProxyConfiguration.new_url()`</ApiLink> method.
0 commit comments