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
-[Node.js](https://nodejs.org/en/) version 16 or higher with `npm` installed on your computer.
21
21
- The [Apify CLI](/cli/docs/installation) installed.
22
-
- Optional: If you want to deploy your Actor to the Apify platform, you need to [sign in](https://console.apify.com/sign-in).
23
-
24
-
---
22
+
- Optional: To deploy your Actor, [sign in](https://console.apify.com/sign-in).
25
23
26
24
## Step 1: Create your Actor
27
25
28
-
Use Apify CLI to create a new Actor using the following command:
26
+
Use Apify CLI to create a new Actor:
29
27
30
28
```bash
31
29
apify create
32
30
```
33
31
34
-
The Apify CLI will prompt you to:
32
+
The CLI will ask you to:
35
33
36
-
1. Name your Actor: Enter a descriptive name for your Actor, such as `your-actor-name`.
37
-
1. Choose a programming language: Select the language you want to use for your Actor (JavaScript, TypeScript, or Python).
38
-
1. Select a development template: Choose a template from the list of available options.
34
+
1. Name your Actor (e.g., `your-actor-name`)
35
+
2. Choose a programming language (`JavaScript`, `TypeScript`, or `Python`)
36
+
3. Select a development template
39
37
:::info
40
38
41
-
If you’re unsure which template to use, browse the [full list of templates](https://apify.com/templates) with descriptions to find the best fit for your Actor.
39
+
Browse the [full list of templates](https://apify.com/templates) to find the best fit for your Actor.
42
40
43
41
:::
44
-
1. After selecting the template, the Apify CLI will:
45
-
- Create a `your-actor-name` directory with the boilerplate code.
46
-
- Install all project dependencies.
47
-
1. Navigate to your new Actor directory:
48
-
```bash
49
-
cd your-actor-name
50
-
```
42
+
43
+
The CLI will:
44
+
- Create a `your-actor-name` directory with boilerplate code
45
+
- Install all project dependencies
46
+
47
+
Now, you can navigate to your new Actor directory:
48
+
```bash
49
+
cd your-actor-name
50
+
```
51
51
52
52
## Step 2: Run your Actor
53
53
54
-
After creating your Actor, you can run it with:
54
+
Run your Actor with:
55
55
56
56
```bash
57
57
apify run
58
58
```
59
59
60
60
:::tip
61
61
62
-
During development, use `apify run --purge`. This commandclears all results from previous runs, so it’s as if you’re running the Actor for the first time.
62
+
During development, use `apify run --purge`. This clears all results from previous runs, so it's as if you're running the Actor for the first time.
63
63
64
64
:::
65
65
66
-
This command runs your Actor, and you’ll see output similar to the followingin your terminal:
66
+
You'll see output similar to this in your terminal:
67
67
68
68
```bash
69
69
INFO System info {"apifyVersion":"3.4.3","apifyClientVersion":"2.12.6","crawleeVersion":"3.13.10","osType":"Darwin","nodeVersion":"v22.17.0"}
As you can see in the logs, the Actor extracts text from a web page. All the main logic is defined in`src/main.js`. Depending on the template you chose, this file may also be `src/main.ts` (for TypeScript) or `src/main.py` (for Python).
76
+
As you can see in the logs, the Actor extracts text from a web page. The main logic lives in`src/main.js`. Depending on your template, this file may be `src/main.ts` (TypeScript) or `src/main.py` (Python).
77
77
78
78
In the next step, we’ll explore the results in more detail.
79
79
80
80
## Step 3: Explore the Actor
81
81
82
-
<!-- TODO: Add more examples -->
83
-
84
-
The following section will explain the Actor in more details.
82
+
Let's explore the Actor structure.
85
83
86
84
### The `.actor` folder
87
85
88
-
The Actor configuration is inthe folder `.actor`. The file `actor.json` defines the Actor's configuration, such as name, description, etc. You can find more info in [actor.json](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) definition.
86
+
The `.actor` folder contains the Actor configuration. The `actor.json` file defines the Actor's name, description, and other settings. Find more info in the [actor.json](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) definition.
89
87
90
88
### Actor's `input`
91
89
92
-
Each Actor accepts an `input object`, which tells it what it should do. The object is passed inJSON format, and you can find itin`storage/key_value_stores/default/INPUT.json`.
90
+
Each Actor accepts an `input object` that tells it what to do. The object uses JSON format and livesin`storage/key_value_stores/default/INPUT.json`.
93
91
94
92
:::info
95
93
96
-
To change the `INPUT.json`, edit first the `input_schema.json`in the `.actor` folder.
94
+
To change the `INPUT.json`, edit the `input_schema.json`in the `.actor` folder first.
97
95
98
-
This JSON Schema not only validates input automatically (so you don't need to handle input errors in your code), but also powers the Actor's user interface, generates API docs, and enables smart integration with tools like Zapier or Make by auto-linking input fields.
96
+
This JSON Schema validates input automatically (no error handling needed), powers the Actor's user interface, generates API docs, and enables smart integration with tools like Zapier or Make by auto-linking input fields.
99
97
100
98
:::
101
99
102
-
You can find more info in the [Input schema](/platform/actors/development/actor-definition/input-schema) documentation.
100
+
Find more info in the [Input schema](/platform/actors/development/actor-definition/input-schema) documentation.
103
101
104
102
### Actor's `storage`
105
103
106
-
The Actor system provides two specialized storages that can be used by Actors for storing files and results: `key-value` store and `dataset`.
104
+
The Actor system provides two storage types for files and results: `key-value` store and `dataset`.
107
105
108
106
#### Key-value store
109
107
110
-
The key-value store is a simple data storage that is used for saving and reading files or data records.
111
-
112
-
Key-value stores are ideal for saving things like screenshots, PDFs, or to persist the state of Actors e.g. as a JSON file.
108
+
The key-value store saves and reads files or data records. Key-value stores work well for screenshots, PDFs, or persisting Actor state as JSON files.
113
109
114
110
#### Dataset
115
111
116
-
The dataset is an append-only storage that allows you to store a series of data objects such as results from web scraping, crawling, or data processing jobs. You or your users can thenexportthe dataset to formats such as JSON, CSV, XML, RSS, Excel, or HTML.
112
+
The dataset stores a series of data objects from web scraping, crawling, or data processing jobs. You can exportdatasets to JSON, CSV, XML, RSS, Excel, or HTML formats.
117
113
118
114
### Actor's `output`
119
115
120
-
While the input object provides a standardized way to invoke Actors, Actors can also generate an output object, which is a standardized way to display, consume, and integrate Actors’ results.
116
+
You define the Actor output using the Output schema files:
121
117
122
-
You can define how the Actor output looks using the Output schema file. The system uses this information to automatically generate an immutable JSON file, which tells users where to find the results produced by the Actor.
- [Key-value Store Schema Specification](/platform/actors/development/actor-definition/key-value-store-schema)
120
+
121
+
The system uses this to generate an immutable JSON file that tells users where to find the Actor's results.
123
122
124
123
## Step 4: Deploy your Actor
125
124
126
-
Let's now deploy your Actor to the Apify platform, where you can for example run the Actor on scheduled basis, or you can make the Actor public for other users.
125
+
Let's now deploy your Actor to the Apify platform, where you can run the Actor on a scheduled basis, or you can make the Actor public for other users.
127
126
128
-
1. First of all, you need to login:
127
+
1. Login first:
129
128
130
129
```bash
131
130
apify login
132
131
```
133
132
134
133
:::info
135
-
After you succesfull login, your Apify token is stored in `~/.apify/auth.json`, or `C:\Users\<name>\.apify` based on your system.
134
+
After you successfully login, your Apify token is stored in`~/.apify/auth.json`, or `C:\Users\<name>\.apify` based on your system.
136
135
:::
137
136
138
-
1. Now, you can push your Actor to the Apify platform:
137
+
2. Push your Actor to the Apify platform:
139
138
140
139
```bash
141
140
apify push
142
141
```
143
142
144
-
## Step 5: It's time to build!
145
-
146
-
Good job, you have done it! 🎉 From here, you can develop your Actor.
143
+
## Step 5: It's Time to Iterate!
147
144
148
-
:::tip Actor monetization
149
-
150
-
If you have successfully completed your first Actor, you may consider [sharing it with other users and monetizing it](../../publishing/index.mdx). The Apify platform provides opportunities to publish and monetize your Actors, allowing you to share your work with the community and potentially generate revenue.
151
-
152
-
:::
145
+
Good job! 🎉 You're ready to develop your Actor. You can make changes to your Actor and implement your use case.
153
146
154
147
## Next Steps
155
148
156
-
- If you want to understand Actors in more details, read the [Actor Whitepaper](https://whitepaper.actor/).
149
+
- Visit the [Apify Academy](/academy) to access a comprehensive collection of tutorials, documentation, and learning resources.
150
+
- To understand Actors in detail, read the [Actor Whitepaper](https://whitepaper.actor/).
157
151
- Check [Continuous integration](../deployment/continuous_integration.md) documentation to automate your Actor development process.
152
+
- After you finish building your first Actor, you can [share it with other users and even monetize it](../../publishing/index.mdx).
**Create your first Actor using the web IDE in Apify Console.**
14
12
15
13
---
16
14
17
-
<!-- TODO: Revisit, make it more like start_locally, but keep the content, only add steps, etc. -->
15
+
## Prerequisites
18
16
19
-
## Create the Actor
17
+
- An Apify account. [Sign up for a free account](https://console.apify.com/sign-up) on the Apify website.
20
18
21
-
:::note Prerequisites
19
+
## Step 1: Create your Actor
22
20
23
-
To use Web IDE, you will need an Apify account. You can [sign-up for a free account](https://console.apify.com/sign-up) on the Apify website.
21
+
Log in to [Apify Console](https://console.apify.com), navigate to [**My Actors**](https://console.apify.com/actors/development/my-actors), then click the **Develop new** button.
24
22
25
-
:::
23
+

26
24
27
-
After you sign in to [Apify Console](https://console.apify.com), navigate to the [**My Actors**](https://console.apify.com/actors/development/my-actors) subsection. Then, click the **Develop new** button at the top right corner of the page.
25
+
You'll see Actor development templates for `JavaScript`, `TypeScript`, and `Python`.
28
26
29
-

27
+
These templates provide boilerplate code and a preconfigured environment. Choose the template that best suits your needs. For the following demo, we'll proceed with **Crawlee + Puppeteer + Chrome**.
28
+
29
+
:::info
30
30
31
-
You will be redirected to a page containing various Actor development templates for popular languages such as `JavaScript`, `TypeScript`, and `Python`. These templates provide boilerplate code and a preconfigured environment tailored to specific use cases. You can choose the template that best suits your technology stack. For demonstration purposes, let's choose **Crawlee + Puppeteer + Chrome**.
31
+
Browse the [full list of templates](https://apify.com/templates) to find the best fit for your Actor.
32
+
33
+
:::
32
34
33
35

34
36
35
-
After choosing the template your Actor will be automatically named and you will be redirected to its page.
37
+
After choosing the template, your Actor will be automatically named and you'll be redirected to its page.
38
+
39
+
## Step 2: Explore the Actor
36
40
37
-
### Explore the source code
41
+
The provided boilerplate code utilizes the [Apify SDK](https://docs.apify.com/sdk/js/) combined with [Crawlee](https://crawlee.dev/), Apify's popular open-source Node.js web scraping library.
38
42
39
-
The provided boilerplate code utilizes the [Apify SDK](https://docs.apify.com/sdk/js/) combined with [Crawlee](https://crawlee.dev/), Apify's popular open-source Node.js web scraping library. By default the code performs a recursive crawl of the [apify.com](https://apify.com) website, but you can change it to a website of your choosing.
43
+
By default, the code crawls the [apify.com](https://apify.com) website, but you can change it to any website.
40
44
41
45
:::info Crawlee
42
46
43
47
[Crawlee](https://crawlee.dev/) is an open-source Node.js library designed for web scraping and browser automation. It helps you build reliable crawlers quickly and efficiently.
Once the build has been initiated, the UI will transition to the **Last build** tab, displaying the progress of the build and the Docker build log.
57
+
Once the build starts, the UI transitions to the **Last build** tab, showing build progress and Docker build logs.
55
58
56
59

57
60
@@ -68,7 +71,7 @@ This represents the Actor creation flow, where you first build the Actor from th
68
71
69
72
:::
70
73
71
-
###Run the Actor
74
+
##Step 4: Run the Actor
72
75
73
76
Once the Actor is built, you can look at its input, which consists of one field - **Start URL**, the URL where the crawling starts. Below the input, you can adjust the **Run options**:
74
77
@@ -82,9 +85,9 @@ To initiate an Actor run, click the **Start** button at the bottom of the page.
82
85
83
86

84
87
85
-
###Pull the Actor
88
+
##Step 5: Pull the Actor
86
89
87
-
To continue development locally, you can pull the Actor's source code to your local machine.
90
+
To continue development locally, pull the Actor's source code to your machine.
@@ -136,14 +139,15 @@ To pull your Actor, you need to:
136
139
137
140
You can find both by clicking on the Actor title at the top of the page, which will open a new window containing the Actor's unique name and ID.
138
141
139
-
## Iterate & customize
142
+
## Step 6: It's Time to Iterate!
140
143
141
-
After pulling the Actor's source code to your local machine, you can modify and customize it to match your specific requirements.
142
-
Leverage your preferred code editor or development environment to make the necessary changes and enhancements.
144
+
After pulling the Actor's source code to your local machine, you can modify and customize it to match your specific requirements. Leverage your preferred code editor or development environment to make the necessary changes and enhancements.
143
145
144
146
Once you've made the desired changes, you can push the updated code back to the Apify platform for deployment & execution, leveraging the platform's scalability and reliability.
145
147
146
-
To learn more about the Apify platform's features and best practices for Actor development:
148
+
## Next Steps
147
149
148
-
- Continue to the next chapter of this section for in-depth guidance and examples
149
150
- Visit the [Apify Academy](/academy) to access a comprehensive collection of tutorials, documentation, and learning resources.
151
+
- To understand Actors in detail, read the [Actor Whitepaper](https://whitepaper.actor/).
152
+
- Check [Continuous integration](../deployment/continuous_integration.md) documentation to automate your Actor development process.
153
+
- After you finish building your first Actor, you can [share it with other users and even monetize it](../../publishing/index.mdx).
0 commit comments