Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

Add documentation versioning, clean up bad docs

Ondra Urbande7ab1a99002
diff --git a/docs/guides/apify_platform.md b/docs/guides/apify_platform.md
index 69d944f07..810bcbd15 100644
--- a/docs/guides/apify_platform.md
+++ b/docs/guides/apify_platform.md
@@ -5,7 +5,7 @@ title: Apify Platform
Apify is a [platform](https://apify.com) built to serve large scale and high performance web scraping
and automation needs. It provides easy access to [compute instances (Actors)](#what-is-an-actor),
-[convenient storages](/docs/guides/data-storage), [proxies](/docs/guides/proxy-management),
+[convenient storages](../guides/data-storage), [proxies](../guides/proxy-management),
[scheduling](https://docs.apify.com/scheduler), [webhooks](https://docs.apify.com/webhooks)
and [more](https://docs.apify.com/), accessible through a [web interface](https://my.apify.com)
or an [API](https://docs.apify.com/api).
@@ -44,10 +44,10 @@ apify run -p
### Log in with environment variables
If you prefer not to use Apify CLI, you can always provide credentials to your scraper
-by setting the [`APIFY_TOKEN`](/docs/guides/environment-variables#apify_token) environment
+by setting the [`APIFY_TOKEN`](../guides/environment-variables#apify_token) environment
variable to your API token.
-> There's also the [`APIFY_PROXY_PASSWORD`](/docs/guides/environment-variables#apify_proxy_password)
+> There's also the [`APIFY_PROXY_PASSWORD`](../guides/environment-variables#apify_proxy_password)
> environment variable. It is automatically inferred from your token by the SDK, but it can be useful
> when you need to access proxies from a different account than your token represents.
diff --git a/docs/guides/data_storage.md b/docs/guides/data_storage.md
index aa44a0931..4d55b71bc 100644
--- a/docs/guides/data_storage.md
+++ b/docs/guides/data_storage.md
@@ -4,7 +4,7 @@ title: Data Storage
---
The Apify SDK has several data storage types that are useful for specific tasks. The data is stored either on local disk to a directory defined by the
-`APIFY_LOCAL_STORAGE_DIR` environment variable, or on the [Apify platform](/docs/guides/apify-platform) under the user account
+`APIFY_LOCAL_STORAGE_DIR` environment variable, or on the [Apify platform](../guides/apify-platform) under the user account
identified by the API token defined by the `APIFY_TOKEN` environment variable. If neither of these variables is defined, by default Apify SDK sets
`APIFY_LOCAL_STORAGE_DIR` to `./apify_storage` in the current working directory and prints a warning.
@@ -27,9 +27,9 @@ Each actor run is associated with a **default key-value store**, which is create
and output is stored in the default key-value store under the `INPUT` and `OUTPUT` key, respectively. Typically the input and output is a JSON file,
although it can be any other format.
-In the Apify SDK, the key-value store is represented by the [`KeyValueStore`](/docs/api/key-value-store) class. In order to simplify access to the default
-key-value store, the SDK also provides [`Apify.getValue()`](/docs/api/apify#getvalue) and
-[`Apify.setValue()`](/docs/api/apify#setvalue) functions.
+In the Apify SDK, the key-value store is represented by the [`KeyValueStore`](../api/key-value-store) class. In order to simplify access to the default
+key-value store, the SDK also provides [`Apify.getValue()`](../api/apify#getvalue) and
+[`Apify.setValue()`](../api/apify#setvalue) functions.
In local configuration, the data is stored in the directory specified by the `APIFY_LOCAL_STORAGE_DIR` environment variable as follows:
@@ -65,7 +65,7 @@ const value = await store.getValue('some-key');
await store.setValue('some-key', null);
```
-To see a real-world example of how to get the input from the key-value store, see the [Screenshots](/docs/examples/screenshots) example.
+To see a real-world example of how to get the input from the key-value store, see the [Screenshots](../examples/screenshots) example.
## Dataset
@@ -73,7 +73,7 @@ Datasets are used to store structured data where each object stored has the same
can imagine a dataset as a table, where each object is a row and its attributes are columns. Dataset is an append-only storage - you can only add new
records to it but you cannot modify or remove existing records.
-When the dataset is stored on the [Apify platform](/docs/guides/apify-platform), you can export its data to the following formats: HTML,
+When the dataset is stored on the [Apify platform](../guides/apify-platform), you can export its data to the following formats: HTML,
JSON, CSV, Excel, XML and RSS. The datasets are displayed on the actor run details page and in the
[Storage](https://my.apify.com/storage) section in the Apify app. The actual data is exported using the
[Get dataset items](https://apify.com/docs/api/v2#/reference/datasets/item-collection/get-items) Apify API endpoint. This
@@ -82,8 +82,8 @@ way you can easily share crawling results.
Each actor run is associated with a **default dataset**, which is created exclusively for the actor run. Typically, it is used to store crawling
results specific for the actor run. Its usage is optional.
-In the Apify SDK, the dataset is represented by the [`Dataset`](/docs/api/dataset) class. In order to simplify writes to the default dataset, the SDK
-also provides the [`Apify.pushData()`](/docs/api/apify#pushdata) function.
+In the Apify SDK, the dataset is represented by the [`Dataset`](../api/dataset) class. In order to simplify writes to the default dataset, the SDK
+also provides the [`Apify.pushData()`](../api/apify#pushdata) function.
In local configuration, the data is stored in the directory specified by the `APIFY_LOCAL_STORAGE_DIR` environment variable as follows:
@@ -111,7 +111,7 @@ await dataset.pushData({ foo: 'bar' });
await dataset.pushData([{ foo: 'bar2', col2: 'val2' }, { col3: 123 }]);
```
-To see how to use the dataset to store crawler results, see the [Cheerio Crawler](/docs/examples/cheerio-crawler) example.
+To see how to use the dataset to store crawler results, see the [Cheerio Crawler](../examples/cheerio-crawler) example.
## Request queue
@@ -121,7 +121,7 @@ recursively follow links to other pages. The data structure supports both breadt
Each actor run is associated with a **default request queue**, which is created exclusively for the actor run. Typically, it is used to store URLs to
crawl in the specific actor run. Its usage is optional.
-In Apify SDK, the request queue is represented by the [`RequestQueue`](/docs/api/request-queue) class.
+In Apify SDK, the request queue is represented by the [`RequestQueue`](../api/request-queue) class.
In local configuration, the request queue data is stored in the directory specified by the `APIFY_LOCAL_STORAGE_DIR` environment variable as follows:
@@ -159,4 +159,4 @@ await queue.markRequestHandled(request1);
await queue.reclaimRequest(request2);
```
-To see how to use the request queue with a crawler, see the [Puppeteer Crawler](/docs/examples/puppeteer-crawler) example.
+To see how to use the request queue with a crawler, see the [Puppeteer Crawler](../examples/puppeteer-crawler) example.
diff --git a/docs/guides/environment_variables.md b/docs/guides/environment_variables.md
index d12bbe39a..2d8693346 100644
--- a/docs/guides/environment_variables.md
+++ b/docs/guides/environment_variables.md
@@ -6,15 +6,15 @@ title: Environment Variables
The following is a list of the environment variables used by Apify SDK that are available to the user.
The SDK is capable of running without any env vars present, but certain features will only become available
after env vars are properly set. You can use [Apify CLI](https://github.com/apify/apify-cli)
-to set the env vars for you. [Apify platform](/docs/guides/apify-platform) also sets the variables automatically.
+to set the env vars for you. [Apify platform](../guides/apify-platform) also sets the variables automatically.
## Important env vars:
The following environment variables have large impact on the way Apify SDK works and its behavior
can be changed significantly by setting or unsetting them.
### `APIFY_LOCAL_STORAGE_DIR`
-Defines the path to a local directory where [`KeyValueStore`](/docs/api/key-value-store),
-[`Dataset`](/docs/api/dataset), and [`RequestQueue`](/docs/api/request-queue) store their data.
+Defines the path to a local directory where [`KeyValueStore`](../api/key-value-store),
+[`Dataset`](../api/dataset), and [`RequestQueue`](../api/request-queue) store their data.
Typically it is set to `./apify_storage`. If omitted, you should define the [`APIFY_TOKEN`](#apify_token)
environment variable instead.
@@ -49,7 +49,7 @@ your code, such as temporarily switching log level to DEBUG.
### `APIFY_HEADLESS`
If set to `1`, web browsers launched by Apify SDK will run in the headless mode. You can still override
this setting in the code, e.g. by passing the `headless: true` option to the
-[`Apify.launchPuppeteer()`](/docs/api/apify#launchpuppeteer) function. But having this setting
+[`Apify.launchPuppeteer()`](../api/apify#launchpuppeteer) function. But having this setting
in an environment variable allows you to develop the crawler locally in headful mode to simplify the debugging,
and only run the crawler in headless mode once you deploy it to the Apify platform. By default, the browsers
are launched in headful mode, i.e. with windows.
@@ -57,11 +57,11 @@ are launched in headful mode, i.e. with windows.
### `APIFY_LOG_LEVEL`
Specifies the minimum log level, which can be one of the following values (in order of severity):
`DEBUG`, `INFO`, `WARNING` and `ERROR`. By default, the log level is set to `INFO`,
-which means that `DEBUG` messages are not printed to console. See the [`utils.log`](/docs/api/log)
+which means that `DEBUG` messages are not printed to console. See the [`utils.log`](../api/log)
namespace for logging utilities.
### `APIFY_MEMORY_MBYTES`
-Sets the amount of system memory in megabytes to be used by the [`AutoscaledPool`](/docs/api/autoscaled-pool).
+Sets the amount of system memory in megabytes to be used by the [`AutoscaledPool`](../api/autoscaled-pool).
It is used to limit the number of concurrently running tasks. By default, the max amount of memory
to be used is set to one quarter of total system memory, i. e. on a system with 8192 MB of memory,
the autoscaling feature will only use up to 2048 MB of memory.
diff --git a/docs/guides/getting_started.md b/docs/guides/getting_started.md
index b5b090c00..76d5dade9 100644
--- a/docs/guides/getting_started.md
+++ b/docs/guides/getting_started.md
@@ -17,7 +17,7 @@ The goal of this getting started guide is to provide a step-by-step introduction
creating the simplest of crawlers that only print text to console, all the way up to complex systems that crawl pages, interact with them as if a real
user were sitting in front of a real browser and output structured data.
-Since Apify SDK is usable both locally on any computer and on the [Apify Platform](/docs/guides/apify-platform), you will be able
+Since Apify SDK is usable both locally on any computer and on the [Apify Platform](../guides/apify-platform), you will be able
to use the source code in both environments interchangeably. Nevertheless, some initial setup is still required, so choose your preferred starting
environment and let's get into it.
@@ -45,7 +45,7 @@ npm -v
The fastest and best way to create new projects with the Apify SDK is to use our own
[Apify CLI](https://www.npmjs.com/package/apify-cli). This command line tool allows you to create, run and manage Apify
-projects with ease, including their deployment to the [Apify platform](/docs/guides/apify-platform) if you wish to run them in the
+projects with ease, including their deployment to the [Apify platform](../guides/apify-platform) if you wish to run them in the
cloud after developing them locally.
Let's install the Apify CLI with the following command:
@@ -96,7 +96,7 @@ Did you see all that? If you did, congratulations! You're ready to go!
Maybe you don't have Node.js installed and don't want the hassle. Or you can't install anything on your computer because you're using a company
provided one. Or perhaps you'd just prefer to start working in the cloud right away. Well, no worries, we've got you covered.
-The [Apify platform](/docs/guides/apify-platform) is the foundational product of
+The [Apify platform](../guides/apify-platform) is the foundational product of
[Apify](https://apify.com). It's a serverless cloud computing platform, specifically designed for any web automation jobs,
that may include crawling and scraping, but really works amazing for any batch jobs and long running tasks.
@@ -105,7 +105,7 @@ haven't already. Don't forget to verify your email. Without it, you won't be abl
Once you're in, you might be prompted by our in-app help to walk through a step-by-step guide into some of our new features. Feel free to finish that,
if you'd like, but once you're done, click on the **Actors** tab in the left menu. To read more about **Actors**, see:
-[What is an Actor](/docs/guides/apify-platform#what-is-an-actor).
+[What is an Actor](../guides/apify-platform#what-is-an-actor).
### Creating a new project
@@ -129,8 +129,8 @@ introduce all the Apify SDK classes necessary to make it happen.
### The general idea
-There are 3 crawler classes available for use in the Apify SDK. [`BasicCrawler`](/docs/api/basic-crawler), [`CheerioCrawler`](/docs/api/cheerio-crawler)
-and [`PuppeteerCrawler`](/docs/api/puppeteer-crawler). We'll talk about their differences later. Now, let's talk about what they have in common.
+There are 3 crawler classes available for use in the Apify SDK. [`BasicCrawler`](../api/basic-crawler), [`CheerioCrawler`](../api/cheerio-crawler)
+and [`PuppeteerCrawler`](../api/puppeteer-crawler). We'll talk about their differences later. Now, let's talk about what they have in common.
All the crawlers' general idea is to go to a web page, open it, do some stuff there, save some results and continue to the next page, until it's done
its job. So each time the crawler needs to find answers to two questions: **Where should I go?** and **What should I do there?**. Answering those two
@@ -138,16 +138,16 @@ questions is the only setup mandatory to run the crawlers.
### The Where - `Request`, `RequestList` and `RequestQueue`
-All crawlers use instances of the [`Request`](/docs/api/request) class to determine where they need to go. Each request may hold a lot of information,
+All crawlers use instances of the [`Request`](../api/request) class to determine where they need to go. Each request may hold a lot of information,
but at the very least, it must hold a URL - a web page to open. But having only one URL would not make sense for crawling. We need to either have a
pre-existing list of our own URLs that we wish to visit, perhaps a thousand, or a million, or we need to build this list dynamically as we crawl,
adding more and more URLs to the list as we progress.
-A representation of the pre-existing list is an instance of the [`RequestList`](/docs/api/request-list) class. It is a static, immutable list of URLs and
-other metadata (see the [`Request`](/docs/api/request) object) that the crawler will visit, one by one, retrying whenever an error occurs, until there
+A representation of the pre-existing list is an instance of the [`RequestList`](../api/request-list) class. It is a static, immutable list of URLs and
+other metadata (see the [`Request`](../api/request) object) that the crawler will visit, one by one, retrying whenever an error occurs, until there
are no more `Requests` to process.
-[`RequestQueue`](/docs/api/request-queue) on the other hand, represents a dynamic queue of `Requests`. One that can be updated at runtime by adding more
+[`RequestQueue`](../api/request-queue) on the other hand, represents a dynamic queue of `Requests`. One that can be updated at runtime by adding more
pages - `Requests` to process. This allows the crawler to open one page, extract interesting URLs, such as links to other pages on the same domain,
add them to the queue (called _enqueuing_) and repeat this process to build a queue of tens of thousands or more URLs while knowing only a single one
at the beginning.
@@ -163,7 +163,7 @@ from the page, processing the data, saving it, calling APIs, doing calculations
The `handlePageFunction` is provided by you, the user, and invoked automatically by the crawler for each `Request` from either the `RequestList` or
`RequestQueue`. It always receives a single argument and that is a plain `Object`. Its properties change depending on the used crawler class, but it
always includes at least the `request` property, which represents the currently crawled `Request` instance (i.e. the URL the crawler is visiting and
-related metadata) and the `autoscaledPool` property, which is an instance of the [`AutoscaledPool`](/docs/api/autoscaled-pool) class and we'll talk about
+related metadata) and the `autoscaledPool` property, which is an instance of the [`AutoscaledPool`](../api/autoscaled-pool) class and we'll talk about
it in detail later.
```js
@@ -177,7 +177,7 @@ it in detail later.
### Putting it all together
Enough theory! Let's put some of those hard learned facts into practice. We learned above that we need `Requests` and a `handlePageFunction` to setup
-a crawler. We will also use the [`Apify.main()`](/docs/api/apify#main) function. It's not mandatory, but it makes our life easier. We'll
+a crawler. We will also use the [`Apify.main()`](../api/apify#main) function. It's not mandatory, but it makes our life easier. We'll
learn about it in detail later on.
Let's start super easy. Visit one page, get its title and close. First of all we need to require Apify, to make all of its features available to us:
@@ -205,7 +205,7 @@ Apify.main(async () => {
> If you're not familiar with the `async` and `await` keywords used in the example, trust that it is a native syntax in modern JavaScript and you can
> [learn more about it here](https://nikgrozev.com/2017/10/01/async-await/).
-The [`requestQueue.addRequest()`](/docs/api/request-queue#addrequest) function automatically converts the plain object we passed to it to a
+The [`requestQueue.addRequest()`](../api/request-queue#addrequest) function automatically converts the plain object we passed to it to a
`Request` instance, so now we have a `requestQueue` that holds one `request` which points to `https://apify.com`. Now we need the
`handlePageFunction`.
@@ -263,21 +263,21 @@ you learn more about the `CheerioCrawler`.
## CheerioCrawler aka jQuery crawler
This is the crawler that we used in our earlier example. Our simplest and also the fastest crawling solution. If you're familiar with `jQuery`, you'll
-understand [`CheerioCrawler`](/docs/api/cheerio-crawler) in minutes. [Cheerio](https://www.npmjs.com/package/cheerio) is
+understand [`CheerioCrawler`](../api/cheerio-crawler) in minutes. [Cheerio](https://www.npmjs.com/package/cheerio) is
essentially `jQuery` for Node.js. It offers the same API, including the familiar `$` object. You can use it, as you would `jQuery`, for manipulating
the DOM of a HTML page. In crawling, you'll mostly use it to select the right elements and extract their text values - the data you're interested in.
But `jQuery` runs in a browser and attaches directly to the browser's DOM. Where does `cheerio` get its HTML? This is where the `Crawler` part of
-[`CheerioCrawler`](/docs/api/cheerio-crawler) comes in.
+[`CheerioCrawler`](../api/cheerio-crawler) comes in.
### Overview
-[`CheerioCrawler`](/docs/api/cheerio-crawler) crawls by making plain HTTP requests to the provided URLs. As you remember from the previous section, the
-URLs are fed to the crawler using either the [`RequestList`](/docs/api/cheerio-crawler) or the [`RequestQueue`](/docs/api/cheerio-crawler). The HTTP responses
+[`CheerioCrawler`](../api/cheerio-crawler) crawls by making plain HTTP requests to the provided URLs. As you remember from the previous section, the
+URLs are fed to the crawler using either the [`RequestList`](../api/cheerio-crawler) or the [`RequestQueue`](../api/cheerio-crawler). The HTTP responses
it gets back are HTML pages, the same pages you would get in your browser when you first load a URL.
> Note, however, that modern web pages often do not serve all of their content in the first HTML response, but rather the first HTML contains links to
> other resources such as CSS and JavaScript that get downloaded afterwards and together they create the final page. See our
-> [`PuppeteerCrawler`](/docs/api/puppeteer-crawler) to crawl those.
+> [`PuppeteerCrawler`](../api/puppeteer-crawler) to crawl those.
Once the page's HTML is retrieved, the crawler will pass it to [Cheerio](https://www.npmjs.com/package/cheerio) for
parsing. The result is the typical `$` function, which should be familiar to `jQuery` users. You can use this `$` to do all sorts of lookups and
@@ -300,7 +300,7 @@ $('[href]')
> This is not to show that Cheerio is better than plain browser JavaScript. Some might actually prefer the more expressive way plain JS provides.
> Unfortunately, the browser JavaScript methods are not available in Node.js, so Cheerio is our best bet to do the parsing.
-### When to use [`CheerioCrawler`](/docs/api/cheerio-crawler)
+### When to use [`CheerioCrawler`](../api/cheerio-crawler)
Even though using `CheerioCrawler` is extremely easy, it probably will not be your first choice for most kinds of crawling or scraping in production
environments. Since most websites nowadays use modern JavaScript to create rich, responsive and data driven user experiences, the plain HTTP requests
@@ -308,7 +308,7 @@ the crawler uses may just fall short of your needs.
But `CheerioCrawler` is far from useless! It really shines when you need to do extremely high workloads. With just 4 GBs of memory and a single CPU
core, you can scrape 500 or more pages a minute! _(assuming each page contains approximately 400KB of HTML)_ To get this high with a full browser
-scraper, such as the [`PuppeteerCrawler`](/docs/api/puppeteer-crawler), you'd need significantly more computing power.
+scraper, such as the [`PuppeteerCrawler`](../api/puppeteer-crawler), you'd need significantly more computing power.
**Advantages:**
@@ -324,7 +324,7 @@ scraper, such as the [`PuppeteerCrawler`](/docs/api/puppeteer-crawler), you'd ne
- May easily overload the target website with requests
- Does not enable any manipulation of the website before scraping
-### Basic use of [`CheerioCrawler`](/docs/api/cheerio-crawler)
+### Basic use of [`CheerioCrawler`](../api/cheerio-crawler)
Now that we have an idea of the crawler's inner workings, let's build one. We'll use the example from the previous section and improve on it by
letting it truly crawl the page, finding new links as it goes, enqueuing them into the `RequestQueue` and then scraping them.
@@ -543,7 +543,7 @@ It also allows you to modify the resulting `Requests` to match your crawling nee
`enqueueLinks` is quite a powerful function so, like crawlers, it gets its arguments from an options object. This is useful, because you don't have to
remember their order! But also because we can easily extend its API and add new features. You can
-[find the full reference here](/docs/api/utils#enqueuelinks).
+[find the full reference here](../api/utils#enqueuelinks).
We suggest using ES6 destructuring to grab the `enqueueLinks()` function off of the `utils` object, so you don't have to type `Apify.utils` all the
time.
@@ -672,7 +672,7 @@ That's been quite a lot of theory and examples. We might as well put it to pract
two arguments. The source, in our case the `$` object, and the destination - the `requestQueue`. To filter links, we need to add a third argument:
`pseudoUrls`.
-The `options.pseudoUrls` argument is always an `Array`, but its contents can take on many forms. [See the reference](/docs/api/utils#enqueueLinks)
+The `options.pseudoUrls` argument is always an `Array`, but its contents can take on many forms. [See the reference](../api/utils#enqueueLinks)
for all of them. Since we just need to filter out same domain links, we'll keep it simple and use a pseudo-URL `string`.
```js
@@ -811,7 +811,7 @@ And that's it! No more parsing the links from HTML using Cheerio, filtering them
getting your data, while leaving the mundane crawling management to your tools.
`Apify.utils.enqueueLinks()` has a lot more tricks up its sleeve. Make sure to check out the
-[reference documentation](/docs/api/utils#enqueueLinks) to see what else it can do for you. Namely the feature to prepopulate the `Request`
+[reference documentation](../api/utils#enqueueLinks) to see what else it can do for you. Namely the feature to prepopulate the `Request`
instances it creates with `userData` of your choice is extremely useful!
## Getting some real world data
@@ -1479,7 +1479,7 @@ Apify.main(async () => {
#### What's `Apify.pushData()`
-[`Apify.pushData()`](/docs/api/apify#pushdata) is a helper function that saves data to the default [`Dataset`](/docs/api/dataset). `Dataset` is a
+[`Apify.pushData()`](../api/apify#pushdata) is a helper function that saves data to the default [`Dataset`](../api/dataset). `Dataset` is a
storage designed to hold virtually unlimited amount of data in a format similar to a table. Each time you call `Apify.pushData()` a new row in the
table is created, with the property names serving as column titles.
@@ -1524,7 +1524,7 @@ actor code.
#### Meet the `INPUT`
`INPUT` is just a convention on how we call the actor's input. Because there's no magic in actors, just features, the `INPUT` is actually nothing more
-than a key in the default [`KeyValueStore`](/docs/api/key-value-store) that's, by convention, used as input on Apify Platform. Also by convention, the
+than a key in the default [`KeyValueStore`](../api/key-value-store) that's, by convention, used as input on Apify Platform. Also by convention, the
`INPUT` is mostly expected to be of `Content-Type: application/json`.
We will not go into `KeyValueStore` details here, but for the sake of `INPUT` you need to remember that there is a function that helps you get it.
@@ -1534,7 +1534,7 @@ const input = await Apify.getInput();
```
On the Apify Platform, the actor's input that you can set in the Console is automatically saved to the default `KeyValueStore` under the key `INPUT`
-and by calling [`Apify.getInput()`](/docs/api/apify#getvalue) you retrieve the value from the `KeyValueStore`.
+and by calling [`Apify.getInput()`](../api/apify#getvalue) you retrieve the value from the `KeyValueStore`.
Running locally, you need to place an `INPUT.json` file in your default key value store for this to work.
@@ -1720,7 +1720,7 @@ your logic separate. Less code in a single file means less code you need to thin
#### Using `Apify.utils.log` instead of `console.log`
-We wont go into great lengths here to talk about `utils.log` here, because you can read [it all in the documentation](/docs/api/log), but there's just
+We wont go into great lengths here to talk about `utils.log` here, because you can read [it all in the documentation](../api/log), but there's just
one thing that we need to stress: **log levels**.
`utils.log` enables you to use different log levels, such as `log.debug`, `log.info` or `log.warning`. It not only makes your log more readable, but
diff --git a/docs/guides/proxy_management.md b/docs/guides/proxy_management.md
index 3d1c3f6b0..77d4420ad 100644
--- a/docs/guides/proxy_management.md
+++ b/docs/guides/proxy_management.md
@@ -17,7 +17,7 @@ for your scraping needs.
If you already subscribed to Apify Proxy or have proxy URLs of your own, you can start using
them immediately in only a few lines of code.
-> If you want to use Apify Proxy, make sure that your [scraper is logged in](/docs/guides/apify-platform).
+> If you want to use Apify Proxy, make sure that your [scraper is logged in](../guides/apify-platform).
<!--DOCUSAURUS_CODE_TABS-->
@@ -42,14 +42,14 @@ const proxyUrl = proxyConfiguration.newUrl();
<!--END_DOCUSAURUS_CODE_TABS-->
## Proxy Configuration
-All your proxy needs are managed by the [`ProxyConfiguration`](/docs/api/proxy-configuration) class.
-You create an instance using the [`Apify.createProxyConfiguration()`](/docs/api/apify#createproxyconfiguration)
-function. See the [`ProxyConfigurationOptions`](/docs/typedefs/proxy-configuration-options) for all
+All your proxy needs are managed by the [`ProxyConfiguration`](../api/proxy-configuration) class.
+You create an instance using the [`Apify.createProxyConfiguration()`](../api/apify#createproxyconfiguration)
+function. See the [`ProxyConfigurationOptions`](../typedefs/proxy-configuration-options) for all
the possible constructor options.
### Crawler integration
-`ProxyConfiguration` integrates seamlessly into [`CheerioCrawler`](/docs/api/cheerio-crawler)
-and [`PuppeteerCrawler`](/docs/api/puppeteer-crawler).
+`ProxyConfiguration` integrates seamlessly into [`CheerioCrawler`](../api/cheerio-crawler)
+and [`PuppeteerCrawler`](../api/puppeteer-crawler).
<!--DOCUSAURUS_CODE_TABS-->
@@ -77,12 +77,12 @@ const crawler = new Apify.PuppeteerCrawler({
Your crawlers will now use the selected proxies for all connections.
### IP Rotation and session management
-[`proxyConfiguration.newUrl()`](/docs/api/proxy-configuration#newurl) allows you to pass
+[`proxyConfiguration.newUrl()`](../api/proxy-configuration#newurl) allows you to pass
a `sessionId` parameter. It will then be used to create a `sessionId`-`proxyUrl` pair,
and subsequent `newUrl()` calls with the same `sessionId` will always return the same
`proxyUrl`. This is extremely useful in scraping, because you want to create the impression
-of a real user. See the [session management guide](/docs/guides/session-management) and
-[`SessionPool`](/docs/api/session-pool) class for more information on how keeping
+of a real user. See the [session management guide](../guides/session-management) and
+[`SessionPool`](../api/session-pool) class for more information on how keeping
a real session helps you avoid blocking.
When no `sessionId` is provided, your proxy URLs are rotated round-robin, whereas
@@ -121,8 +121,8 @@ that allows connection through millions of different IP addresses. So the class
essentially has two modes: Apify Proxy or Your proxy.
The difference is easy to remember.
-[`ProxyConfigurationOptions.proxyUrls`](/docs/typedefs/proxy-configuration-options#proxyurls) and
-[`ProxyConfigurationOptions.newUrlFunction`](/docs/typedefs/proxy-configuration-options#newurlfunction)
+[`ProxyConfigurationOptions.proxyUrls`](../typedefs/proxy-configuration-options#proxyurls) and
+[`ProxyConfigurationOptions.newUrlFunction`](../typedefs/proxy-configuration-options#newurlfunction)
enable use of your custom proxy URLs, whereas all the other options are there to configure Apify Proxy.
Visit the [Apify Proxy docs](https://docs.apify.com/proxy) for more info on how these parameters work.
@@ -144,6 +144,6 @@ in the [proxy dashboard](https://my.apify.com/proxy).
## Inspecting current proxy in Crawlers
`CheerioCrawler` and `PuppeteerCrawler` grant access to information about the currently used proxy
-in their `handlePageFunction` using a [`proxyInfo`](/docs/typedefs/proxy-info) object.
+in their `handlePageFunction` using a [`proxyInfo`](../typedefs/proxy-info) object.
With the object, you can easily access the proxy URL. If you're using Apify Proxy, the other
configuration parameters will also be available in the `proxyInfo` object.
diff --git a/docs/guides/quick_start.md b/docs/guides/quick_start.md
index 7a7748660..5d18a5b1d 100644
--- a/docs/guides/quick_start.md
+++ b/docs/guides/quick_start.md
@@ -4,7 +4,7 @@ title: Quick Start
---
This short tutorial will set you up to start using Apify SDK in a minute or two.
-If you want to learn more, proceed to the [Getting Started](/docs/guides/getting-started)
+If you want to learn more, proceed to the [Getting Started](../guides/getting-started)
tutorial that will take you step by step through creating your first scraper.
## Local stand-alone usage
@@ -16,7 +16,7 @@ npm install apify --save
```
Run the following example to perform a recursive crawl of a website using Puppeteer. For more examples showcasing various features of the Apify SDK,
-[see the Examples section of the documentation](/docs/examples/basic-crawler).
+[see the Examples section of the documentation](../examples/basic-crawler).
```javascript
const Apify = require('apify');
@@ -51,13 +51,13 @@ When you run the example, you should see Apify SDK automating a Chrome browser.
![Chrome Scrape](/img/chrome_scrape.gif)
By default, Apify SDK stores data to `./apify_storage` in the current working directory. You can override this behavior by setting either the
-`APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variable. For details, see [Environment variables](/docs/guides/environment-variables) and
-[Data storage](/docs/guides/data-storage).
+`APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variable. For details, see [Environment variables](../guides/environment-variables) and
+[Data storage](../guides/data-storage).
## Local usage with Apify command-line interface (CLI)
To avoid the need to set the environment variables manually, to create a boilerplate of your project, and to enable pushing and running your code on
-the [Apify platform](/docs/guides/apify-platform), you can use the [Apify command-line interface (CLI)](https://github.com/apify/apify-cli) tool.
+the [Apify platform](../guides/apify-platform), you can use the [Apify command-line interface (CLI)](https://github.com/apify/apify-cli) tool.
Install the CLI by running:
@@ -99,7 +99,7 @@ Your script will be uploaded to the Apify platform and built there so that it ca
## Usage on the Apify platform
-You can also develop your web scraping project in an online code editor directly on the [Apify platform](/docs/guides/apify-platform).
+You can also develop your web scraping project in an online code editor directly on the [Apify platform](../guides/apify-platform).
You'll need to have an Apify Account. Go to [Actors](https://my.apify.com/actors), page in the app, click <i>Create new</i>
and then go to the <i>Source</i> tab and start writing your code or paste one of the examples from the Examples section.
diff --git a/docs/guides/session_management.md b/docs/guides/session_management.md
index d654b8913..0633131fe 100644
--- a/docs/guides/session_management.md
+++ b/docs/guides/session_management.md
@@ -2,7 +2,7 @@
id: session-management
title: Session Management
---
-[`SessionPool`](/docs/api/session-pool) is a class that allows you to handle the rotation of proxy IP addresses along with cookies and other custom settings in Apify SDK.
+[`SessionPool`](../api/session-pool) is a class that allows you to handle the rotation of proxy IP addresses along with cookies and other custom settings in Apify SDK.
The main benefit of a Session pool is that you can filter out blocked or non-working proxies,
so your actor does not retry requests over known blocked/non-working proxies.
@@ -13,7 +13,7 @@ which should prevent burning out a small pool of available IPs.
Now let's take a look at how to use a Session pool.
-**Example usage in [`PuppeteerCrawler`](/docs/api/puppeteer-crawler)**
+**Example usage in [`PuppeteerCrawler`](../api/puppeteer-crawler)**
```javascript
@@ -47,7 +47,7 @@ const crawler = new Apify.PuppeteerCrawler({
});
```
-**Example usage in [`CheerioCrawler`](/docs/api/cheerio-crawler)**
+**Example usage in [`CheerioCrawler`](../api/cheerio-crawler)**
```javascript
const proxyConfiguration = await Apify.createProxyConfiguration();
@@ -80,7 +80,7 @@ const crawler = new Apify.PuppeteerCrawler({
});
```
-**Example usage in [`BasicCrawler`](/docs/api/basic-crawler)**
+**Example usage in [`BasicCrawler`](../api/basic-crawler)**
```javascript
const proxyConfiguration = await Apify.createProxyConfiguration();
diff --git a/src/cache_container.js b/src/cache_container.js
index 0ee69669c..e08e6cc02 100644
--- a/src/cache_container.js
+++ b/src/cache_container.js
@@ -6,7 +6,7 @@ import * as LruCache from 'apify-shared/lru_cache';
* created as module scoped globals - untouchable. This proved problematic
* especially in tests, where caches would prevent test separation.
* @property {Map<string, LruCache>} caches
- * @private
+ * @ignore
*/
class CacheContainer {
constructor() {
diff --git a/src/crawlers/browser_crawler.js b/src/crawlers/browser_crawler.js
index 8e780c063..65c3540c6 100644
--- a/src/crawlers/browser_crawler.js
+++ b/src/crawlers/browser_crawler.js
@@ -159,6 +159,7 @@ import {
* If set to true. Basic crawler will initialize the {@link SessionPool} with the corresponding `sessionPoolOptions`.
* The session instance will be than available in the `handleRequestFunction`.
* @property {SessionPoolOptions} [sessionPoolOptions] The configuration options for {@link SessionPool} to use.
+ * @ignore
*/
/**
@@ -194,31 +195,6 @@ import {
*
* Note that the pool of browser instances is internally managed by the {@link BrowserPool} class.
*
- * **Example usage:**
- * @TODO:
- * ```javascript
- * const crawler = new Apify.PuppeteerCrawler({
- * requestList,
- * handlePageFunction: async ({ page, request }) => {
- * // This function is called to extract data from a single web page
- * // 'page' is an instance of Puppeteer.Page with page.goto(request.url) already called
- * // 'request' is an instance of Request class with information about the page to load
- * await Apify.pushData({
- * title: await page.title(),
- * url: request.url,
- * succeeded: true,
- * })
- * },
- * handleFailedRequestFunction: async ({ request }) => {
- * // This function is called when the crawling of a request failed too many times
- * await Apify.pushData({
- * url: request.url,
- * succeeded: false,
- * errors: request.errorMessages,
- * })
- * },
- * });
- *
* await crawler.run();
* ```
* @property {Statistics} stats
@@ -244,6 +220,7 @@ import {
* You can use it to change the concurrency settings on the fly,
* to pause the crawler by calling {@link AutoscaledPool#pause}
* or to abort it by calling {@link AutoscaledPool#abort}.
+ * @ignore
*/
class BrowserCrawler extends BasicCrawler {
static optionsShape = {
diff --git a/src/crawlers/crawler_extension.js b/src/crawlers/crawler_extension.js
index 5ac5602c9..6c5626ae1 100644
--- a/src/crawlers/crawler_extension.js
+++ b/src/crawlers/crawler_extension.js
@@ -2,6 +2,7 @@ import defaultLog from '../utils_log';
/**
* Abstract class with pre-defined method to connect to the Crawlers class by the "use" crawler method.
+ * @ignore
*/
export default class CrawlerExtension {
constructor() {
diff --git a/src/crawlers/statistics.js b/src/crawlers/statistics.js
index 545d5c19f..f525e128a 100644
--- a/src/crawlers/statistics.js
+++ b/src/crawlers/statistics.js
@@ -6,7 +6,7 @@ import defaultLog from '../utils_log';
import events from '../events';
/**
- * @private
+ * @ignore
*/
class Job {
constructor() {
diff --git a/src/main.js b/src/main.js
index 2446d49c4..1c47dd6b9 100644
--- a/src/main.js
+++ b/src/main.js
@@ -43,12 +43,12 @@ const exportedUtils = Object.assign(publicUtils, {
* The following section describes all functions and properties provided by the `apify` package,
* except individual classes and namespaces that have their separate, detailed, documentation pages
* accessible from the left sidebar. To learn how Apify SDK works, we suggest following
- * the [Getting Started](/docs/guides/getting-started) tutorial.
+ * the [Getting Started](../guides/getting-started) tutorial.
*
* **Important:**
* > The following functions: `addWebhook`, `call`, `callTask` and `newClient` invoke features of the
- * > [Apify platform](/docs/guides/apify-platform) and require your scripts to be authenticated.
- * > See the [authentication guide](/docs/guides/apify-platform#logging-into-apify-platform-from-apify-sdk) for instructions.
+ * > [Apify platform](../guides/apify-platform) and require your scripts to be authenticated.
+ * > See the [authentication guide](../guides/apify-platform#logging-into-apify-platform-from-apify-sdk) for instructions.
*
* @module Apify
*/
diff --git a/src/session_pool/errors.js b/src/session_pool/errors.js
index 5fcefc3a1..46d9c195c 100644
--- a/src/session_pool/errors.js
+++ b/src/session_pool/errors.js
@@ -1,3 +1,6 @@
+/**
+ * @ignore
+ */
export class CookieParseError extends Error {
/**
* @param {string} cookieHeaderString
diff --git a/src/session_pool/session_pool.js b/src/session_pool/session_pool.js
index c679342b6..2b021d5f4 100644
--- a/src/session_pool/session_pool.js
+++ b/src/session_pool/session_pool.js
@@ -29,7 +29,7 @@ import { ACTOR_EVENT_NAMES_EX } from '../constants';
* Handles the rotation, creation and persistence of user-like sessions.
* Creates a pool of {@link Session} instances, that are randomly rotated.
* When some session is marked as blocked. It is removed and new one is created instead.
- * Learn more in the [`Session management guide`](/docs/guides/session-management).
+ * Learn more in the [`Session management guide`](../guides/session-management).
*
* You can create one by calling the {@link Apify.openSessionPool} function.
*
diff --git a/src/storages/key_value_store.js b/src/storages/key_value_store.js
index 4b18b9ea9..fe421c0e7 100644
--- a/src/storages/key_value_store.js
+++ b/src/storages/key_value_store.js
@@ -56,8 +56,8 @@ export const maybeStringify = (value, options) => {
* To access the input, you can also use the {@link Apify#getInput} convenience function.
*
* `KeyValueStore` stores its data either on local disk or in the Apify cloud,
- * depending on whether the [`APIFY_LOCAL_STORAGE_DIR`](/docs/guides/environment-variables#apify_local_storage_dir)
- * or [`APIFY_TOKEN`](/docs/guides/environment-variables#apify_token) environment variables are set.
+ * depending on whether the [`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir)
+ * or [`APIFY_TOKEN`](../guides/environment-variables#apify_token) environment variables are set.
*
* If the `APIFY_LOCAL_STORAGE_DIR` environment variable is set, the data is stored in
* the local directory in the following files:
@@ -68,12 +68,12 @@ export const maybeStringify = (value, options) => {
* unless you override it by setting the `APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable.
* The `{KEY}` is the key of the record and `{EXT}` corresponds to the MIME content type of the data value.
*
- * If the [`APIFY_TOKEN`](/docs/guides/environment-variables#apify_token) environment variable is set but
- * [`APIFY_LOCAL_STORAGE_DIR`](/docs/guides/environment-variables#apify_local_storage_dir) not,
+ * If the [`APIFY_TOKEN`](../guides/environment-variables#apify_token) environment variable is set but
+ * [`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir) not,
* the data is stored in the [Apify Key-value store](https://docs.apify.com/storage/key-value-store)
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
* option to {@link Apify#openKeyValueStore} function, even if the
- * [`APIFY_LOCAL_STORAGE_DIR`](/docs/guides/environment-variables#apify_local_storage_dir) variable is set.
+ * [`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir) variable is set.
*
* **Example usage:**
*
diff --git a/src/storages/storage_manager.js b/src/storages/storage_manager.js
index ba842f37a..44ba282f0 100644
--- a/src/storages/storage_manager.js
+++ b/src/storages/storage_manager.js
@@ -15,7 +15,7 @@ const MAX_OPENED_STORAGES = 1000;
* @property {Function} StorageConstructor
* @property {string} name
* @property {LruCache} cache
- * @private
+ * @ignore
*/
class StorageManager {
/**
diff --git a/website/i18n/en.json b/website/i18n/en.json
index 26ad38741..3e9a6f150 100644
--- a/website/i18n/en.json
+++ b/website/i18n/en.json
@@ -17,33 +17,21 @@
"api/basic-crawler": {
"title": "BasicCrawler"
},
- "api/browser-crawler": {
- "title": "BrowserCrawler"
- },
- "api/cache-container": {
- "title": "CacheContainer"
- },
"api/cheerio-crawler": {
"title": "CheerioCrawler"
},
- "api/cookie-parse-error": {
- "title": "CookieParseError"
- },
"api/dataset": {
"title": "Dataset"
},
- "api/exports": {
- "title": "exports"
- },
- "api/job": {
- "title": "Job"
- },
"api/key-value-store": {
"title": "KeyValueStore"
},
"api/log": {
"title": "utils.log"
},
+ "api/playwright-crawler": {
+ "title": "PlaywrightCrawler"
+ },
"api/proxy-configuration": {
"title": "ProxyConfiguration"
},
@@ -80,9 +68,6 @@
"api/statistics": {
"title": "Statistics"
},
- "api/storage-manager": {
- "title": "StorageManager"
- },
"api/system-status": {
"title": "SystemStatus"
},
@@ -203,9 +188,6 @@
"typedefs/basic-crawler-options": {
"title": "BasicCrawlerOptions"
},
- "typedefs/browser-crawler-options": {
- "title": "BrowserCrawlerOptions"
- },
"typedefs/cheerio-crawler-options": {
"title": "CheerioCrawlerOptions"
},
@@ -248,15 +230,18 @@
"typedefs/key-consumer": {
"title": "KeyConsumer"
},
- "typedefs/launch-puppeteer-options": {
- "title": "LaunchPuppeteerOptions"
- },
"typedefs/logger-options": {
"title": "LoggerOptions"
},
"typedefs/memory-info": {
"title": "MemoryInfo"
},
+ "typedefs/playwright-crawler-options": {
+ "title": "PlaywrightCrawlerOptions"
+ },
+ "typedefs/playwright-launch-context": {
+ "title": "PlaywrightLaunchContext"
+ },
"typedefs/post-response": {
"title": "PostResponse"
},
@@ -278,6 +263,9 @@
"typedefs/puppeteer-crawler-options": {
"title": "PuppeteerCrawlerOptions"
},
+ "typedefs/puppeteer-launch-context": {
+ "title": "PuppeteerLaunchContext"
+ },
"typedefs/queue-operation-info": {
"title": "QueueOperationInfo"
},
@@ -331,6 +319,366 @@
},
"typedefs/user-func": {
"title": "UserFunc"
+ },
+ "version-0.22.4/api/version-0.22.4-apify": {
+ "title": "Apify"
+ },
+ "version-0.22.4/api/version-0.22.4-apify-call-error": {
+ "title": "ApifyCallError"
+ },
+ "version-0.22.4/api/version-0.22.4-autoscaled-pool": {
+ "title": "AutoscaledPool"
+ },
+ "version-0.22.4/api/version-0.22.4-basic-crawler": {
+ "title": "BasicCrawler"
+ },
+ "version-0.22.4/api/version-0.22.4-browser-crawler": {
+ "title": "BrowserCrawler"
+ },
+ "version-0.22.4/api/version-0.22.4-cache-container": {
+ "title": "CacheContainer"
+ },
+ "version-0.22.4/api/version-0.22.4-cheerio-crawler": {
+ "title": "CheerioCrawler"
+ },
+ "version-0.22.4/api/version-0.22.4-cookie-parse-error": {
+ "title": "CookieParseError"
+ },
+ "version-0.22.4/api/version-0.22.4-dataset": {
+ "title": "Dataset"
+ },
+ "version-0.22.4/api/version-0.22.4-exports": {
+ "title": "exports"
+ },
+ "version-0.22.4/api/version-0.22.4-global-cache": {
+ "title": "GlobalCache"
+ },
+ "version-0.22.4/api/version-0.22.4-job": {
+ "title": "Job"
+ },
+ "version-0.22.4/api/version-0.22.4-key-value-store": {
+ "title": "KeyValueStore"
+ },
+ "version-0.22.4/api/version-0.22.4-live-view-server": {
+ "title": "LiveViewServer"
+ },
+ "version-0.22.4/api/version-0.22.4-log": {
+ "title": "utils.log"
+ },
+ "version-0.22.4/api/version-0.22.4-playwright-crawler": {
+ "title": "PlaywrightCrawler"
+ },
+ "version-0.22.4/api/version-0.22.4-proxy-configuration": {
+ "title": "ProxyConfiguration"
+ },
+ "version-0.22.4/api/version-0.22.4-pseudo-url": {
+ "title": "PseudoUrl"
+ },
+ "version-0.22.4/api/version-0.22.4-puppeteer": {
+ "title": "utils.puppeteer"
+ },
+ "version-0.22.4/api/version-0.22.4-puppeteer-crawler": {
+ "title": "PuppeteerCrawler"
+ },
+ "version-0.22.4/api/version-0.22.4-puppeteer-pool": {
+ "title": "PuppeteerPool"
+ },
+ "version-0.22.4/api/version-0.22.4-request": {
+ "title": "Request"
+ },
+ "version-0.22.4/api/version-0.22.4-request-list": {
+ "title": "RequestList"
+ },
+ "version-0.22.4/api/version-0.22.4-request-queue": {
+ "title": "RequestQueue"
+ },
+ "version-0.22.4/api/version-0.22.4-session": {
+ "title": "Session"
+ },
+ "version-0.22.4/api/version-0.22.4-session-pool": {
+ "title": "SessionPool"
+ },
+ "version-0.22.4/api/version-0.22.4-snapshotter": {
+ "title": "Snapshotter"
+ },
+ "version-0.22.4/api/version-0.22.4-social": {
+ "title": "utils.social"
+ },
+ "version-0.22.4/api/version-0.22.4-statistics": {
+ "title": "Statistics"
+ },
+ "version-0.22.4/api/version-0.22.4-storage-manager": {
+ "title": "StorageManager"
+ },
+ "version-0.22.4/api/version-0.22.4-system-status": {
+ "title": "SystemStatus"
+ },
+ "version-0.22.4/api/version-0.22.4-utils": {
+ "title": "utils"
+ },
+ "version-0.22.4/examples/version-0.22.4-accept-user-input": {
+ "title": "Accept user input"
+ },
+ "version-0.22.4/examples/version-0.22.4-add-data-to-dataset": {
+ "title": "Add data to dataset"
+ },
+ "version-0.22.4/examples/version-0.22.4-basic-crawler": {
+ "title": "Basic crawler"
+ },
+ "version-0.22.4/examples/version-0.22.4-call-actor": {
+ "title": "Call actor"
+ },
+ "version-0.22.4/examples/version-0.22.4-capture-screenshot": {
+ "title": "Capture a screenshot"
+ },
+ "version-0.22.4/examples/version-0.22.4-cheerio-crawler": {
+ "title": "Cheerio crawler"
+ },
+ "version-0.22.4/examples/version-0.22.4-crawl-all-links": {
+ "title": "Crawl all links on a website"
+ },
+ "version-0.22.4/examples/version-0.22.4-crawl-multiple-urls": {
+ "title": "Crawl multiple URLs"
+ },
+ "version-0.22.4/examples/version-0.22.4-crawl-relative-links": {
+ "title": "Crawl a website with relative links"
+ },
+ "version-0.22.4/examples/version-0.22.4-crawl-single-url": {
+ "title": "Crawl a single URL"
+ },
+ "version-0.22.4/examples/version-0.22.4-crawl-sitemap": {
+ "title": "Crawl a sitemap"
+ },
+ "version-0.22.4/examples/version-0.22.4-crawl-some-links": {
+ "title": "Crawl some links on a website"
+ },
+ "version-0.22.4/examples/version-0.22.4-forms": {
+ "title": "Forms"
+ },
+ "version-0.22.4/examples/version-0.22.4-handle-broken-links": {
+ "title": "Handle broken links"
+ },
+ "version-0.22.4/examples/version-0.22.4-map-and-reduce": {
+ "title": "Dataset Map and Reduce methods"
+ },
+ "version-0.22.4/examples/version-0.22.4-puppeteer-crawler": {
+ "title": "Puppeteer crawler"
+ },
+ "version-0.22.4/examples/version-0.22.4-puppeteer-recursive-crawl": {
+ "title": "Puppeteer recursive crawl"
+ },
+ "version-0.22.4/examples/version-0.22.4-puppeteer-sitemap": {
+ "title": "Puppeteer sitemap"
+ },
+ "version-0.22.4/examples/version-0.22.4-puppeteer-with-proxy": {
+ "title": "Puppeteer with proxy"
+ },
+ "version-0.22.4/examples/version-0.22.4-screenshots": {
+ "title": "Screenshots"
+ },
+ "version-0.22.4/examples/version-0.22.4-synchronous-run": {
+ "title": "Synchronous run"
+ },
+ "version-0.22.4/guides/version-0.22.4-apify-platform": {
+ "title": "Apify Platform"
+ },
+ "version-0.22.4/guides/version-0.22.4-data-storage": {
+ "title": "Data Storage"
+ },
+ "version-0.22.4/guides/version-0.22.4-environment-variables": {
+ "title": "Environment Variables"
+ },
+ "version-0.22.4/guides/version-0.22.4-getting-started": {
+ "title": "Getting Started"
+ },
+ "version-0.22.4/guides/version-0.22.4-motivation": {
+ "title": "Motivation"
+ },
+ "version-0.22.4/guides/version-0.22.4-proxy-management": {
+ "title": "Proxy Management"
+ },
+ "version-0.22.4/guides/version-0.22.4-quick-start": {
+ "title": "Quick Start"
+ },
+ "version-0.22.4/guides/version-0.22.4-session-management": {
+ "title": "Session Management"
+ },
+ "version-0.22.4/guides/version-0.22.4-type-script-actor": {
+ "title": "TypeScript Actors"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-abort-function": {
+ "title": "AbortFunction"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-actor-run": {
+ "title": "ActorRun"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-apify-env": {
+ "title": "ApifyEnv"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-autoscaled-pool-options": {
+ "title": "AutoscaledPoolOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-basic-crawler-options": {
+ "title": "BasicCrawlerOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-browser-crawler-options": {
+ "title": "BrowserCrawlerOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-cheerio-crawler-options": {
+ "title": "CheerioCrawlerOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-cheerio-handle-page": {
+ "title": "CheerioHandlePage"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-cheerio-handle-page-inputs": {
+ "title": "CheerioHandlePageInputs"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-create-session": {
+ "title": "CreateSession"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-dataset-consumer": {
+ "title": "DatasetConsumer"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-dataset-content": {
+ "title": "DatasetContent"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-dataset-mapper": {
+ "title": "DatasetMapper"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-dataset-reducer": {
+ "title": "DatasetReducer"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-handle-failed-request": {
+ "title": "HandleFailedRequest"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-handle-failed-request-input": {
+ "title": "HandleFailedRequestInput"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-handle-request": {
+ "title": "HandleRequest"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-handle-request-inputs": {
+ "title": "HandleRequestInputs"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-intercept-handler": {
+ "title": "InterceptHandler"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-key-consumer": {
+ "title": "KeyConsumer"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-launch-puppeteer": {
+ "title": "LaunchPuppeteer"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-launch-puppeteer-function": {
+ "title": "LaunchPuppeteerFunction"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-launch-puppeteer-options": {
+ "title": "LaunchPuppeteerOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-logger-options": {
+ "title": "LoggerOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-memory-info": {
+ "title": "MemoryInfo"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-playwright-crawler-options": {
+ "title": "PlaywrightCrawlerOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-playwright-launch-context": {
+ "title": "PlaywrightLaunchContext"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-post-response": {
+ "title": "PostResponse"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-post-response-inputs": {
+ "title": "PostResponseInputs"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-prepare-request": {
+ "title": "PrepareRequest"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-prepare-request-inputs": {
+ "title": "PrepareRequestInputs"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-proxy-configuration-options": {
+ "title": "ProxyConfigurationOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-proxy-info": {
+ "title": "ProxyInfo"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-puppeteer-crawler-options": {
+ "title": "PuppeteerCrawlerOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-puppeteer-goto": {
+ "title": "PuppeteerGoto"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-puppeteer-goto-inputs": {
+ "title": "PuppeteerGotoInputs"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-puppeteer-handle-page": {
+ "title": "PuppeteerHandlePage"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-puppeteer-handle-page-inputs": {
+ "title": "PuppeteerHandlePageInputs"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-puppeteer-launch-context": {
+ "title": "PuppeteerLaunchContext"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-puppeteer-pool-options": {
+ "title": "PuppeteerPoolOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-queue-operation-info": {
+ "title": "QueueOperationInfo"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-request-as-browser-options": {
+ "title": "RequestAsBrowserOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-request-list-options": {
+ "title": "RequestListOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-request-list-state": {
+ "title": "RequestListState"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-request-options": {
+ "title": "RequestOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-request-queue-info": {
+ "title": "RequestQueueInfo"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-request-transform": {
+ "title": "RequestTransform"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-session-options": {
+ "title": "SessionOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-session-pool-options": {
+ "title": "SessionPoolOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-session-state": {
+ "title": "SessionState"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-snapshotter-options": {
+ "title": "SnapshotterOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-social-handles": {
+ "title": "SocialHandles"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-statistic-persisted-state": {
+ "title": "StatisticPersistedState"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-statistic-state": {
+ "title": "StatisticState"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-stealth-options": {
+ "title": "StealthOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-system-info": {
+ "title": "SystemInfo"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-system-status-options": {
+ "title": "SystemStatusOptions"
+ },
+ "version-0.22.4/typedefs/version-0.22.4-user-func": {
+ "title": "UserFunc"
}
},
"links": {
diff --git a/website/pages/en/versions.js b/website/pages/en/versions.js
new file mode 100644
index 000000000..7cb5829de
--- /dev/null
+++ b/website/pages/en/versions.js
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+const React = require('react');
+
+const CompLibrary = require('../../core/CompLibrary');
+
+const Container = CompLibrary.Container;
+
+const CWD = process.cwd();
+
+const versions = require(`${CWD}/versions.json`);
+
+function Versions(props) {
+ const {config: siteConfig} = props;
+ const latestVersion = versions[0];
+ const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`;
+ return (
+ <div className="docMainWrapper wrapper">
+ <Container className="mainContainer versionsContainer">
+ <div className="post">
+ <header className="postHeader">
+ <h1>{siteConfig.title} Versions</h1>
+ </header>
+ <p>New versions of Apify SDK are released once a month or so. With major releases once a year.</p>
+ <h3 id="latest">Current version (Stable)</h3>
+ <table className="versions">
+ <tbody>
+ <tr>
+ <th>{latestVersion}</th>
+ <td>
+ {/* You are supposed to change this href where appropriate
+ Example: href="<baseUrl>/docs(/:language)/:id" */}
+ <a
+ href={`${siteConfig.baseUrl}${siteConfig.docsUrl}/${
+ props.language ? props.language + '/' : ''
+ }api/apify`}>
+ Documentation
+ </a>
+ </td>
+ <td>
+ <a href={`${repoUrl}/releases/tag/v${latestVersion}`}>Release Notes</a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <p>
+ This is the version that is configured automatically when you first
+ install Apify SDK.
+ </p>
+ <h3 id="rc">Pre-release versions</h3>
+ <table className="versions">
+ <tbody>
+ <tr>
+ <th>master</th>
+ <td>
+ {/* You are supposed to change this href where appropriate
+ Example: href="<baseUrl>/docs(/:language)/next/:id" */}
+ <a
+ href={`${siteConfig.baseUrl}${siteConfig.docsUrl}/${
+ props.language ? props.language + '/' : ''
+ }next/api/apify`}>
+ Documentation
+ </a>
+ </td>
+ <td>
+ <a href={repoUrl}>Source Code</a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <h3 id="archive">Past Versions</h3>
+ <p>Here you can find previous versions of the documentation.</p>
+ <table className="versions">
+ <tbody>
+ {versions.map(
+ (version) =>
+ version !== latestVersion && (
+ <tr key={version}>
+ <th>{version}</th>
+ <td>
+ {/* You are supposed to change this href where appropriate
+ Example: href="<baseUrl>/docs(/:language)/:version/:id" */}
+ <a
+ href={`${siteConfig.baseUrl}${siteConfig.docsUrl}/${
+ props.language ? props.language + '/' : ''
+ }${version}/api/apify`}>
+ Documentation
+ </a>
+ </td>
+ <td>
+ <a href={`${repoUrl}/releases/tag/v${version}`}>
+ Release Notes
+ </a>
+ </td>
+ </tr>
+ ),
+ )}
+ </tbody>
+ </table>
+ <p>
+ You can find past versions of this project on{' '}
+ <a href={repoUrl}>GitHub</a>.
+ </p>
+ </div>
+ </Container>
+ </div>
+ );
+}
+
+module.exports = Versions;
diff --git a/website/sidebars.json b/website/sidebars.json
index da1dc06fc..1dc42b57b 100644
--- a/website/sidebars.json
+++ b/website/sidebars.json
@@ -42,6 +42,7 @@
"ids": [
"api/basic-crawler",
"api/cheerio-crawler",
+ "api/playwright-crawler",
"api/puppeteer-crawler"
]
},
@@ -58,7 +59,6 @@
"label": "Scaling",
"ids": [
"api/autoscaled-pool",
- "api/puppeteer-pool",
"api/session",
"api/session-pool",
"api/proxy-configuration",
@@ -95,12 +95,13 @@
"typedefs/autoscaled-pool-options",
"typedefs/basic-crawler-options",
"typedefs/cheerio-crawler-options",
+ "typedefs/playwright-crawler-options",
+ "typedefs/playwright-launch-context",
"typedefs/puppeteer-crawler-options",
- "typedefs/puppeteer-pool-options",
+ "typedefs/puppeteer-launch-context",
"typedefs/proxy-configuration-options",
"typedefs/proxy-info",
"typedefs/logger-options",
- "typedefs/launch-puppeteer-options",
"typedefs/request-options",
"typedefs/request-list-options",
"typedefs/request-as-browser-options",
@@ -123,11 +124,10 @@
"typedefs/handle-request-inputs",
"typedefs/prepare-request",
"typedefs/prepare-request-inputs",
+ "typedefs/playwright-handle-page",
+ "typedefs/playwright-handle-page-inputs",
"typedefs/puppeteer-handle-page",
- "typedefs/puppeteer-handle-page-inputs",
- "typedefs/launch-puppeteer",
- "typedefs/puppeteer-goto",
- "typedefs/puppeteer-goto-inputs"
+ "typedefs/puppeteer-handle-page-inputs"
]
},
{
diff --git a/website/tools/build_docs.js b/website/tools/build_docs.js
index 40624affa..2319cac14 100644
--- a/website/tools/build_docs.js
+++ b/website/tools/build_docs.js
@@ -8,7 +8,7 @@ const prettierConfig = require('./prettier.config');
const sidebars = require('../sidebars.json');
const { readStreamToString } = require('apify-shared/streams_utilities'); // eslint-disable-line
-const BASE_URL = '/docs';
+const BASE_URL = '..';
const DOCS_DIR = path.join(__dirname, '..', '..', 'docs');
const EXAMPLES_DIR_NAME = path.join(DOCS_DIR, 'examples');
const EXAMPLES_REPO = 'https://api.github.com/repos/apify/actor-templates/contents/dist/examples';
@@ -174,15 +174,15 @@ const main = async () => {
/* reduce templateData to an array of class names */
templateData.forEach((identifier) => {
- if (identifier.kind === 'class' && !identifier.ignore) {
+ if (identifier.kind === 'class' && !identifier.ignore && !identifier.private) {
classNames.push(identifier.name);
if (identifier.hideconstructor) {
const idx = templateData.findIndex(i => i.id === `${identifier.name}()`);
templateData[idx] = EMPTY;
}
}
- if (identifier.kind === 'namespace' && !identifier.ignore) namespaces.push(identifier.name);
- if (identifier.kind === 'typedef' && !identifier.ignore) typedefs.push(identifier.name);
+ if (identifier.kind === 'namespace' && !identifier.ignore && !identifier.private) namespaces.push(identifier.name);
+ if (identifier.kind === 'typedef' && !identifier.ignore && !identifier.private) typedefs.push(identifier.name);
});
templateData = templateData.filter(d => d !== EMPTY);
diff --git a/website/versioned_docs/version-0.22.4/api/Apify.md b/website/versioned_docs/version-0.22.4/api/Apify.md
new file mode 100644
index 000000000..587d3a11d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/Apify.md
@@ -0,0 +1,743 @@
+---
+id: version-0.22.4-apify
+title: Apify
+original_id: apify
+---
+
+<a name="apify"></a>
+
+The following section describes all functions and properties provided by the `apify` package, except individual classes and namespaces that have their
+separate, detailed, documentation pages accessible from the left sidebar. To learn how Apify SDK works, we suggest following the
+[Getting Started](../guides/getting-started) tutorial.
+
+**Important:**
+
+> The following functions: `addWebhook`, `call`, `callTask` and `newClient` invoke features of the [Apify platform](../guides/apify-platform) and
+> require your scripts to be authenticated. See the [authentication guide](../guides/apify-platform#logging-into-apify-platform-from-apify-sdk) for
+> instructions.
+
+---
+
+<a name="addwebhook"></a>
+
+## `Apify.addWebhook(options)`
+
+Creates an ad-hoc webhook for the current actor run, which lets you receive a notification when the actor run finished or failed. For more information
+about Apify actor webhooks, please see the [documentation](https://docs.apify.com/webhooks).
+
+Note that webhooks are only supported for actors running on the Apify platform. In local environment, the function will print a warning and have no
+effect.
+
+**Parameters**:
+
+- **`options`**: `Object`
+ - **`eventTypes`**: `Array<string>` - Array of event types, which you can set for actor run, see the
+ [actor run events](https://docs.apify.com/webhooks/events#actor-run) in the Apify doc.
+ - **`requestUrl`**: `string` - URL which will be requested using HTTP POST request, when actor run will reach the set event type.
+ - **`[payloadTemplate]`**: `string` - Payload template is a JSON-like string that describes the structure of the webhook POST request payload.
+ It uses JSON syntax, extended with a double curly braces syntax for injecting variables `{{variable}}`. Those variables are resolved at the
+ time of the webhook's dispatch, and a list of available variables with their descriptions is available in the
+ [Apify webhook documentation](https://docs.apify.com/webhooks). If `payloadTemplate` is omitted, the default payload template is used
+ ([view docs](https://docs.apify.com/webhooks/actions#payload-template)).
+ - **`[idempotencyKey]`**: `string` - Idempotency key enables you to ensure that a webhook will not be added multiple times in case of an actor
+ restart or other situation that would cause the `addWebhook()` function to be called again. We suggest using the actor run ID as the
+ idempotency key. You can get the run ID by calling [`Apify.getEnv()`](../api/apify#getenv) function.
+
+**Returns**:
+
+`Promise<object>` - The return value is the Webhook object. For more information, see the
+[Get webhook](https://apify.com/docs/api/v2#/reference/webhooks/webhook-object/get-webhook) API endpoint.
+
+---
+
+<a name="call"></a>
+
+## `Apify.call(actId, [input], [options])`
+
+Runs an actor on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable), waits for the actor to
+finish and fetches its output.
+
+By passing the `waitSecs` option you can reduce the maximum amount of time to wait for the run to finish. If the value is less than or equal to zero,
+the function returns immediately after the run is started.
+
+The result of the function is an [`ActorRun`](../typedefs/actor-run) object that contains details about the actor run and its output (if any). If the
+actor run fails, the function throws the [`ApifyCallError`](../api/apify-call-error) exception.
+
+If you want to run an actor task rather than an actor, please use the [`Apify.callTask()`](../api/apify#calltask) function instead.
+
+For more information about actors, read the [documentation](https://docs.apify.com/actor).
+
+**Example usage:**
+
+```javascript
+const run = await Apify.call('apify/hello-world', { myInput: 123 });
+console.log(`Received message: ${run.output.body.message}`);
+```
+
+Internally, the `call()` function invokes the [Run actor](https://apify.com/docs/api/v2#/reference/actors/run-collection/run-actor) and several other
+API endpoints to obtain the output.
+
+**Throws**:
+
+- [`ApifyCallError`](../api/apify-call-error) If the run did not succeed, e.g. if it failed or timed out.
+
+**Parameters**:
+
+- **`actId`**: `string` - Allowed formats are `username/actor-name`, `userId/actor-name` or actor ID.
+- **`[input]`**: `object` - Input for the actor. If it is an object, it will be stringified to JSON and its content type set to
+ `application/json; charset=utf-8`. Otherwise the `options.contentType` parameter must be provided.
+- **`[options]`**: `Object` <code> = {}</code> - Object with the settings below:
+ - **`[contentType]`**: `string` - Content type for the `input`. If not specified, `input` is expected to be an object that will be stringified
+ to JSON and content type set to `application/json; charset=utf-8`. If `options.contentType` is specified, then `input` must be a `String` or
+ `Buffer`.
+ - **`[token]`**: `string` - User API token that is used to run the actor. By default, it is taken from the `APIFY_TOKEN` environment variable.
+ - **`[memoryMbytes]`**: `number` - Memory in megabytes which will be allocated for the new actor run. If not provided, the run uses memory of
+ the default actor run configuration.
+ - **`[timeoutSecs]`**: `number` - Timeout for the actor run in seconds. Zero value means there is no timeout. If not provided, the run uses
+ timeout of the default actor run configuration.
+ - **`[build]`**: `string` - Tag or number of the actor build to run (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or
+ number from the default actor run configuration (typically `latest`).
+ - **`[waitSecs]`**: `number` - Maximum time to wait for the actor run to finish, in seconds. If the limit is reached, the returned promise is
+ resolved to a run object that will have status `READY` or `RUNNING` and it will not contain the actor run output. If `waitSecs` is null or
+ undefined, the function waits for the actor to finish (default behavior).
+ - **`[fetchOutput]`**: `boolean` <code> = true</code> - If `false` then the function does not fetch output of the actor.
+ - **`[disableBodyParser]`**: `boolean` <code> = false</code> - If `true` then the function will not attempt to parse the actor's output and will
+ return it in a raw `Buffer`.
+ - **`[webhooks]`**: `Array<object>` - Specifies optional webhooks associated with the actor run, which can be used to receive a notification
+ e.g. when the actor finished or failed, see [ad hook webhooks documentation](https://docs.apify.com/webhooks/ad-hoc-webhooks) for detailed
+ description.
+
+**Returns**:
+
+[`Promise<ActorRun>`](../typedefs/actor-run)
+
+---
+
+<a name="calltask"></a>
+
+## `Apify.callTask(taskId, [input], [options])`
+
+Runs an actor task on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable), waits for the task to
+finish and fetches its output.
+
+By passing the `waitSecs` option you can reduce the maximum amount of time to wait for the run to finish. If the value is less than or equal to zero,
+the function returns immediately after the run is started.
+
+The result of the function is an [`ActorRun`](../typedefs/actor-run) object that contains details about the actor run and its output (if any). If the
+actor run failed, the function fails with [`ApifyCallError`](../api/apify-call-error) exception.
+
+Note that an actor task is a saved input configuration and options for an actor. If you want to run an actor directly rather than an actor task,
+please use the [`Apify.call()`](../api/apify#call) function instead.
+
+For more information about actor tasks, read the [documentation](https://docs.apify.com/tasks).
+
+**Example usage:**
+
+```javascript
+const run = await Apify.callTask('bob/some-task');
+console.log(`Received message: ${run.output.body.message}`);
+```
+
+Internally, the `callTask()` function calls the [Run task](https://apify.com/docs/api/v2#/reference/actor-tasks/run-collection/run-task) and several
+other API endpoints to obtain the output.
+
+**Throws**:
+
+- [`ApifyCallError`](../api/apify-call-error) If the run did not succeed, e.g. if it failed or timed out.
+
+**Parameters**:
+
+- **`taskId`**: `string` - Allowed formats are `username/task-name`, `userId/task-name` or task ID.
+- **`[input]`**: `object` - Input overrides for the actor task. If it is an object, it will be stringified to JSON and its content type set to
+ `application/json; charset=utf-8`. Provided input will be merged with actor task input.
+- **`[options]`**: `Object` <code> = {}</code> - Object with the settings below:
+ - **`[token]`**: `string` - User API token that is used to run the actor. By default, it is taken from the `APIFY_TOKEN` environment variable.
+ - **`[memoryMbytes]`**: `number` - Memory in megabytes which will be allocated for the new actor task run. If not provided, the run uses memory
+ of the default actor run configuration.
+ - **`[timeoutSecs]`**: `number` - Timeout for the actor task run in seconds. Zero value means there is no timeout. If not provided, the run uses
+ timeout of the default actor run configuration.
+ - **`[build]`**: `string` - Tag or number of the actor build to run (e.g. `beta` or `1.2.345`). If not provided, the run uses build tag or
+ number from the default actor run configuration (typically `latest`).
+ - **`[waitSecs]`**: `number` - Maximum time to wait for the actor task run to finish, in seconds. If the limit is reached, the returned promise
+ is resolved to a run object that will have status `READY` or `RUNNING` and it will not contain the actor run output. If `waitSecs` is null or
+ undefined, the function waits for the actor task to finish (default behavior).
+ - **`[webhooks]`**: `Array<object>` - Specifies optional webhooks associated with the actor run, which can be used to receive a notification
+ e.g. when the actor finished or failed, see [ad hook webhooks documentation](https://docs.apify.com/webhooks/ad-hoc-webhooks) for detailed
+ description.
+
+**Returns**:
+
+[`Promise<ActorRun>`](../typedefs/actor-run)
+
+---
+
+<a name="createproxyconfiguration"></a>
+
+## `Apify.createProxyConfiguration([proxyConfigurationOptions])`
+
+Creates a proxy configuration and returns a promise resolving to an instance of the [`ProxyConfiguration`](../api/proxy-configuration) class that is
+already initialized.
+
+Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking your crawlers based
+on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures them to use the selected proxies for
+all connections.
+
+For more details and code examples, see the [`ProxyConfiguration`](../api/proxy-configuration) class.
+
+```javascript
+
+// Returns initialized proxy configuration class
+const proxyConfiguration = await Apify.createProxyConfiguration({
+ groups: ['GROUP1', 'GROUP2'] // List of Apify proxy groups
+ countryCode: 'US'
+});
+
+const crawler = new Apify.CheerioCrawler({
+ // ...
+ proxyConfiguration,
+ handlePageFunction: ({ proxyInfo }) => {
+ const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
+ }
+})
+
+```
+
+For compatibility with existing Actor Input UI (Input Schema), this function returns `undefined` when the following object is passed as
+`proxyConfigurationOptions`.
+
+```
+{ useApifyProxy: false }
+```
+
+**Parameters**:
+
+- **`[proxyConfigurationOptions]`**: [`ProxyConfigurationOptions`](../typedefs/proxy-configuration-options)
+
+**Returns**:
+
+[`Promise<?ProxyConfiguration>`](../api/proxy-configuration)
+
+---
+
+<a name="events"></a>
+
+## `Apify.events`
+
+Gets an instance of a Node.js' [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) class that emits various events from the
+SDK or the Apify platform. The event emitter is initialized by calling the [`Apify.main()`](../api/apify#main) function.
+
+**Example usage:**
+
+```javascript
+Apify.events.on('cpuInfo', data => {
+ if (data.isCpuOverloaded) console.log('Oh no, the CPU is overloaded!');
+});
+```
+
+The following events are emitted:
+
+- `cpuInfo`: `{ "isCpuOverloaded": Boolean }` The event is emitted approximately every second and it indicates whether the actor is using the
+ maximum of available CPU resources. If that's the case, the actor should not add more workload. For example, this event is used by the
+ [`AutoscaledPool`](../api/autoscaled-pool) class.
+- `migrating`: `void` Emitted when the actor running on the Apify platform is going to be migrated to another worker server soon. You can use it to
+ persist the state of the actor and abort the run, to speed up migration. For example, this is used by the [`RequestList`](../api/request-list)
+ class.
+- `persistState`: `{ "isMigrating": Boolean }` Emitted in regular intervals (by default 60 seconds) to notify all components of Apify SDK that it is
+ time to persist their state, in order to avoid repeating all work when the actor restarts. This event is automatically emitted together with the
+ `migrating` event, in which case the `isMigrating` flag is set to `true`. Otherwise the flag is `false`. Note that the `persistState` event is
+ provided merely for user convenience, you can achieve the same effect using `setInterval()` and listening for the `migrating` event.
+
+---
+
+<a name="getenv"></a>
+
+## `Apify.getEnv()`
+
+Returns a new [`ApifyEnv`](../typedefs/apify-env) object which contains information parsed from all the `APIFY_XXX` environment variables.
+
+For the list of the `APIFY_XXX` environment variables, see [Actor documentation](https://docs.apify.com/actor/run#environment-variables). If some of
+the variables are not defined or are invalid, the corresponding value in the resulting object will be null.
+
+**Returns**:
+
+[`ApifyEnv`](../typedefs/apify-env)
+
+---
+
+<a name="getinput"></a>
+
+## `Apify.getInput()`
+
+Gets the actor input value from the default [`KeyValueStore`](../api/key-value-store) associated with the current actor run.
+
+This is just a convenient shortcut for [`keyValueStore.getValue('INPUT')`](key-value-store#getvalue). For example, calling the following code:
+
+```javascript
+const input = await Apify.getInput();
+```
+
+is equivalent to:
+
+```javascript
+const store = await Apify.openKeyValueStore();
+await store.getValue('INPUT');
+```
+
+For more information, see [`Apify.openKeyValueStore()`](../api/apify#openkeyvaluestore) and
+[`KeyValueStore.getValue()`](../api/key-value-store#getvalue).
+
+**Returns**:
+
+`Promise<(object|string|Buffer|null)>` - Returns a promise that resolves to an object, string or [`Buffer`](https://nodejs.org/api/buffer.html),
+depending on the MIME content type of the record, or `null` if the record is missing.
+
+---
+
+<a name="getmemoryinfo"></a>
+
+## `Apify.getMemoryInfo()`
+
+Returns memory statistics of the process and the system, see [`MemoryInfo`](../typedefs/memory-info).
+
+If the process runs inside of Docker, the `getMemoryInfo` gets container memory limits, otherwise it gets system memory limits.
+
+Beware that the function is quite inefficient because it spawns a new process. Therefore you shouldn't call it too often, like more than once per
+second.
+
+**Returns**:
+
+[`Promise<MemoryInfo>`](../typedefs/memory-info)
+
+---
+
+<a name="getvalue"></a>
+
+## `Apify.getValue(key)`
+
+Gets a value from the default [`KeyValueStore`](../api/key-value-store) associated with the current actor run.
+
+This is just a convenient shortcut for [`KeyValueStore.getValue()`](../api/key-value-store#getvalue). For example, calling the following code:
+
+```javascript
+const value = await Apify.getValue('my-key');
+```
+
+is equivalent to:
+
+```javascript
+const store = await Apify.openKeyValueStore();
+const value = await store.getValue('my-key');
+```
+
+To store the value to the default key-value store, you can use the [`Apify.setValue()`](../api/apify#setvalue) function.
+
+For more information, see [`Apify.openKeyValueStore()`](../api/apify#openkeyvaluestore) and
+[`KeyValueStore.getValue()`](../api/key-value-store#getvalue).
+
+**Parameters**:
+
+- **`key`**: `string` - Unique record key.
+
+**Returns**:
+
+`Promise<(object|string|Buffer|null)>` - Returns a promise that resolves to an object, string or [`Buffer`](https://nodejs.org/api/buffer.html),
+depending on the MIME content type of the record, or `null` if the record is missing.
+
+---
+
+<a name="isathome"></a>
+
+## `Apify.isAtHome()`
+
+Returns `true` when code is running on Apify platform and `false` otherwise (for example locally).
+
+**Returns**:
+
+`boolean`
+
+---
+
+<a name="launchpuppeteer"></a>
+
+## `Apify.launchPuppeteer([options])`
+
+Launches headless Chrome using Puppeteer pre-configured to work within the Apify platform. The function has the same argument and the return value as
+`puppeteer.launch()`. See <a href="https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions" target="_blank"> Puppeteer
+documentation</a> for more details.
+
+The `launchPuppeteer()` function alters the following Puppeteer options:
+
+- Passes the setting from the `APIFY_HEADLESS` environment variable to the `headless` option, unless it was already defined by the caller or
+ `APIFY_XVFB` environment variable is set to `1`. Note that Apify Actor cloud platform automatically sets `APIFY_HEADLESS=1` to all running actors.
+- Takes the `proxyUrl` option, validates it and adds it to `args` as `--proxy-server=XXX`. The proxy URL must define a port number and have one of
+ the following schemes: `http://`, `https://`, `socks4://` or `socks5://`. If the proxy is HTTP (i.e. has the `http://` scheme) and contains
+ username or password, the `launchPuppeteer` functions sets up an anonymous proxy HTTP to make the proxy work with headless Chrome. For more
+ information, read the
+ <a href="https://blog.apify.com/how-to-make-headless-chrome-and-puppeteer-use-a-proxy-server-with-authentication-249a21a79212"
+ target="_blank">blog post about proxy-chain library</a>.
+- If `options.useApifyProxy` is `true` then the function generates a URL of [Apify Proxy](https://docs.apify.com/proxy) based on
+ `options.apifyProxyGroups` and `options.apifyProxySession` and passes it as `options.proxyUrl`.
+- The function adds `--no-sandbox` to `args` to enable running headless Chrome in a Docker container on the Apify platform.
+- Sets `defaultViewport` Puppeteer option (if not already set) to a more reasonable default for screenshots and debugging. You can set
+ `options.defaultViewport` to `null` if you prefer to let Puppeteer choose the default viewport size.
+
+To use this function, you need to have the [puppeteer](https://www.npmjs.com/package/puppeteer) NPM package installed in your project. When running on
+the Apify cloud, you can achieve that simply by using the `apify/actor-node-chrome` base Docker image for your actor - see
+[Apify Actor documentation](https://docs.apify.com/actor/build#base-images) for details.
+
+For an example of usage, see the [Synchronous run Example](../examples/synchronous-run) or the
+[Puppeteer proxy Example](../examples/puppeteer-with-proxy)
+
+**Parameters**:
+
+- **`[options]`**: [`LaunchPuppeteerOptions`](../typedefs/launch-puppeteer-options) - Optional settings passed to `puppeteer.launch()`. In addition
+ to [Puppeteer's options](https://pptr.dev/#?product=Puppeteer&show=api-puppeteerlaunchoptions) the object may contain our own
+ [`LaunchPuppeteerOptions`](../typedefs/launch-puppeteer-options) that enable additional features.
+
+**Returns**:
+
+`Promise<Browser>` - Promise that resolves to Puppeteer's `Browser` instance.
+
+---
+
+<a name="main"></a>
+
+## `Apify.main(userFunc)`
+
+Runs the main user function that performs the job of the actor and terminates the process when the user function finishes.
+
+**The `Apify.main()` function is optional** and is provided merely for your convenience. It is mainly useful when you're running your code as an actor
+on the [Apify platform](https://apify.com/actors). However, if you want to use Apify SDK tools directly inside your existing projects, e.g. running in
+an [Express](https://expressjs.com/) server, on [Google Cloud functions](https://cloud.google.com/functions) or
+[AWS Lambda](https://aws.amazon.com/lambda/), it's better to avoid it since the function terminates the main process when it finishes!
+
+The `Apify.main()` function performs the following actions:
+
+<ol>
+ <li>When running on the Apify platform (i.e. <code>APIFY_IS_AT_HOME</code> environment variable is set),
+ it sets up a connection to listen for platform events.
+ For example, to get a notification about an imminent migration to another server.
+ See [`Apify.events`](../api/apify#events) for details.
+ </li>
+ <li>It checks that either <code>APIFY_TOKEN</code> or <code>APIFY_LOCAL_STORAGE_DIR</code> environment variable
+ is defined. If not, the functions sets <code>APIFY_LOCAL_STORAGE_DIR</code> to <code>./apify_storage</code>
+ inside the current working directory. This is to simplify running code examples.
+ </li>
+ <li>It invokes the user function passed as the <code>userFunc</code> parameter.</li>
+ <li>If the user function returned a promise, waits for it to resolve.</li>
+ <li>If the user function throws an exception or some other error is encountered,
+ prints error details to console so that they are stored to the log.</li>
+ <li>Exits the Node.js process, with zero exit code on success and non-zero on errors.</li>
+</ol>
+
+The user function can be synchronous:
+
+```javascript
+Apify.main(() => {
+ // My synchronous function that returns immediately
+ console.log('Hello world from actor!');
+});
+```
+
+If the user function returns a promise, it is considered asynchronous:
+
+```javascript
+const { requestAsBrowser } = require('some-request-library');
+
+Apify.main(() => {
+ // My asynchronous function that returns a promise
+ return request('http://www.example.com').then(html => {
+ console.log(html);
+ });
+});
+```
+
+To simplify your code, you can take advantage of the `async`/`await` keywords:
+
+```javascript
+const request = require('some-request-library');
+
+Apify.main(async () => {
+ // My asynchronous function
+ const html = await request('http://www.example.com');
+ console.log(html);
+});
+```
+
+**Parameters**:
+
+- **`userFunc`**: [`UserFunc`](../typedefs/user-func) - User function to be executed. If it returns a promise, the promise will be awaited. The user
+ function is called with no arguments.
+
+---
+
+<a name="metamorph"></a>
+
+## `Apify.metamorph(targetActorId, [input], [options])`
+
+Transforms this actor run to an actor run of a given actor. The system stops the current container and starts the new container instead. All the
+default storages are preserved and the new input is stored under the `INPUT-METAMORPH-1` key in the same default key-value store.
+
+**Parameters**:
+
+- **`targetActorId`**: `string` - Either `username/actor-name` or actor ID of an actor to which we want to metamorph.
+- **`[input]`**: `object` - Input for the actor. If it is an object, it will be stringified to JSON and its content type set to
+ `application/json; charset=utf-8`. Otherwise the `options.contentType` parameter must be provided.
+- **`[options]`**: `Object` <code> = {}</code> - Object with the settings below:
+ - **`[contentType]`**: `string` - Content type for the `input`. If not specified, `input` is expected to be an object that will be stringified
+ to JSON and content type set to `application/json; charset=utf-8`. If `options.contentType` is specified, then `input` must be a `String` or
+ `Buffer`.
+ - **`[build]`**: `string` - Tag or number of the target actor build to metamorph into (e.g. `beta` or `1.2.345`). If not provided, the run uses
+ build tag or number from the default actor run configuration (typically `latest`).
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="newclient"></a>
+
+## `Apify.newClient([options])`
+
+Returns a new instance of the Apify API client. The `ApifyClient` class is provided by the
+<a href="https://www.npmjs.com/package/apify-client" target="_blank">apify-client</a> NPM package, and it is automatically configured using the
+`APIFY_API_BASE_URL`, and `APIFY_TOKEN` environment variables. You can override the token via the available options. That's useful if you want to use
+the client as a different Apify user than the SDK internals are using.
+
+**Parameters**:
+
+- **`[options]`**: `object`
+ - **`[token]`**: `string`
+ - **`[maxRetries]`**: `string`
+ - **`[minDelayBetweenRetriesMillis]`**: `string`
+
+**Returns**:
+
+[`ApifyClient`](../api/apify)
+
+---
+
+<a name="opendataset"></a>
+
+## `Apify.openDataset([datasetIdOrName], [options])`
+
+Opens a dataset and returns a promise resolving to an instance of the [`Dataset`](../api/dataset) class.
+
+Datasets are used to store structured data where each object stored has the same attributes, such as online store products or real estate offers. The
+actual data is stored either on the local filesystem or in the cloud.
+
+For more details and code examples, see the [`Dataset`](../api/dataset) class.
+
+**Parameters**:
+
+- **`[datasetIdOrName]`**: `string` - ID or name of the dataset to be opened. If `null` or `undefined`, the function returns the default dataset
+ associated with the actor run.
+- **`[options]`**: `Object`
+ - **`[forceCloud]`**: `boolean` <code> = false</code> - If set to `true` then the function uses cloud storage usage even if the
+ `APIFY_LOCAL_STORAGE_DIR` environment variable is set. This way it is possible to combine local and cloud storage.
+
+**Returns**:
+
+[`Promise<Dataset>`](../api/dataset)
+
+---
+
+<a name="openkeyvaluestore"></a>
+
+## `Apify.openKeyValueStore([storeIdOrName], [options])`
+
+Opens a key-value store and returns a promise resolving to an instance of the [`KeyValueStore`](../api/key-value-store) class.
+
+Key-value stores are used to store records or files, along with their MIME content type. The records are stored and retrieved using a unique key. The
+actual data is stored either on a local filesystem or in the Apify cloud.
+
+For more details and code examples, see the [`KeyValueStore`](../api/key-value-store) class.
+
+**Parameters**:
+
+- **`[storeIdOrName]`**: `string` - ID or name of the key-value store to be opened. If `null` or `undefined`, the function returns the default
+ key-value store associated with the actor run.
+- **`[options]`**: `object`
+ - **`[forceCloud]`**: `boolean` <code> = false</code> - If set to `true` then the function uses cloud storage usage even if the
+ `APIFY_LOCAL_STORAGE_DIR` environment variable is set. This way it is possible to combine local and cloud storage.
+
+**Returns**:
+
+[`Promise<KeyValueStore>`](../api/key-value-store)
+
+---
+
+<a name="openrequestlist"></a>
+
+## `Apify.openRequestList(listName, sources, [options])`
+
+Opens a request list and returns a promise resolving to an instance of the [`RequestList`](../api/request-list) class that is already initialized.
+
+[`RequestList`](../api/request-list) represents a list of URLs to crawl, which is always stored in memory. To enable picking up where left off after a
+process restart, the request list sources are persisted to the key-value store at initialization of the list. Then, while crawling, a small state
+object is regularly persisted to keep track of the crawling status.
+
+For more details and code examples, see the [`RequestList`](../api/request-list) class.
+
+**Example usage:**
+
+```javascript
+const sources = ['https://www.example.com', 'https://www.google.com', 'https://www.bing.com'];
+
+const requestList = await Apify.openRequestList('my-name', sources);
+```
+
+**Parameters**:
+
+- **`listName`**: `string` | `null` - Name of the request list to be opened. Setting a name enables the `RequestList`'s state to be persisted in the
+ key-value store. This is useful in case of a restart or migration. Since `RequestList` is only stored in memory, a restart or migration wipes it
+ clean. Setting a name will enable the `RequestList`'s state to survive those situations and continue where it left off.
+
+ The name will be used as a prefix in key-value store, producing keys such as `NAME-REQUEST_LIST_STATE` and `NAME-REQUEST_LIST_SOURCES`.
+
+ If `null`, the list will not be persisted and will only be stored in memory. Process restart will then cause the list to be crawled again from the
+ beginning. We suggest always using a name.
+
+- **`sources`**: [`Array<(RequestOptions|Request|string)>`](../typedefs/request-options) - An array of sources of URLs for the
+ [`RequestList`](../api/request-list). It can be either an array of strings, plain objects that define at least the `url` property, or an array of
+ [`Request`](../api/request) instances.
+
+ **IMPORTANT:** The `sources` array will be consumed (left empty) after [`RequestList`](../api/request-list) initializes. This is a measure to
+ prevent memory leaks in situations when millions of sources are added.
+
+Additionally, the `requestsFromUrl` property may be used instead of `url`, which will instruct [`RequestList`](../api/request-list) to download the
+source URLs from a given remote location. The URLs will be parsed from the received response. In this case you can limit the URLs using `regex`
+parameter containing regular expression pattern for URLs to be included.
+
+For details, see the [`RequestListOptions.sources`](../typedefs/request-list-options#sources)
+
+- **`[options]`**: [`RequestListOptions`](../typedefs/request-list-options) - The [`RequestList`](../api/request-list) options. Note that the
+ `listName` parameter supersedes the [`RequestListOptions.persistStateKey`](../typedefs/request-list-options#persiststatekey) and
+ [`RequestListOptions.persistRequestsKey`](../typedefs/request-list-options#persistrequestskey) options and the `sources` parameter supersedes the
+ [`RequestListOptions.sources`](../typedefs/request-list-options#sources) option.
+
+**Returns**:
+
+[`Promise<RequestList>`](../api/request-list)
+
+---
+
+<a name="openrequestqueue"></a>
+
+## `Apify.openRequestQueue([queueIdOrName], [options])`
+
+Opens a request queue and returns a promise resolving to an instance of the [`RequestQueue`](../api/request-queue) class.
+
+[`RequestQueue`](../api/request-queue) represents a queue of URLs to crawl, which is stored either on local filesystem or in the cloud. The queue is
+used for deep crawling of websites, where you start with several URLs and then recursively follow links to other pages. The data structure supports
+both breadth-first and depth-first crawling orders.
+
+For more details and code examples, see the [`RequestQueue`](../api/request-queue) class.
+
+**Parameters**:
+
+- **`[queueIdOrName]`**: `string` - ID or name of the request queue to be opened. If `null` or `undefined`, the function returns the default request
+ queue associated with the actor run.
+- **`[options]`**: `object`
+ - **`[forceCloud]`**: `boolean` <code> = false</code> - If set to `true` then the function uses cloud storage usage even if the
+ `APIFY_LOCAL_STORAGE_DIR` environment variable is set. This way it is possible to combine local and cloud storage.
+
+**Returns**:
+
+[`Promise<RequestQueue>`](../api/request-queue)
+
+---
+
+<a name="opensessionpool"></a>
+
+## `Apify.openSessionPool(sessionPoolOptions)`
+
+Opens a SessionPool and returns a promise resolving to an instance of the [`SessionPool`](../api/session-pool) class that is already initialized.
+
+For more details and code examples, see the [`SessionPool`](../api/session-pool) class.
+
+**Parameters**:
+
+- **`sessionPoolOptions`**: [`SessionPoolOptions`](../typedefs/session-pool-options)
+
+**Returns**:
+
+[`Promise<SessionPool>`](../api/session-pool)
+
+---
+
+<a name="pushdata"></a>
+
+## `Apify.pushData(item)`
+
+Stores an object or an array of objects to the default [`Dataset`](../api/dataset) of the current actor run.
+
+This is just a convenient shortcut for [`Dataset.pushData()`](../api/dataset#pushdata). For example, calling the following code:
+
+```javascript
+await Apify.pushData({ myValue: 123 });
+```
+
+is equivalent to:
+
+```javascript
+const dataset = await Apify.openDataset();
+await dataset.pushData({ myValue: 123 });
+```
+
+For more information, see [`Apify.openDataset()`](../api/apify#opendataset) and [`Dataset.pushData()`](../api/dataset#pushdata)
+
+**IMPORTANT**: Make sure to use the `await` keyword when calling `pushData()`, otherwise the actor process might finish before the data are stored!
+
+**Parameters**:
+
+- **`item`**: `object` - Object or array of objects containing data to be stored in the default dataset. The objects must be serializable to JSON
+ and the JSON representation of each object must be smaller than 9MB.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="setvalue"></a>
+
+## `Apify.setValue(key, value, [options])`
+
+Stores or deletes a value in the default [`KeyValueStore`](../api/key-value-store) associated with the current actor run.
+
+This is just a convenient shortcut for [`KeyValueStore.setValue()`](../api/key-value-store#setvalue). For example, calling the following code:
+
+```javascript
+await Apify.setValue('OUTPUT', { foo: 'bar' });
+```
+
+is equivalent to:
+
+```javascript
+const store = await Apify.openKeyValueStore();
+await store.setValue('OUTPUT', { foo: 'bar' });
+```
+
+To get a value from the default key-value store, you can use the [`Apify.getValue()`](../api/apify#getvalue) function.
+
+For more information, see [`Apify.openKeyValueStore()`](../api/apify#openkeyvaluestore) and
+[`KeyValueStore.getValue()`](../api/key-value-store#getvalue).
+
+**Parameters**:
+
+- **`key`**: `string` - Unique record key.
+- **`value`**: `object` - Record data, which can be one of the following values:
+ - If `null`, the record in the key-value store is deleted.
+ - If no `options.contentType` is specified, `value` can be any JavaScript object and it will be stringified to JSON.
+ - If `options.contentType` is set, `value` is taken as is and it must be a `String` or [`Buffer`](https://nodejs.org/api/buffer.html). For any
+ other value an error will be thrown.
+- **`[options]`**: `Object`
+ - **`[contentType]`**: `string` - Specifies a custom MIME content type of the record.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/ApifyCallError.md b/website/versioned_docs/version-0.22.4/api/ApifyCallError.md
new file mode 100644
index 000000000..402027202
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/ApifyCallError.md
@@ -0,0 +1,46 @@
+---
+id: version-0.22.4-apify-call-error
+title: ApifyCallError
+original_id: apify-call-error
+---
+
+<a name="apifycallerror"></a>
+
+The class represents exceptions thrown by the [`Apify.call()`](../api/apify#call) function.
+
+## Properties
+
+### `message`
+
+**Type**: `string`
+
+Error message
+
+---
+
+### `run`
+
+**Type**: [`ActorRun`](../typedefs/actor-run)
+
+Object representing the failed actor run.
+
+---
+
+### `name`
+
+**Type**: `string`
+
+Contains `"ApifyCallError"`
+
+---
+
+<a name="exports.apifycallerror"></a>
+
+## `new ApifyCallError(run, [message])`
+
+**Parameters**:
+
+- **`run`**: [`ActorRun`](../typedefs/actor-run)
+- **`[message]`**: `string` <code> = &quot;The actor invoked by Apify.call() did not succeed&quot;</code>
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/AutoscaledPool.md b/website/versioned_docs/version-0.22.4/api/AutoscaledPool.md
new file mode 100644
index 000000000..73b995dcd
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/AutoscaledPool.md
@@ -0,0 +1,213 @@
+---
+id: version-0.22.4-autoscaled-pool
+title: AutoscaledPool
+original_id: autoscaled-pool
+---
+
+<a name="autoscaledpool"></a>
+
+Manages a pool of asynchronous resource-intensive tasks that are executed in parallel. The pool only starts new tasks if there is enough free CPU and
+memory available and the Javascript event loop is not blocked.
+
+The information about the CPU and memory usage is obtained by the [`Snapshotter`](../api/snapshotter) class, which makes regular snapshots of system
+resources that may be either local or from the Apify cloud infrastructure in case the process is running on the Apify platform. Meaningful data
+gathered from these snapshots is provided to `AutoscaledPool` by the [`SystemStatus`](../api/system-status) class.
+
+Before running the pool, you need to implement the following three functions:
+[`AutoscaledPoolOptions.runTaskFunction()`](../typedefs/autoscaled-pool-options#runtaskfunction),
+[`AutoscaledPoolOptions.isTaskReadyFunction()`](../typedefs/autoscaled-pool-options#istaskreadyfunction) and
+[`AutoscaledPoolOptions.isFinishedFunction()`](../typedefs/autoscaled-pool-options#isfinishedfunction).
+
+The auto-scaled pool is started by calling the [`AutoscaledPool.run()`](../api/autoscaled-pool#run) function. The pool periodically queries the
+[`AutoscaledPoolOptions.isTaskReadyFunction()`](../typedefs/autoscaled-pool-options#istaskreadyfunction) function for more tasks, managing optimal
+concurrency, until the function resolves to `false`. The pool then queries the
+[`AutoscaledPoolOptions.isFinishedFunction()`](../typedefs/autoscaled-pool-options#isfinishedfunction). If it resolves to `true`, the run finishes
+after all running tasks complete. If it resolves to `false`, it assumes there will be more tasks available later and keeps periodically querying for
+tasks. If any of the tasks throws then the [`AutoscaledPool.run()`](../api/autoscaled-pool#run) function rejects the promise with an error.
+
+The pool evaluates whether it should start a new task every time one of the tasks finishes and also in the interval set by the
+`options.maybeRunIntervalSecs` parameter.
+
+**Example usage:**
+
+```javascript
+const pool = new Apify.AutoscaledPool({
+ maxConcurrency: 50,
+ runTaskFunction: async () => {
+ // Run some resource-intensive asynchronous operation here.
+ },
+ isTaskReadyFunction: async () => {
+ // Tell the pool whether more tasks are ready to be processed.
+ // Return true or false
+ },
+ isFinishedFunction: async () => {
+ // Tell the pool whether it should finish
+ // or wait for more tasks to become available.
+ // Return true or false
+ },
+});
+
+await pool.run();
+```
+
+---
+
+<a name="autoscaledpool"></a>
+
+## `new AutoscaledPool(options)`
+
+**Parameters**:
+
+- **`options`**: [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options) - All `AutoscaledPool` configuration options.
+
+---
+
+<a name="minconcurrency"></a>
+
+## `autoscaledPool.minConcurrency`
+
+Gets the minimum number of tasks running in parallel.
+
+**Returns**:
+
+`number`
+
+---
+
+<a name="minconcurrency"></a>
+
+## `autoscaledPool.minConcurrency`
+
+Sets the minimum number of tasks running in parallel.
+
+_WARNING:_ If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash. If you're
+not sure, just keep the default value and the concurrency will scale up automatically.
+
+**Parameters**:
+
+- **`value`**: `number`
+
+---
+
+<a name="maxconcurrency"></a>
+
+## `autoscaledPool.maxConcurrency`
+
+Gets the maximum number of tasks running in parallel.
+
+**Returns**:
+
+`number`
+
+---
+
+<a name="maxconcurrency"></a>
+
+## `autoscaledPool.maxConcurrency`
+
+Sets the maximum number of tasks running in parallel.
+
+**Parameters**:
+
+- **`value`**: `number`
+
+---
+
+<a name="desiredconcurrency"></a>
+
+## `autoscaledPool.desiredConcurrency`
+
+Gets the desired concurrency for the pool, which is an estimated number of parallel tasks that the system can currently support.
+
+**Returns**:
+
+`number`
+
+---
+
+<a name="desiredconcurrency"></a>
+
+## `autoscaledPool.desiredConcurrency`
+
+Sets the desired concurrency for the pool, i.e. the number of tasks that should be running in parallel if there's large enough supply of tasks.
+
+**Parameters**:
+
+- **`value`**: `number`
+
+---
+
+<a name="currentconcurrency"></a>
+
+## `autoscaledPool.currentConcurrency`
+
+Gets the the number of parallel tasks currently running in the pool.
+
+**Returns**:
+
+`number`
+
+---
+
+<a name="run"></a>
+
+## `autoscaledPool.run()`
+
+Runs the auto-scaled pool. Returns a promise that gets resolved or rejected once all the tasks are finished or one of them fails.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="abort"></a>
+
+## `autoscaledPool.abort()`
+
+Aborts the run of the auto-scaled pool and destroys it. The promise returned from the [`AutoscaledPool.run()`](../api/autoscaled-pool#run) function
+will immediately resolve, no more new tasks will be spawned and all running tasks will be left in their current state.
+
+Due to the nature of the tasks, auto-scaled pool cannot reliably guarantee abortion of all the running tasks, therefore, no abortion is attempted and
+some of the tasks may finish, while others may not. Essentially, auto-scaled pool doesn't care about their state after the invocation of `.abort()`,
+but that does not mean that some parts of their asynchronous chains of commands will not execute.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="pause"></a>
+
+## `autoscaledPool.pause([timeoutSecs])`
+
+Prevents the auto-scaled pool from starting new tasks, but allows the running ones to finish (unlike abort, which terminates them). Used together with
+[`AutoscaledPool.resume()`](../api/autoscaled-pool#resume)
+
+The function's promise will resolve once all running tasks have completed and the pool is effectively idle. If the `timeoutSecs` argument is provided,
+the promise will reject with a timeout error after the `timeoutSecs` seconds.
+
+The promise returned from the [`AutoscaledPool.run()`](../api/autoscaled-pool#run) function will not resolve when `.pause()` is invoked (unlike abort,
+which resolves it).
+
+**Parameters**:
+
+- **`[timeoutSecs]`**: `number`
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="resume"></a>
+
+## `autoscaledPool.resume()`
+
+Resumes the operation of the autoscaled-pool by allowing more tasks to be run. Used together with
+[`AutoscaledPool.pause()`](../api/autoscaled-pool#pause)
+
+Tasks will automatically start running again in `options.maybeRunIntervalSecs`.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/BasicCrawler.md b/website/versioned_docs/version-0.22.4/api/BasicCrawler.md
new file mode 100644
index 000000000..4eb5cd822
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/BasicCrawler.md
@@ -0,0 +1,101 @@
+---
+id: version-0.22.4-basic-crawler
+title: BasicCrawler
+original_id: basic-crawler
+---
+
+<a name="basiccrawler"></a>
+
+Provides a simple framework for parallel crawling of web pages. The URLs to crawl are fed either from a static list of URLs or from a dynamic queue of
+URLs enabling recursive crawling of websites.
+
+`BasicCrawler` is a low-level tool that requires the user to implement the page download and data extraction functionality themselves. If you want a
+crawler that already facilitates this functionality, please consider using [`PuppeteerCrawler`](../api/puppeteer-crawler) or
+[`CheerioCrawler`](../api/cheerio-crawler).
+
+`BasicCrawler` invokes the user-provided [`BasicCrawlerOptions.handleRequestFunction`](../typedefs/basic-crawler-options#handlerequestfunction) for
+each [`Request`](../api/request) object, which represents a single URL to crawl. The [`Request`](../api/request) objects are fed from the
+[`RequestList`](../api/request-list) or the [`RequestQueue`](../api/request-queue) instances provided by the
+[`BasicCrawlerOptions.requestList`](../typedefs/basic-crawler-options#requestlist) or
+[`BasicCrawlerOptions.requestQueue`](../typedefs/basic-crawler-options#requestqueue) constructor options, respectively.
+
+If both [`BasicCrawlerOptions.requestList`](../typedefs/basic-crawler-options#requestlist) and
+[`BasicCrawlerOptions.requestQueue`](../typedefs/basic-crawler-options#requestqueue) options are used, the instance first processes URLs from the
+[`RequestList`](../api/request-list) and automatically enqueues all of them to [`RequestQueue`](../api/request-queue) before it starts their
+processing. This ensures that a single URL is not crawled multiple times.
+
+The crawler finishes if there are no more [`Request`](../api/request) objects to crawl.
+
+New requests are only dispatched when there is enough free CPU and memory available, using the functionality provided by the
+[`AutoscaledPool`](../api/autoscaled-pool) class. All [`AutoscaledPool`](../api/autoscaled-pool) configuration options can be passed to the
+`autoscaledPoolOptions` parameter of the `BasicCrawler` constructor. For user convenience, the `minConcurrency` and `maxConcurrency`
+[`AutoscaledPool`](../api/autoscaled-pool) options are available directly in the `BasicCrawler` constructor.
+
+**Example usage:**
+
+```javascript
+// Prepare a list of URLs to crawl
+const requestList = new Apify.RequestList({
+ sources: [{ url: 'http://www.example.com/page-1' }, { url: 'http://www.example.com/page-2' }],
+});
+await requestList.initialize();
+
+// Crawl the URLs
+const crawler = new Apify.BasicCrawler({
+ requestList,
+ handleRequestFunction: async ({ request }) => {
+ // 'request' contains an instance of the Request class
+ // Here we simply fetch the HTML of the page and store it to a dataset
+ const { body } = await Apify.utils.requestAsBrowser(request);
+ await Apify.pushData({
+ url: request.url,
+ html: body,
+ });
+ },
+});
+
+await crawler.run();
+```
+
+## Properties
+
+### `stats`
+
+**Type**: [`Statistics`](../api/statistics)
+
+Contains statistics about the current run
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler. Note that this property is
+only initialized after calling the [`BasicCrawler.run()`](../api/basic-crawler#run) function. You can use it to change the concurrency settings on the
+fly, to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause) or to abort it by calling
+[`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+---
+
+<a name="basiccrawler"></a>
+
+## `new BasicCrawler(options)`
+
+**Parameters**:
+
+- **`options`**: [`BasicCrawlerOptions`](../typedefs/basic-crawler-options) - All `BasicCrawler` parameters are passed via an options object.
+
+---
+
+<a name="run"></a>
+
+## `basicCrawler.run()`
+
+Runs the crawler. Returns a promise that gets resolved once all the requests are processed.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/BrowserCrawler.md b/website/versioned_docs/version-0.22.4/api/BrowserCrawler.md
new file mode 100644
index 000000000..08b462a45
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/BrowserCrawler.md
@@ -0,0 +1,133 @@
+---
+id: version-0.22.4-browser-crawler
+title: BrowserCrawler
+original_id: browser-crawler
+---
+
+<a name="browsercrawler"></a>
+
+Provides a simple framework for parallel crawling of web pages using headless browsers with [Puppeteer](https://github.com/puppeteer/puppeteer) and
+[Playwright](https://github.com/microsoft/playwright). The URLs to crawl are fed either from a static list of URLs or from a dynamic queue of URLs
+enabling recursive crawling of websites.
+
+Since `BrowserCrawler` uses headless or even headfull browsers to download web pages and extract data, it is useful for crawling of websites that
+require to execute JavaScript. If the target website doesn't need JavaScript, consider using [`CheerioCrawler`](../api/cheerio-crawler), which
+downloads the pages using raw HTTP requests and is about 10x faster. @TODO: more?
+
+The source URLs are represented using [`Request`](../api/request) objects that are fed from [`RequestList`](../api/request-list) or
+[`RequestQueue`](../api/request-queue) instances provided by the
+[`BrowserCrawlerOptions.requestList`](../typedefs/browser-crawler-options#requestlist) or
+[`BrowserCrawlerOptions.requestQueue`](../typedefs/browser-crawler-options#requestqueue) constructor options, respectively.
+
+If both [`BrowserCrawlerOptions.requestList`](../typedefs/browser-crawler-options#requestlist) and
+[`BrowserCrawlerOptions.requestQueue`](../typedefs/browser-crawler-options#requestqueue) are used, the instance first processes URLs from the
+[`RequestList`](../api/request-list) and automatically enqueues all of them to [`RequestQueue`](../api/request-queue) before it starts their
+processing. This ensures that a single URL is not crawled multiple times.
+
+The crawler finishes when there are no more [`Request`](../api/request) objects to crawl.
+
+`BrowserCrawler` opens a new browser page (i.e. tab or window) for each [`Request`](../api/request) object to crawl and then calls the function
+provided by user as the [`BrowserCrawlerOptions.handlePageFunction`](../typedefs/browser-crawler-options#handlepagefunction) option.
+
+New pages are only opened when there is enough free CPU and memory available, using the functionality provided by the
+[`AutoscaledPool`](../api/autoscaled-pool) class. All [`AutoscaledPool`](../api/autoscaled-pool) configuration options can be passed to the
+[`BrowserCrawlerOptions.autoscaledPoolOptions`](../typedefs/browser-crawler-options#autoscaledpooloptions) parameter of the `BrowserCrawler`
+constructor. For user convenience, the `minConcurrency` and `maxConcurrency` [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options) are
+available directly in the `BrowserCrawler` constructor.
+
+Note that the pool of browser instances is internally managed by the `BrowserPool` class.
+
+**Example usage:**
+
+**Todo:**: ```javascript const crawler = new Apify.PuppeteerCrawler({ requestList, handlePageFunction: async ({ page, request }) => { // This function
+is called to extract data from a single web page // 'page' is an instance of Puppeteer.Page with page.goto(request.url) already called // 'request' is
+an instance of Request class with information about the page to load await Apify.pushData({ title: await page.title(), url: request.url, succeeded:
+true, }) }, handleFailedRequestFunction: async ({ request }) => { // This function is called when the crawling of a request failed too many times
+await Apify.pushData({ url: request.url, succeeded: false, errors: request.errorMessages, }) }, });
+
+await crawler.run();
+
+```
+## Properties
+### `stats`
+**Type**: [`Statistics`](../api/statistics)
+
+Contains statistics about the current run.
+
+* * *
+
+### `requestList`
+**Type**: [`RequestList`](../api/request-list)
+
+A reference to the underlying [`RequestList`](../api/request-list) class that manages the crawler's [`Request`](../api/request)s.
+ Only available if used by the crawler.
+
+* * *
+
+### `requestQueue`
+**Type**: [`RequestQueue`](../api/request-queue)
+
+A reference to the underlying [`RequestQueue`](../api/request-queue) class that manages the crawler's [`Request`](../api/request)s.
+ Only available if used by the crawler.
+
+* * *
+
+### `sessionPool`
+**Type**: [`SessionPool`](../api/session-pool)
+
+A reference to the underlying [`SessionPool`](../api/session-pool) class that manages the crawler's [`Session`](../api/session)s.
+ Only available if used by the crawler.
+
+* * *
+
+### `proxyConfiguration`
+**Type**: [`ProxyConfiguration`](../api/proxy-configuration)
+
+A reference to the underlying [`ProxyConfiguration`](../api/proxy-configuration) class that manages the crawler's proxies.
+ Only available if used by the crawler.
+
+* * *
+
+### `browserPool`
+**Type**: `BrowserPool`
+
+A reference to the underlying `BrowserPool` class that manages the crawler's browsers.
+ For more information about it, see the [`browser-pool` module](https://github.com/apify/browser-pool).
+
+* * *
+
+### `autoscaledPool`
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler.
+ Note that this property is only initialized after calling the [`CheerioCrawler.run()`](../api/cheerio-crawler#run) function.
+ You can use it to change the concurrency settings on the fly,
+ to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause)
+ or to abort it by calling [`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+
+* * *
+
+<a name="browsercrawler"></a>
+
+## `new BrowserCrawler(options)`
+**Parameters**:
+
+- **`options`**: [`BrowserCrawlerOptions`](../typedefs/browser-crawler-options) - All `BrowserCrawler` parameters are passed via an options object.
+
+
+* * *
+
+<a name="_handlenavigationtimeout"></a>
+
+## `browserCrawler._handleNavigationTimeout(crawlingContext, error)`
+Marks session bad in case of navigation timeout.
+
+**Parameters**:
+
+- **`crawlingContext`**: `object`
+- **`error`**: `Error`
+
+
+* * *
+```
diff --git a/website/versioned_docs/version-0.22.4/api/CacheContainer.md b/website/versioned_docs/version-0.22.4/api/CacheContainer.md
new file mode 100644
index 000000000..2d328d61e
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/CacheContainer.md
@@ -0,0 +1,7 @@
+---
+id: version-0.22.4-cache-container
+title: CacheContainer
+original_id: cache-container
+---
+
+ERROR, Cannot find class.
diff --git a/website/versioned_docs/version-0.22.4/api/CheerioCrawler.md b/website/versioned_docs/version-0.22.4/api/CheerioCrawler.md
new file mode 100644
index 000000000..22345958e
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/CheerioCrawler.md
@@ -0,0 +1,114 @@
+---
+id: version-0.22.4-cheerio-crawler
+title: CheerioCrawler
+original_id: cheerio-crawler
+---
+
+<a name="cheeriocrawler"></a>
+
+Provides a framework for the parallel crawling of web pages using plain HTTP requests and [cheerio](https://www.npmjs.com/package/cheerio) HTML
+parser. The URLs to crawl are fed either from a static list of URLs or from a dynamic queue of URLs enabling recursive crawling of websites.
+
+Since `CheerioCrawler` uses raw HTTP requests to download web pages, it is very fast and efficient on data bandwidth. However, if the target website
+requires JavaScript to display the content, you might need to use [`PuppeteerCrawler`](../api/puppeteer-crawler) instead, because it loads the pages
+using full-featured headless Chrome browser.
+
+`CheerioCrawler` downloads each URL using a plain HTTP request, parses the HTML content using [Cheerio](https://www.npmjs.com/package/cheerio) and
+then invokes the user-provided [`CheerioCrawlerOptions.handlePageFunction`](../typedefs/cheerio-crawler-options#handlepagefunction) to extract page
+data using a [jQuery](https://jquery.com/)-like interface to the parsed HTML DOM.
+
+The source URLs are represented using [`Request`](../api/request) objects that are fed from [`RequestList`](../api/request-list) or
+[`RequestQueue`](../api/request-queue) instances provided by the
+[`CheerioCrawlerOptions.requestList`](../typedefs/cheerio-crawler-options#requestlist) or
+[`CheerioCrawlerOptions.requestQueue`](../typedefs/cheerio-crawler-options#requestqueue) constructor options, respectively.
+
+If both [`CheerioCrawlerOptions.requestList`](../typedefs/cheerio-crawler-options#requestlist) and
+[`CheerioCrawlerOptions.requestQueue`](../typedefs/cheerio-crawler-options#requestqueue) are used, the instance first processes URLs from the
+[`RequestList`](../api/request-list) and automatically enqueues all of them to [`RequestQueue`](../api/request-queue) before it starts their
+processing. This ensures that a single URL is not crawled multiple times.
+
+The crawler finishes when there are no more [`Request`](../api/request) objects to crawl.
+
+`CheerioCrawler` downloads the web pages using the [`utils.requestAsBrowser()`](../api/utils#requestasbrowser) utility function.
+
+By default, `CheerioCrawler` only processes web pages with the `text/html` and `application/xhtml+xml` MIME content types (as reported by the
+`Content-Type` HTTP header), and skips pages with other content types. If you want the crawler to process other content types, use the
+[`CheerioCrawlerOptions.additionalMimeTypes`](../typedefs/cheerio-crawler-options#additionalmimetypes) constructor option. Beware that the parsing
+behavior differs for HTML, XML, JSON and other types of content. For details, see
+[`CheerioCrawlerOptions.handlePageFunction`](../typedefs/cheerio-crawler-options#handlepagefunction).
+
+New requests are only dispatched when there is enough free CPU and memory available, using the functionality provided by the
+[`AutoscaledPool`](../api/autoscaled-pool) class. All [`AutoscaledPool`](../api/autoscaled-pool) configuration options can be passed to the
+`autoscaledPoolOptions` parameter of the `CheerioCrawler` constructor. For user convenience, the `minConcurrency` and `maxConcurrency`
+[`AutoscaledPool`](../api/autoscaled-pool) options are available directly in the `CheerioCrawler` constructor.
+
+**Example usage:**
+
+```javascript
+// Prepare a list of URLs to crawl
+const requestList = new Apify.RequestList({
+ sources: [{ url: 'http://www.example.com/page-1' }, { url: 'http://www.example.com/page-2' }],
+});
+await requestList.initialize();
+
+// Crawl the URLs
+const crawler = new Apify.CheerioCrawler({
+ requestList,
+ handlePageFunction: async ({ request, response, body, contentType, $ }) => {
+ const data = [];
+
+ // Do some data extraction from the page with Cheerio.
+ $('.some-collection').each((index, el) => {
+ data.push({
+ title: $(el)
+ .find('.some-title')
+ .text(),
+ });
+ });
+
+ // Save the data to dataset.
+ await Apify.pushData({
+ url: request.url,
+ html: body,
+ data,
+ });
+ },
+});
+
+await crawler.run();
+```
+
+## Properties
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler. Note that this property is
+only initialized after calling the [`CheerioCrawler.run()`](../api/cheerio-crawler#run) function. You can use it to change the concurrency settings on
+the fly, to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause) or to abort it by calling
+[`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+---
+
+<a name="cheeriocrawler"></a>
+
+## `new CheerioCrawler(options)`
+
+**Parameters**:
+
+- **`options`**: [`CheerioCrawlerOptions`](../typedefs/cheerio-crawler-options) - All `CheerioCrawler` parameters are passed via an options object.
+
+---
+
+<a name="use"></a>
+
+## `cheerioCrawler.use(extension)`
+
+**EXPERIMENTAL** Function for attaching CrawlerExtensions such as the Unblockers.
+
+**Parameters**:
+
+- **`extension`**: `CrawlerExtension` - Crawler extension that overrides the crawler configuration.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/CookieParseError.md b/website/versioned_docs/version-0.22.4/api/CookieParseError.md
new file mode 100644
index 000000000..5b668afcb
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/CookieParseError.md
@@ -0,0 +1,19 @@
+---
+id: version-0.22.4-cookie-parse-error
+title: CookieParseError
+original_id: cookie-parse-error
+---
+
+<a name="cookieparseerror"></a>
+
+---
+
+<a name="exports.cookieparseerror"></a>
+
+## `new CookieParseError(cookieHeaderString)`
+
+**Parameters**:
+
+- **`cookieHeaderString`**: `string`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/Dataset.md b/website/versioned_docs/version-0.22.4/api/Dataset.md
new file mode 100644
index 000000000..5b504e8bc
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/Dataset.md
@@ -0,0 +1,259 @@
+---
+id: version-0.22.4-dataset
+title: Dataset
+original_id: dataset
+---
+
+<a name="dataset"></a>
+
+The `Dataset` class represents a store for structured data where each object stored has the same attributes, such as online store products or real
+estate offers. You can imagine it as a table, where each object is a row and its attributes are columns. Dataset is an append-only storage - you can
+only add new records to it but you cannot modify or remove existing records. Typically it is used to store crawling results.
+
+Do not instantiate this class directly, use the [`Apify.openDataset()`](../api/apify#opendataset) function instead.
+
+`Dataset` stores its data either on local disk or in the Apify cloud, depending on whether the `APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment
+variables are set.
+
+If the `APIFY_LOCAL_STORAGE_DIR` environment variable is set, the data is stored in the local directory in the following files:
+
+```
+{APIFY_LOCAL_STORAGE_DIR}/datasets/{DATASET_ID}/{INDEX}.json
+```
+
+Note that `{DATASET_ID}` is the name or ID of the dataset. The default dataset has ID: `default`, unless you override it by setting the
+`APIFY_DEFAULT_DATASET_ID` environment variable. Each dataset item is stored as a separate JSON file, where `{INDEX}` is a zero-based index of the
+item in the dataset.
+
+If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` not, the data is stored in the
+[Apify Dataset](https://docs.apify.com/storage/dataset) cloud storage. Note that you can force usage of the cloud storage also by passing the
+`forceCloud` option to [`Apify.openDataset()`](../api/apify#opendataset) function, even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.
+
+**Example usage:**
+
+```javascript
+// Write a single row to the default dataset
+await Apify.pushData({ col1: 123, col2: 'val2' });
+
+// Open a named dataset
+const dataset = await Apify.openDataset('some-name');
+
+// Write a single row
+await dataset.pushData({ foo: 'bar' });
+
+// Write multiple rows
+await dataset.pushData([{ foo: 'bar2', col2: 'val2' }, { col3: 123 }]);
+```
+
+---
+
+<a name="pushdata"></a>
+
+## `dataset.pushData(data)`
+
+Stores an object or an array of objects to the dataset. The function returns a promise that resolves when the operation finishes. It has no result,
+but throws on invalid args or other errors.
+
+**IMPORTANT**: Make sure to use the `await` keyword when calling `pushData()`, otherwise the actor process might finish before the data is stored!
+
+The size of the data is limited by the receiving API and therefore `pushData()` will only allow objects whose JSON representation is smaller than 9MB.
+When an array is passed, none of the included objects may be larger than 9MB, but the array itself may be of any size.
+
+The function internally chunks the array into separate items and pushes them sequentially. The chunking process is stable (keeps order of data), but
+it does not provide a transaction safety mechanism. Therefore, in the event of an uploading error (after several automatic retries), the function's
+Promise will reject and the dataset will be left in a state where some of the items have already been saved to the dataset while other items from the
+source array were not. To overcome this limitation, the developer may, for example, read the last item saved in the dataset and re-attempt the save of
+the data from this item onwards to prevent duplicates.
+
+**Parameters**:
+
+- **`data`**: `object` | `Array<object>` - Object or array of objects containing data to be stored in the default dataset. The objects must be
+ serializable to JSON and the JSON representation of each object must be smaller than 9MB.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="getdata"></a>
+
+## `dataset.getData([options])`
+
+Returns {DatasetContent} object holding the items in the dataset based on the provided parameters.
+
+**NOTE**: If using dataset with local disk storage, the `format` option must be `json` and the following options are not supported: `unwind`,
+`disableBodyParser`, `attachment`, `bom` and `simplified`. If you try to use them, you will receive an error.
+
+**Parameters**:
+
+- **`[options]`**: `Object` - All `getData()` parameters are passed via an options object with the following keys:
+ - **`[format]`**: `string` <code> = &quot;&#x27;json&#x27;&quot;</code> - Format of the `items` property, possible values are: `json`, `csv`,
+ `xlsx`, `html`, `xml` and `rss`.
+ - **`[offset]`**: `number` <code> = 0</code> - Number of array elements that should be skipped at the start.
+ - **`[limit]`**: `number` <code> = 250000</code> - Maximum number of array elements to return.
+ - **`[desc]`**: `boolean` <code> = false</code> - If `true` then the objects are sorted by `createdAt` in descending order. Otherwise they are
+ sorted in ascending order.
+ - **`[fields]`**: `Array<string>` - An array of field names that will be included in the result. If omitted, all fields are included in the
+ results.
+ - **`[unwind]`**: `string` - Specifies a name of the field in the result objects that will be used to unwind the resulting objects. By default,
+ the results are returned as they are.
+ - **`[disableBodyParser]`**: `boolean` <code> = false</code> - If `true` then response from API will not be parsed.
+ - **`[attachment]`**: `boolean` <code> = false</code> - If `true` then the response will define the `Content-Disposition: attachment` HTTP
+ header, forcing a web browser to download the file rather than to display it. By default, this header is not present.
+ - **`[delimiter]`**: `string` <code> = &quot;&#x27;,&#x27;&quot;</code> - A delimiter character for CSV files, only used if `format` is `csv`.
+ - **`[bom]`**: `boolean` - All responses are encoded in UTF-8 encoding. By default, the CSV files are prefixed with the UTF-8 Byte Order Mark
+ (BOM), while JSON, JSONL, XML, HTML and RSS files are not. If you want to override this default behavior, set `bom` option to `true` to
+ include the BOM, or set `bom` to `false` to skip it.
+ - **`[xmlRoot]`**: `string` <code> = &quot;&#x27;results&#x27;&quot;</code> - Overrides the default root element name of the XML output. By
+ default, the root element is `results`.
+ - **`[xmlRow]`**: `string` <code> = &quot;&#x27;page&#x27;&quot;</code> - Overrides the default element name that wraps each page or page
+ function result object in XML output. By default, the element name is `page` or `result`, depending on the value of the `simplified` option.
+ - **`[skipHeaderRow]`**: `boolean` <code> = false</code> - If set to `true` then header row in CSV format is skipped.
+ - **`[clean]`**: `boolean` <code> = false</code> - If `true` then the function returns only non-empty items and skips hidden fields (i.e. fields
+ starting with `#` character). Note that the `clean` parameter is a shortcut for `skipHidden: true` and `skipEmpty: true` options.
+ - **`[skipHidden]`**: `boolean` <code> = false</code> - If `true` then the function doesn't return hidden fields (fields starting with "#"
+ character).
+ - **`[skipEmpty]`**: `boolean` <code> = false</code> - If `true` then the function doesn't return empty items. Note that in this case the
+ returned number of items might be lower than limit parameter and pagination must be done using the `limit` value.
+ - **`[simplified]`**: `boolean` - If `true` then function applies the `fields: ['url','pageFunctionResult','errorInfo']` and
+ `unwind: 'pageFunctionResult'` options. This feature is used to emulate simplified results provided by Apify API version 1 used for the legacy
+ Apify Crawler and it's not recommended to use it in new integrations.
+ - **`[skipFailedPages]`**: `boolean` - If `true` then, the all the items with errorInfo property will be skipped from the output. This feature
+ is here to emulate functionality of Apify API version 1 used for the legacy Apify Crawler product and it's not recommended to use it in new
+ integrations.
+
+**Returns**:
+
+[`Promise<DatasetContent>`](../typedefs/dataset-content)
+
+---
+
+<a name="getinfo"></a>
+
+## `dataset.getInfo()`
+
+Returns an object containing general information about the dataset.
+
+The function returns the same object as the Apify API Client's
+[getDataset](https://docs.apify.com/api/apify-client-js/latest#ApifyClient-datasets-getDataset) function, which in turn calls the
+[Get dataset](https://apify.com/docs/api/v2#/reference/datasets/dataset/get-dataset) API endpoint.
+
+**Example:**
+
+```
+{
+ id: "WkzbQMuFYuamGv3YF",
+ name: "my-dataset",
+ userId: "wRsJZtadYvn4mBZmm",
+ createdAt: new Date("2015-12-12T07:34:14.202Z"),
+ modifiedAt: new Date("2015-12-13T08:36:13.202Z"),
+ accessedAt: new Date("2015-12-14T08:36:13.202Z"),
+ itemCount: 14,
+ cleanItemCount: 10
+}
+```
+
+**Returns**:
+
+`Promise<object>`
+
+---
+
+<a name="foreach"></a>
+
+## `dataset.forEach(iteratee, [options], [index])`
+
+Iterates over dataset items, yielding each in turn to an `iteratee` function. Each invocation of `iteratee` is called with two arguments:
+`(item, index)`.
+
+If the `iteratee` function returns a Promise then it is awaited before the next call. If it throws an error, the iteration is aborted and the
+`forEach` function throws the error.
+
+**Example usage**
+
+```javascript
+const dataset = await Apify.openDataset('my-results');
+await dataset.forEach(async (item, index) => {
+ console.log(`Item at ${index}: ${JSON.stringify(item)}`);
+});
+```
+
+**Parameters**:
+
+- **`iteratee`**: [`DatasetConsumer`](../typedefs/dataset-consumer) - A function that is called for every item in the dataset.
+- **`[options]`**: `Object` - All `forEach()` parameters are passed via an options object with the following keys:
+ - **`[desc]`**: `boolean` <code> = false</code> - If `true` then the objects are sorted by `createdAt` in descending order.
+ - **`[fields]`**: `Array<string>` - If provided then returned objects will only contain specified keys.
+ - **`[unwind]`**: `string` - If provided then objects will be unwound based on provided field.
+- **`[index]`**: `number` <code> = 0</code> - Specifies the initial index number passed to the `iteratee` function.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="map"></a>
+
+## `dataset.map(iteratee, [options])`
+
+Produces a new array of values by mapping each value in list through a transformation function `iteratee()`. Each invocation of `iteratee()` is called
+with two arguments: `(element, index)`.
+
+If `iteratee` returns a `Promise` then it's awaited before a next call.
+
+**Parameters**:
+
+- **`iteratee`**: [`DatasetMapper`](../typedefs/dataset-mapper)
+- **`[options]`**: `Object` - All `map()` parameters are passed via an options object with the following keys:
+ - **`[desc]`**: `boolean` <code> = false</code> - If `true` then the objects are sorted by createdAt in descending order.
+ - **`[fields]`**: `Array<string>` - If provided then returned objects will only contain specified keys
+ - **`[unwind]`**: `string` - If provided then objects will be unwound based on provided field.
+
+**Returns**:
+
+`Promise<Array<object>>`
+
+---
+
+<a name="reduce"></a>
+
+## `dataset.reduce(iteratee, memo, [options])`
+
+Reduces a list of values down to a single value.
+
+Memo is the initial state of the reduction, and each successive step of it should be returned by `iteratee()`. The `iteratee()` is passed three
+arguments: the `memo`, then the `value` and `index` of the iteration.
+
+If no `memo` is passed to the initial invocation of reduce, the `iteratee()` is not invoked on the first element of the list. The first element is
+instead passed as the memo in the invocation of the `iteratee()` on the next element in the list.
+
+If `iteratee()` returns a `Promise` then it's awaited before a next call.
+
+**Parameters**:
+
+- **`iteratee`**: [`DatasetReducer`](../typedefs/dataset-reducer)
+- **`memo`**: `object` - Initial state of the reduction.
+- **`[options]`**: `Object` - All `reduce()` parameters are passed via an options object with the following keys:
+ - **`[desc]`**: `boolean` <code> = false</code> - If `true` then the objects are sorted by createdAt in descending order.
+ - **`[fields]`**: `Array<string>` - If provided then returned objects will only contain specified keys
+ - **`[unwind]`**: `string` - If provided then objects will be unwound based on provided field.
+
+**Returns**:
+
+`Promise<object>`
+
+---
+
+<a name="drop"></a>
+
+## `dataset.drop()`
+
+Removes the dataset either from the Apify cloud storage or from the local directory, depending on the mode of operation.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/GlobalCache.md b/website/versioned_docs/version-0.22.4/api/GlobalCache.md
new file mode 100644
index 000000000..ecc28faee
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/GlobalCache.md
@@ -0,0 +1,12 @@
+---
+id: version-0.22.4-global-cache
+title: GlobalCache
+original_id: global-cache
+---
+
+<a name="globalcache"></a>
+
+Used to manage all globally created caches, such as request queue cache or dataset cache. Before creation of this class, those caches were created as
+module scoped globals - untouchable. This proved problematic especially in tests, where caches would prevent test separation.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/Job.md b/website/versioned_docs/version-0.22.4/api/Job.md
new file mode 100644
index 000000000..f0fc425a4
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/Job.md
@@ -0,0 +1,7 @@
+---
+id: version-0.22.4-job
+title: Job
+original_id: job
+---
+
+ERROR, Cannot find class.
diff --git a/website/versioned_docs/version-0.22.4/api/KeyValueStore.md b/website/versioned_docs/version-0.22.4/api/KeyValueStore.md
new file mode 100644
index 000000000..7776834c1
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/KeyValueStore.md
@@ -0,0 +1,210 @@
+---
+id: version-0.22.4-key-value-store
+title: KeyValueStore
+original_id: key-value-store
+---
+
+<a name="keyvaluestore"></a>
+
+The `KeyValueStore` class represents a key-value store, a simple data storage that is used for saving and reading data records or files. Each data
+record is represented by a unique key and associated with a MIME content type. Key-value stores are ideal for saving screenshots, actor inputs and
+outputs, web pages, PDFs or to persist the state of crawlers.
+
+Do not instantiate this class directly, use the [`Apify.openKeyValueStore()`](../api/apify#openkeyvaluestore) function instead.
+
+Each actor run is associated with a default key-value store, which is created exclusively for the run. By convention, the actor input and output are
+stored into the default key-value store under the `INPUT` and `OUTPUT` key, respectively. Typically, input and output are JSON files, although it can
+be any other format. To access the default key-value store directly, you can use the [`Apify.getValue()`](../api/apify#getvalue) and
+[`Apify.setValue()`](../api/apify#setvalue) convenience functions.
+
+To access the input, you can also use the [`Apify.getInput()`](../api/apify#getinput) convenience function.
+
+`KeyValueStore` stores its data either on local disk or in the Apify cloud, depending on whether the
+[`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir) or [`APIFY_TOKEN`](../guides/environment-variables#apify_token)
+environment variables are set.
+
+If the `APIFY_LOCAL_STORAGE_DIR` environment variable is set, the data is stored in the local directory in the following files:
+
+```
+{APIFY_LOCAL_STORAGE_DIR}/key_value_stores/{STORE_ID}/{INDEX}.{EXT}
+```
+
+Note that `{STORE_ID}` is the name or ID of the key-value store. The default key-value store has ID: `default`, unless you override it by setting the
+`APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable. The `{KEY}` is the key of the record and `{EXT}` corresponds to the MIME content type of the
+data value.
+
+If the [`APIFY_TOKEN`](../guides/environment-variables#apify_token) environment variable is set but
+[`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir) not, the data is stored in the
+[Apify Key-value store](https://docs.apify.com/storage/key-value-store) cloud storage. Note that you can force usage of the cloud storage also by
+passing the `forceCloud` option to [`Apify.openKeyValueStore()`](../api/apify#openkeyvaluestore) function, even if the
+[`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir) variable is set.
+
+**Example usage:**
+
+```javascript
+// Get actor input from the default key-value store
+const input = await Apify.getInput();
+const otherValue = Apify.getValue('my-key');
+
+// Write actor output to the default key-value store.
+await Apify.setValue('OUTPUT', { myResult: 123 });
+
+// Open a named key-value store
+const store = await Apify.openKeyValueStore('some-name');
+
+// Write a record. JavaScript object is automatically converted to JSON,
+// strings and binary buffers are stored as they are
+await store.setValue('some-key', { foo: 'bar' });
+
+// Read a record. Note that JSON is automatically parsed to a JavaScript object,
+// text data returned as a string and other data is returned as binary buffer
+const value = await store.getValue('some-key');
+
+// Drop (delete) the store
+await store.drop();
+```
+
+---
+
+<a name="getvalue"></a>
+
+## `keyValueStore.getValue(key)`
+
+Gets a value from the key-value store.
+
+The function returns a `Promise` that resolves to the record value, whose JavaScript type depends on the MIME content type of the record. Records with
+the `application/json` content type are automatically parsed and returned as a JavaScript object. Similarly, records with `text/plain` content types
+are returned as a string. For all other content types, the value is returned as a raw [`Buffer`](https://nodejs.org/api/buffer.html) instance.
+
+If the record does not exist, the function resolves to `null`.
+
+To save or delete a value in the key-value store, use the [`KeyValueStore.setValue()`](../api/key-value-store#setvalue) function.
+
+**Example usage:**
+
+```javascript
+const store = await Apify.openKeyValueStore();
+const buffer = await store.getValue('screenshot1.png');
+```
+
+**Parameters**:
+
+- **`key`**: `string` - Unique key of the record. It can be at most 256 characters long and only consist of the following characters: `a`-`z`,
+ `A`-`Z`, `0`-`9` and `!-_.'()`
+
+**Returns**:
+
+`Promise<(object|Buffer|string|null)>` - Returns a promise that resolves to an object, string or [`Buffer`](https://nodejs.org/api/buffer.html),
+depending on the MIME content type of the record.
+
+---
+
+<a name="setvalue"></a>
+
+## `keyValueStore.setValue(key, value, [options])`
+
+Saves or deletes a record in the key-value store. The function returns a promise that resolves once the record has been saved or deleted.
+
+**Example usage:**
+
+```javascript
+const store = await Apify.openKeyValueStore();
+await store.setValue('OUTPUT', { foo: 'bar' });
+```
+
+Beware that the key can be at most 256 characters long and only contain the following characters: `a-zA-Z0-9!-_.'()`
+
+By default, `value` is converted to JSON and stored with the `application/json; charset=utf-8` MIME content type. To store the value with another
+content type, pass it in the options as follows:
+
+```javascript
+const store = await Apify.openKeyValueStore('my-text-store');
+await store.setValue('RESULTS', 'my text data', { contentType: 'text/plain' });
+```
+
+If you set custom content type, `value` must be either a string or [`Buffer`](https://nodejs.org/api/buffer.html), otherwise an error will be thrown.
+
+If `value` is `null`, the record is deleted instead. Note that the `setValue()` function succeeds regardless whether the record existed or not.
+
+To retrieve a value from the key-value store, use the [`KeyValueStore.getValue()`](../api/key-value-store#getvalue) function.
+
+**IMPORTANT:** Always make sure to use the `await` keyword when calling `setValue()`, otherwise the actor process might finish before the value is
+stored!
+
+**Parameters**:
+
+- **`key`**: `string` - Unique key of the record. It can be at most 256 characters long and only consist of the following characters: `a`-`z`,
+ `A`-`Z`, `0`-`9` and `!-_.'()`
+- **`value`**: `Object` | `string` | `Buffer` | `null` - Record data, which can be one of the following values:
+ - If `null`, the record in the key-value store is deleted.
+ - If no `options.contentType` is specified, `value` can be any JavaScript object and it will be stringified to JSON.
+ - If `options.contentType` is set, `value` is taken as is and it must be a `String` or [`Buffer`](https://nodejs.org/api/buffer.html). For any
+ other value an error will be thrown.
+- **`[options]`**: `Object`
+ - **`[contentType]`**: `string` - Specifies a custom MIME content type of the record.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="drop"></a>
+
+## `keyValueStore.drop()`
+
+Removes the key-value store either from the Apify cloud storage or from the local directory, depending on the mode of operation.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="getpublicurl"></a>
+
+## `keyValueStore.getPublicUrl(key)`
+
+Returns a URL for the given key that may be used to publicly access the value in the remote key-value store.
+
+**Parameters**:
+
+- **`key`**: `string`
+
+**Returns**:
+
+`string`
+
+---
+
+<a name="foreachkey"></a>
+
+## `keyValueStore.forEachKey(iteratee, [options])`
+
+Iterates over key-value store keys, yielding each in turn to an `iteratee` function. Each invocation of `iteratee` is called with three arguments:
+`(key, index, info)`, where `key` is the record key, `index` is a zero-based index of the key in the current iteration (regardless of
+`options.exclusiveStartKey`) and `info` is an object that contains a single property `size` indicating size of the record in bytes.
+
+If the `iteratee` function returns a Promise then it is awaited before the next call. If it throws an error, the iteration is aborted and the
+`forEachKey` function throws the error.
+
+**Example usage**
+
+```javascript
+const keyValueStore = await Apify.openKeyValueStore();
+await keyValueStore.forEachKey(async (key, index, info) => {
+ console.log(`Key at ${index}: ${key} has size ${info.size}`);
+});
+```
+
+**Parameters**:
+
+- **`iteratee`**: [`KeyConsumer`](../typedefs/key-consumer) - A function that is called for every key in the key-value store.
+- **`[options]`**: `Object` - All `forEachKey()` parameters are passed via an options object with the following keys:
+ - **`[exclusiveStartKey]`**: `string` - All keys up to this one (including) are skipped from the result.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/LiveViewServer.md b/website/versioned_docs/version-0.22.4/api/LiveViewServer.md
new file mode 100644
index 000000000..8cdc1b74f
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/LiveViewServer.md
@@ -0,0 +1,119 @@
+---
+id: version-0.22.4-live-view-server
+title: LiveViewServer
+original_id: live-view-server
+---
+
+<a name="liveviewserver"></a>
+
+`LiveViewServer` enables serving of browser snapshots via web sockets. It includes its own client that provides a simple frontend to viewing the
+captured snapshots. A snapshot consists of three pieces of information, the currently opened URL, the content of the page (HTML) and its screenshot.
+
+```json
+{
+ "pageUrl": "https://www.example.com",
+ "htmlContent": "<html><body> ....",
+ "screenshotIndex": 3,
+ "createdAt": "2019-04-18T11:50:40.060Z"
+}
+```
+
+`LiveViewServer` is useful when you want to be able to inspect the current browser status on demand. When no client is connected, the webserver
+consumes very low resources so it should have a close to zero impact on performance. Only once a client connects the server will start serving
+snapshots. Once no longer needed, it can be disabled again in the client to remove any performance impact.
+
+NOTE: Screenshot taking in browser typically takes around 300ms. So having the `LiveViewServer` always serve snapshots will have a significant impact
+on performance.
+
+When using [`PuppeteerPool`](/docs/api/puppeteer-pool), the `LiveViewServer` can be easily used just by providing the `useLiveView = true` option to
+the [`PuppeteerPool`](/docs/api/puppeteer-pool). It can also be initiated via [`PuppeteerCrawler`](/docs/api/puppeteer-crawler)
+`puppeteerPoolOptions`.
+
+It will take snapshots of the first page of the latest browser. Taking snapshots of only a single page improves performance and stability dramatically
+in high concurrency situations.
+
+When running locally, it is often best to use a headful browser for debugging, since it provides a better view into the browser, including DevTools,
+but `LiveViewServer` works too.
+
+---
+
+<a name="liveviewserver"></a>
+
+## `new LiveViewServer([options])`
+
+**Parameters**:
+
+- **`[options]`**: `Object` - All `LiveViewServer` parameters are passed via an options object with the following keys:
+ - **`[screenshotDirectoryPath]`**: `string` - By default, the screenshots are saved to the `live_view` directory in the Apify local storage
+ directory. Provide a different absolute path to change the settings.
+ - **`[maxScreenshotFiles]`**: `number` <code> = 10</code> - Limits the number of screenshots stored by the server. This is to prevent using up
+ too much disk space.
+ - **`[snapshotTimeoutSecs]`**: `number` <code> = 3</code> - If a snapshot is not made within the timeout, its creation will be aborted. This is
+ to prevent pages from being hung up by a stalled screenshot.
+ - **`[maxSnapshotFrequencySecs]`**: `number` <code> = 2</code> - Use this parameter to further decrease the resource consumption of
+ `LiveViewServer` by limiting the frequency at which it'll serve snapshots.
+
+---
+
+<a name="start"></a>
+
+## `liveViewServer.start()`
+
+Starts the HTTP server with web socket connections enabled. Snapshots will not be created until a client has connected.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="stop"></a>
+
+## `liveViewServer.stop()`
+
+Prevents the server from receiving more connections. Existing connections will not be terminated, but the server will not prevent a process exit.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="serve"></a>
+
+## `liveViewServer.serve(page)`
+
+Serves a snapshot to all connected clients. Screenshots are not served directly, only their index number which is used by client to retrieve the
+screenshot.
+
+Will time out and throw in `options.snapshotTimeoutSecs`.
+
+**Parameters**:
+
+- **`page`**: `Page`
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="isrunning"></a>
+
+## `liveViewServer.isRunning()`
+
+**Returns**:
+
+`boolean`
+
+---
+
+<a name="hasclients"></a>
+
+## `liveViewServer.hasClients()`
+
+**Returns**:
+
+`boolean`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/PlaywrightCrawler.md b/website/versioned_docs/version-0.22.4/api/PlaywrightCrawler.md
new file mode 100644
index 000000000..c25b1632d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/PlaywrightCrawler.md
@@ -0,0 +1,132 @@
+---
+id: version-0.22.4-playwright-crawler
+title: PlaywrightCrawler
+original_id: playwright-crawler
+---
+
+<a name="playwrightcrawler"></a>
+
+Provides a simple framework for parallel crawling of web pages using headless Chromium, Firefox and Webkit browsers with
+[Playwright](https://github.com/microsoft/playwright). The URLs to crawl are fed either from a static list of URLs or from a dynamic queue of URLs
+enabling recursive crawling of websites.
+
+Since `Playwright` uses headless browser to download web pages and extract data, it is useful for crawling of websites that require to execute
+JavaScript. If the target website doesn't need JavaScript, consider using [`CheerioCrawler`](../api/cheerio-crawler), which downloads the pages using
+raw HTTP requests and is about 10x faster.
+
+The source URLs are represented using [`Request`](../api/request) objects that are fed from [`RequestList`](../api/request-list) or
+[`RequestQueue`](../api/request-queue) instances provided by the [`BasicCrawlerOptions.requestList`](../typedefs/basic-crawler-options#requestlist) or
+[`BasicCrawlerOptions.requestQueue`](../typedefs/basic-crawler-options#requestqueue) constructor options, respectively.
+
+If both [`BasicCrawlerOptions.requestList`](../typedefs/basic-crawler-options#requestlist) and
+[`BasicCrawlerOptions.requestQueue`](../typedefs/basic-crawler-options#requestqueue) are used, the instance first processes URLs from the
+[`RequestList`](../api/request-list) and automatically enqueues all of them to [`RequestQueue`](../api/request-queue) before it starts their
+processing. This ensures that a single URL is not crawled multiple times.
+
+The crawler finishes when there are no more [`Request`](../api/request) objects to crawl.
+
+`PuppeteerCrawler` opens a new Chrome page (i.e. tab) for each [`Request`](../api/request) object to crawl and then calls the function provided by
+user as the [`PlaywrightCrawlerOptions.handlePageFunction`](../typedefs/playwright-crawler-options#handlepagefunction) option.
+
+New pages are only opened when there is enough free CPU and memory available, using the functionality provided by the
+[`AutoscaledPool`](../api/autoscaled-pool) class. All [`AutoscaledPool`](../api/autoscaled-pool) configuration options can be passed to the
+[`BasicCrawlerOptions.autoscaledPoolOptions`](../typedefs/basic-crawler-options#autoscaledpooloptions) parameter of the `PuppeteerCrawler`
+constructor. For user convenience, the `minConcurrency` and `maxConcurrency` [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options) are
+available directly in the `PuppeteerCrawler` constructor.
+
+Note that the pool of Puppeteer instances is internally managed by the `BrowserPool` class. Many constructor options such as
+`PuppeteerPoolOptions.maxOpenPagesPerInstance` or
+
+**Example usage:**
+
+```javascript
+const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ handlePageFunction: async ({ page, request }) => {
+ // This function is called to extract data from a single web page
+ // 'page' is an instance of Puppeteer.Page with page.goto(request.url) already called
+ // 'request' is an instance of Request class with information about the page to load
+ await Apify.pushData({
+ title: await page.title(),
+ url: request.url,
+ succeeded: true,
+ });
+ },
+ handleFailedRequestFunction: async ({ request }) => {
+ // This function is called when the crawling of a request failed too many times
+ await Apify.pushData({
+ url: request.url,
+ succeeded: false,
+ errors: request.errorMessages,
+ });
+ },
+});
+
+await crawler.run();
+```
+
+## Properties
+
+### `stats`
+
+**Type**: [`Statistics`](../api/statistics)
+
+Contains statistics about the current run.
+
+---
+
+### `requestList`
+
+**Type**: [`RequestList`](../api/request-list)
+
+A reference to the underlying [`RequestList`](../api/request-list) class that manages the crawler's [`Request`](../api/request)s. Only available if
+used by the crawler.
+
+---
+
+### `requestQueue`
+
+**Type**: [`RequestQueue`](../api/request-queue)
+
+A reference to the underlying [`RequestQueue`](../api/request-queue) class that manages the crawler's [`Request`](../api/request)s. Only available if
+used by the crawler.
+
+---
+
+### `sessionPool`
+
+**Type**: [`SessionPool`](../api/session-pool)
+
+A reference to the underlying [`SessionPool`](../api/session-pool) class that manages the crawler's [`Session`](../api/session)s. Only available if
+used by the crawler.
+
+---
+
+### `proxyConfiguration`
+
+**Type**: [`ProxyConfiguration`](../api/proxy-configuration)
+
+A reference to the underlying [`ProxyConfiguration`](../api/proxy-configuration) class that manages the crawler's proxies. Only available if used by
+the crawler.
+
+---
+
+### `browserPool`
+
+**Type**: `BrowserPool`
+
+A reference to the underlying `BrowserPool` class that manages the crawler's browsers. For more information about it, see the
+[`browser-pool` module](https://github.com/apify/browser-pool).
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler. Note that this property is
+only initialized after calling the [`CheerioCrawler.run()`](../api/cheerio-crawler#run) function. You can use it to change the concurrency settings on
+the fly, to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause) or to abort it by calling
+[`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/ProxyConfiguration.md b/website/versioned_docs/version-0.22.4/api/ProxyConfiguration.md
new file mode 100644
index 000000000..4cca2ee98
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/ProxyConfiguration.md
@@ -0,0 +1,100 @@
+---
+id: version-0.22.4-proxy-configuration
+title: ProxyConfiguration
+original_id: proxy-configuration
+---
+
+<a name="proxyconfiguration"></a>
+
+Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking your crawlers based
+on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures them to use the selected proxies for
+all connections. You can get information about the currently used proxy by inspecting the [`ProxyInfo`](../typedefs/proxy-info) property in your
+crawler's page function. There, you can inspect the proxy's URL and other attributes.
+
+The proxy servers are managed by [Apify Proxy](https://docs.apify.com/proxy). To be able to use Apify Proxy, you need an Apify account and access to
+the selected proxies. If you provide no configuration option, the proxies will be managed automatically using a smart algorithm.
+
+If you want to use your own proxies, use the [`ProxyConfigurationOptions.proxyUrls`](../typedefs/proxy-configuration-options#proxyurls) option. Your
+list of proxy URLs will be rotated by the configuration if this option is provided.
+
+**Example usage:**
+
+```javascript
+
+const proxyConfiguration = await Apify.createProxyConfiguration({
+ groups: ['GROUP1', 'GROUP2'] // List of Apify Proxy groups
+ countryCode: 'US',
+});
+
+const crawler = new Apify.CheerioCrawler({
+ // ...
+ proxyConfiguration,
+ handlePageFunction: ({ proxyInfo }) => {
+ const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
+ }
+})
+
+```
+
+---
+
+<a name="initialize"></a>
+
+## `proxyConfiguration.initialize()`
+
+Loads proxy password if token is provided and checks access to Apify Proxy and provided proxy groups if Apify Proxy configuration is used. Also checks
+if country has access to Apify Proxy groups if the country code is provided.
+
+You should use the [`Apify.createProxyConfiguration`](../api/apify#createproxyconfiguration) function to create a pre-initialized `ProxyConfiguration`
+instance instead of calling this manually.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="newproxyinfo"></a>
+
+## `proxyConfiguration.newProxyInfo([sessionId])`
+
+This function creates a new [`ProxyInfo`](../typedefs/proxy-info) info object. It is used by CheerioCrawler and PuppeteerCrawler to generate proxy
+URLs and also to allow the user to inspect the currently used proxy via the handlePageFunction parameter: proxyInfo. Use it if you want to work with a
+rich representation of a proxy URL. If you need the URL string only, use [`ProxyConfiguration.newUrl`](../api/proxy-configuration#newurl).
+
+**Parameters**:
+
+- **`[sessionId]`**: `string` | `number` - Represents the identifier of user [`Session`](../api/session) that can be managed by the
+ [`SessionPool`](../api/session-pool) or you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier. When the provided
+ sessionId is a number, it's converted to a string. Property sessionId of [`ProxyInfo`](../typedefs/proxy-info) is always returned as a type
+ string.
+
+All the HTTP requests going through the proxy with the same session identifier will use the same target proxy server (i.e. the same IP address). The
+identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
+
+**Returns**:
+
+[`ProxyInfo`](../typedefs/proxy-info) - represents information about used proxy and its configuration.
+
+---
+
+<a name="newurl"></a>
+
+## `proxyConfiguration.newUrl([sessionId])`
+
+Returns a new proxy URL based on provided configuration options and the `sessionId` parameter.
+
+**Parameters**:
+
+- **`[sessionId]`**: `string` | `number` - Represents the identifier of user [`Session`](../api/session) that can be managed by the
+ [`SessionPool`](../api/session-pool) or you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier. When the provided
+ sessionId is a number, it's converted to a string.
+
+All the HTTP requests going through the proxy with the same session identifier will use the same target proxy server (i.e. the same IP address). The
+identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
+
+**Returns**:
+
+`string` - represents the proxy URL.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/PseudoUrl.md b/website/versioned_docs/version-0.22.4/api/PseudoUrl.md
new file mode 100644
index 000000000..657b60958
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/PseudoUrl.md
@@ -0,0 +1,101 @@
+---
+id: version-0.22.4-pseudo-url
+title: PseudoUrl
+original_id: pseudo-url
+---
+
+<a name="pseudourl"></a>
+
+Represents a pseudo-URL (PURL) - an URL pattern used by web crawlers to specify which URLs should the crawler visit. This class is used by the
+[`utils.enqueueLinks()`](../api/utils#enqueuelinks) function.
+
+A PURL is simply a URL with special directives enclosed in `[]` brackets. Currently, the only supported directive is `[RegExp]`, which defines a
+JavaScript-style regular expression to match against the URL.
+
+The `PseudoUrl` class can be constructed either using a pseudo-URL string or a regular expression (an instance of the `RegExp` object). With a
+pseudo-URL string, the matching is always case-insensitive. If you need case-sensitive matching, use an appropriate `RegExp` object.
+
+For example, a PURL `http://www.example.com/pages/[(\w|-)*]` will match all of the following URLs:
+
+- `http://www.example.com/pages/`
+- `http://www.example.com/pages/my-awesome-page`
+- `http://www.example.com/pages/something`
+
+Be careful to correctly escape special characters in the pseudo-URL string. If either `[` or `]` is part of the normal query string, it must be
+encoded as `[\x5B]` or `[\x5D]`, respectively. For example, the following PURL:
+
+```http
+http://www.example.com/search?do[\x5B]load[\x5D]=1
+```
+
+will match the URL:
+
+```http
+http://www.example.com/search?do[load]=1
+```
+
+If the regular expression in the pseudo-URL contains a backslash character (\), you need to escape it with another back backslash, as shown in the
+example below.
+
+**Example usage:**
+
+```javascript
+// Using a pseudo-URL string
+const purl = new Apify.PseudoUrl('http://www.example.com/pages/[(\\w|-)+]', {
+ userData: { foo: 'bar' },
+});
+
+// Using a regular expression
+const purl2 = new Apify.PseudoUrl(/http:\/\/www\.example\.com\/pages\/(\w|-)+/);
+
+if (purl.matches('http://www.example.com/pages/my-awesome-page')) console.log('Match!');
+```
+
+---
+
+<a name="pseudourl"></a>
+
+## `new PseudoUrl(purl, requestTemplate)`
+
+**Parameters**:
+
+- **`purl`**: `string` | `RegExp` - A pseudo-URL string or a regular expression object. Using a `RegExp` instance enables more granular control,
+ such as making the matching case sensitive.
+- **`requestTemplate`**: [`RequestOptions`](../typedefs/request-options) - Options for the new [`Request`](../api/request) instances created for
+ matching URLs by the [`utils.enqueueLinks()`](../api/utils#enqueuelinks) function.
+
+---
+
+<a name="matches"></a>
+
+## `pseudoUrl.matches(url)`
+
+Determines whether a URL matches this pseudo-URL pattern.
+
+**Parameters**:
+
+- **`url`**: `string` - URL to be matched.
+
+**Returns**:
+
+`boolean` - Returns `true` if given URL matches pseudo-URL.
+
+---
+
+<a name="createrequest"></a>
+
+## `pseudoUrl.createRequest(urlOrProps)`
+
+Creates a Request object from a provided `requestTemplate` and a given URL or an object that specifies \$[`Request`](../api/request) properties. In
+case of a collision the properties will override the template, except for `userData`, which will be merged together, with the `userData` property
+having preference over the template. This enables dynamic overriding of the template.
+
+**Parameters**:
+
+- **`urlOrProps`**: `string` | `Object`
+
+**Returns**:
+
+[`Request`](../api/request)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/PuppeteerCrawler.md b/website/versioned_docs/version-0.22.4/api/PuppeteerCrawler.md
new file mode 100644
index 000000000..0056086c8
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/PuppeteerCrawler.md
@@ -0,0 +1,104 @@
+---
+id: version-0.22.4-puppeteer-crawler
+title: PuppeteerCrawler
+original_id: puppeteer-crawler
+---
+
+<a name="puppeteercrawler"></a>
+
+Provides a simple framework for parallel crawling of web pages using headless Chrome with [Puppeteer](https://github.com/puppeteer/puppeteer). The
+URLs to crawl are fed either from a static list of URLs or from a dynamic queue of URLs enabling recursive crawling of websites.
+
+Since `PuppeteerCrawler` uses headless Chrome to download web pages and extract data, it is useful for crawling of websites that require to execute
+JavaScript. If the target website doesn't need JavaScript, consider using [`CheerioCrawler`](../api/cheerio-crawler), which downloads the pages using
+raw HTTP requests and is about 10x faster.
+
+The source URLs are represented using [`Request`](../api/request) objects that are fed from [`RequestList`](../api/request-list) or
+[`RequestQueue`](../api/request-queue) instances provided by the
+[`PuppeteerCrawlerOptions.requestList`](../typedefs/puppeteer-crawler-options#requestlist) or
+[`PuppeteerCrawlerOptions.requestQueue`](../typedefs/puppeteer-crawler-options#requestqueue) constructor options, respectively.
+
+If both [`PuppeteerCrawlerOptions.requestList`](../typedefs/puppeteer-crawler-options#requestlist) and
+[`PuppeteerCrawlerOptions.requestQueue`](../typedefs/puppeteer-crawler-options#requestqueue) are used, the instance first processes URLs from the
+[`RequestList`](../api/request-list) and automatically enqueues all of them to [`RequestQueue`](../api/request-queue) before it starts their
+processing. This ensures that a single URL is not crawled multiple times.
+
+The crawler finishes when there are no more [`Request`](../api/request) objects to crawl.
+
+`PuppeteerCrawler` opens a new Chrome page (i.e. tab) for each [`Request`](../api/request) object to crawl and then calls the function provided by
+user as the [`PuppeteerCrawlerOptions.handlePageFunction`](../typedefs/puppeteer-crawler-options#handlepagefunction) option.
+
+New pages are only opened when there is enough free CPU and memory available, using the functionality provided by the
+[`AutoscaledPool`](../api/autoscaled-pool) class. All [`AutoscaledPool`](../api/autoscaled-pool) configuration options can be passed to the
+[`PuppeteerCrawlerOptions.autoscaledPoolOptions`](../typedefs/puppeteer-crawler-options#autoscaledpooloptions) parameter of the `PuppeteerCrawler`
+constructor. For user convenience, the `minConcurrency` and `maxConcurrency` [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options) are
+available directly in the `PuppeteerCrawler` constructor.
+
+Note that the pool of Puppeteer instances is internally managed by the [`PuppeteerPool`](../api/puppeteer-pool) class. Many constructor options such
+as [`PuppeteerPoolOptions.maxOpenPagesPerInstance`](../typedefs/puppeteer-pool-options#maxopenpagesperinstance) or
+[`PuppeteerPoolOptions.launchPuppeteerFunction`](../typedefs/puppeteer-pool-options#launchpuppeteerfunction) are passed directly to the
+[`PuppeteerPool`](../api/puppeteer-pool) constructor.
+
+**Example usage:**
+
+```javascript
+const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ handlePageFunction: async ({ page, request }) => {
+ // This function is called to extract data from a single web page
+ // 'page' is an instance of Puppeteer.Page with page.goto(request.url) already called
+ // 'request' is an instance of Request class with information about the page to load
+ await Apify.pushData({
+ title: await page.title(),
+ url: request.url,
+ succeeded: true,
+ });
+ },
+ handleFailedRequestFunction: async ({ request }) => {
+ // This function is called when the crawling of a request failed too many times
+ await Apify.pushData({
+ url: request.url,
+ succeeded: false,
+ errors: request.errorMessages,
+ });
+ },
+});
+
+await crawler.run();
+```
+
+## Properties
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler. Note that this property is
+only initialized after calling the [`PuppeteerCrawler.run()`](../api/puppeteer-crawler#run) function. You can use it to change the concurrency
+settings on the fly, to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause) or to abort it by calling
+[`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+---
+
+<a name="puppeteercrawler"></a>
+
+## `new PuppeteerCrawler(options)`
+
+**Parameters**:
+
+- **`options`**: [`PuppeteerCrawlerOptions`](../typedefs/puppeteer-crawler-options) - All `PuppeteerCrawler` parameters are passed via an options
+ object.
+
+---
+
+<a name="run"></a>
+
+## `puppeteerCrawler.run()`
+
+Runs the crawler. Returns promise that gets resolved once all the requests got processed.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/PuppeteerPool.md b/website/versioned_docs/version-0.22.4/api/PuppeteerPool.md
new file mode 100644
index 000000000..0075578f6
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/PuppeteerPool.md
@@ -0,0 +1,130 @@
+---
+id: version-0.22.4-puppeteer-pool
+title: PuppeteerPool
+original_id: puppeteer-pool
+---
+
+<a name="puppeteerpool"></a>
+
+Manages a pool of Chrome browser instances controlled using [Puppeteer](https://github.com/puppeteer/puppeteer).
+
+`PuppeteerPool` reuses Chrome instances and tabs using specific browser rotation and retirement policies. This is useful in order to facilitate
+rotation of proxies, cookies or other settings in order to prevent detection of your web scraping bot, access web pages from various countries etc.
+
+Additionally, the reuse of browser instances instances speeds up crawling, and the retirement of instances helps mitigate effects of memory leaks in
+Chrome.
+
+`PuppeteerPool` is internally used by the [`PuppeteerCrawler`](../api/puppeteer-crawler) class.
+
+**Example usage:**
+
+```javascript
+const puppeteerPool = new PuppeteerPool({
+ launchPuppeteerOptions: {
+ // Use Chrome instead of Chromium
+ useChrome: true,
+ // Hide from bot detection
+ stealth: true,
+ },
+});
+
+const page1 = await puppeteerPool.newPage();
+const page2 = await puppeteerPool.newPage();
+
+// ... do something with the pages ...
+
+// Close all browsers.
+await puppeteerPool.destroy();
+```
+
+---
+
+<a name="puppeteerpool"></a>
+
+## `new PuppeteerPool([options])`
+
+**Parameters**:
+
+- **`[options]`**: [`PuppeteerPoolOptions`](../typedefs/puppeteer-pool-options) - All `PuppeteerPool` parameters are passed via an options object.
+
+---
+
+<a name="newpage"></a>
+
+## `puppeteerPool.newPage()`
+
+Produces a new page instance either by reusing an idle page that currently isn't processing any request or by spawning a new page (new browser tab) in
+one of the available browsers when no idle pages are available.
+
+To spawn a new browser tab for each page, set the `reusePages` constructor option to false.
+
+**Returns**:
+
+`Promise<Page>`
+
+---
+
+<a name="destroy"></a>
+
+## `puppeteerPool.destroy()`
+
+Closes all open browsers.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="retire"></a>
+
+## `puppeteerPool.retire(browser)`
+
+Manually retires a Puppeteer [`Browser`](https://pptr.dev/#?product=Puppeteer&show=api-class-browser) instance from the pool. The browser will
+continue to process open pages so that they may gracefully finish. This is unlike `browser.close()` which will forcibly terminate the browser and all
+open pages will be closed.
+
+**Parameters**:
+
+- **`browser`**: `Browser`
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="recyclepage"></a>
+
+## `puppeteerPool.recyclePage(page)`
+
+Closes the page, unless the `reuseTabs` option is set to true. Then it would only flag the page for a future reuse, without actually closing it.
+
+NOTE: LiveView snapshotting is tied to this function. When `useLiveView` option is set to true, a snapshot of the page will be taken just before
+closing the page or flagging it for reuse.
+
+**Parameters**:
+
+- **`page`**: `Page`
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="serveliveviewsnapshot"></a>
+
+## `puppeteerPool.serveLiveViewSnapshot(page)`
+
+Tells the connected LiveViewServer to serve a snapshot when available.
+
+**Parameters**:
+
+- **`page`**: `Page`
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/Request.md b/website/versioned_docs/version-0.22.4/api/Request.md
new file mode 100644
index 000000000..d3e03d2db
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/Request.md
@@ -0,0 +1,163 @@
+---
+id: version-0.22.4-request
+title: Request
+original_id: request
+---
+
+<a name="request"></a>
+
+Represents a URL to be crawled, optionally including HTTP method, headers, payload and other metadata. The `Request` object also stores information
+about errors that occurred during processing of the request.
+
+Each `Request` instance has the `uniqueKey` property, which can be either specified manually in the constructor or generated automatically from the
+URL. Two requests with the same `uniqueKey` are considered as pointing to the same web resource. This behavior applies to all Apify SDK classes, such
+as [`RequestList`](../api/request-list), [`RequestQueue`](../api/request-queue) or [`PuppeteerCrawler`](../api/puppeteer-crawler).
+
+Example use:
+
+```javascript
+const request = new Apify.Request({
+ url: 'http://www.example.com',
+ headers: { Accept: 'application/json' },
+});
+
+...
+
+request.userData.foo = 'bar';
+request.pushErrorMessage(new Error('Request failed!'));
+
+...
+
+const foo = request.userData.foo;
+```
+
+## Properties
+
+### `id`
+
+**Type**: `string`
+
+Request ID
+
+---
+
+### `url`
+
+**Type**: `string`
+
+URL of the web page to crawl.
+
+---
+
+### `loadedUrl`
+
+**Type**: `string`
+
+An actually loaded URL after redirects, if present. HTTP redirects are guaranteed to be included.
+
+When using [`PuppeteerCrawler`](../api/puppeteer-crawler), meta tag and JavaScript redirects may, or may not be included, depending on their nature.
+This generally means that redirects, which happen immediately will most likely be included, but delayed redirects will not.
+
+---
+
+### `uniqueKey`
+
+**Type**: `string`
+
+A unique key identifying the request. Two requests with the same `uniqueKey` are considered as pointing to the same URL.
+
+---
+
+### `method`
+
+**Type**: `string`
+
+HTTP method, e.g. `GET` or `POST`.
+
+---
+
+### `payload`
+
+**Type**: `string` | `Buffer`
+
+HTTP request payload, e.g. for POST requests.
+
+---
+
+### `noRetry`
+
+**Type**: `boolean`
+
+The `true` value indicates that the request will not be automatically retried on error.
+
+---
+
+### `retryCount`
+
+**Type**: `number`
+
+Indicates the number of times the crawling of the request has been retried on error.
+
+---
+
+### `errorMessages`
+
+**Type**: `Array<string>`
+
+An array of error messages from request processing.
+
+---
+
+### `headers`
+
+**Type**: `object`
+
+Object with HTTP headers. Key is header name, value is the value.
+
+---
+
+### `userData`
+
+**Type**: `object`
+
+Custom user data assigned to the request.
+
+---
+
+### `handledAt`
+
+**Type**: `Date`
+
+Indicates the time when the request has been processed. Is `null` if the request has not been crawled yet.
+
+---
+
+<a name="request"></a>
+
+## `new Request(options)`
+
+**Parameters**:
+
+- **`options`**: [`RequestOptions`](../typedefs/request-options) - `Request` parameters including the URL, HTTP method and headers, and others.
+
+---
+
+<a name="pusherrormessage"></a>
+
+## `request.pushErrorMessage(errorOrMessage, [options])`
+
+Stores information about an error that occurred during processing of this request.
+
+You should always use Error instances when throwing errors in JavaScript.
+
+Nevertheless, to improve the debugging experience when using third party libraries that may not always throw an Error instance, the function performs
+a type inspection of the passed argument and attempts to extract as much information as possible, since just throwing a bad type error makes any
+debugging rather difficult.
+
+**Parameters**:
+
+- **`errorOrMessage`**: `Error` | `string` - Error object or error message to be stored in the request.
+- **`[options]`**: `Object`
+ - **`[omitStack]`**: `boolean` <code> = false</code> - Only push the error message without stack trace when true.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/RequestList.md b/website/versioned_docs/version-0.22.4/api/RequestList.md
new file mode 100644
index 000000000..2a83d12da
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/RequestList.md
@@ -0,0 +1,213 @@
+---
+id: version-0.22.4-request-list
+title: RequestList
+original_id: request-list
+---
+
+<a name="requestlist"></a>
+
+Represents a static list of URLs to crawl. The URLs can be provided either in code or parsed from a text file hosted on the web.
+
+Each URL is represented using an instance of the [`Request`](../api/request) class. The list can only contain unique URLs. More precisely, it can only
+contain `Request` instances with distinct `uniqueKey` properties. By default, `uniqueKey` is generated from the URL, but it can also be overridden. To
+add a single URL to the list multiple times, corresponding [`Request`](../api/request) objects will need to have different `uniqueKey` properties. You
+can use the `keepDuplicateUrls` option to do this for you when initializing the `RequestList` from sources.
+
+Once you create an instance of `RequestList`, you need to call the [`RequestList.initialize()`](../api/request-list#initialize) function before the
+instance can be used. After that, no more URLs can be added to the list.
+
+`RequestList` is used by [`BasicCrawler`](../api/basic-crawler), [`CheerioCrawler`](../api/cheerio-crawler) and
+[`PuppeteerCrawler`](../api/puppeteer-crawler) as a source of URLs to crawl. Unlike [`RequestQueue`](../api/request-queue), `RequestList` is static
+but it can contain even millions of URLs.
+
+`RequestList` has an internal state where it stores information about which requests were already handled, which are in progress and which were
+reclaimed. The state may be automatically persisted to the default [`KeyValueStore`](../api/key-value-store) by setting the `persistStateKey` option
+so that if the Node.js process is restarted, the crawling can continue where it left off. The automated persisting is launched upon receiving the
+`persistState` event that is periodically emitted by [`Apify.events`](../api/apify#events).
+
+The internal state is closely tied to the provided sources (URLs). If the sources change on actor restart, the state will become corrupted and
+`RequestList` will raise an exception. This typically happens when the sources is a list of URLs downloaded from the web. In such case, use the
+`persistRequestsKey` option in conjunction with `persistStateKey`, to make the `RequestList` store the initial sources to the default key-value store
+and load them after restart, which will prevent any issues that a live list of URLs might cause.
+
+**Basic usage:**
+
+```javascript
+// Use a helper function to simplify request list initialization.
+// State and sources are automatically persisted. This is a preferred usage.
+const requestList = await Apify.openRequestList('my-request-list', [
+ 'http://www.example.com/page-1',
+ { url: 'http://www.example.com/page-2', method: 'POST', userData: { foo: 'bar' } },
+ { requestsFromUrl: 'http://www.example.com/my-url-list.txt', userData: { isFromUrl: true } },
+]);
+```
+
+**Advanced usage:**
+
+```javascript
+// Use the constructor to get more control over the initialization.
+const requestList = new Apify.RequestList({
+ sources: [
+ // Separate requests
+ { url: 'http://www.example.com/page-1', method: 'GET', headers: { ... } },
+ { url: 'http://www.example.com/page-2', userData: { foo: 'bar' }},
+
+ // Bulk load of URLs from file `http://www.example.com/my-url-list.txt`
+ // Note that all URLs must start with http:// or https://
+ { requestsFromUrl: 'http://www.example.com/my-url-list.txt', userData: { isFromUrl: true } },
+ ],
+
+ // Persist the state to avoid re-crawling which can lead to data duplications.
+ // Keep in mind that the sources have to be immutable or this will throw an error.
+ persistStateKey: 'my-state',
+});
+
+await requestList.initialize();
+```
+
+---
+
+<a name="exports.requestlist"></a>
+
+## `new RequestList(options)`
+
+**Parameters**:
+
+- **`options`**: [`RequestListOptions`](../typedefs/request-list-options) - All `RequestList` configuration options
+
+---
+
+<a name="initialize"></a>
+
+## `requestList.initialize()`
+
+Loads all remote sources of URLs and potentially starts periodic state persistence. This function must be called before you can start using the
+instance in a meaningful way.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="persiststate"></a>
+
+## `requestList.persistState()`
+
+Persists the current state of the `RequestList` into the default [`KeyValueStore`](../api/key-value-store). The state is persisted automatically in
+regular intervals, but calling this method manually is useful in cases where you want to have the most current state available after you pause or stop
+fetching its requests. For example after you pause or abort a crawl. Or just before a server migration.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="getstate"></a>
+
+## `requestList.getState()`
+
+Returns an object representing the internal state of the `RequestList` instance. Note that the object's fields can change in future releases.
+
+**Returns**:
+
+[`RequestListState`](../typedefs/request-list-state)
+
+---
+
+<a name="isempty"></a>
+
+## `requestList.isEmpty()`
+
+Resolves to `true` if the next call to [`RequestList.fetchNextRequest()`](../api/request-list#fetchnextrequest) function would return `null`,
+otherwise it resolves to `false`. Note that even if the list is empty, there might be some pending requests currently being processed.
+
+**Returns**:
+
+`Promise<Boolean>`
+
+---
+
+<a name="isfinished"></a>
+
+## `requestList.isFinished()`
+
+Returns `true` if all requests were already handled and there are no more left.
+
+**Returns**:
+
+`Promise<Boolean>`
+
+---
+
+<a name="fetchnextrequest"></a>
+
+## `requestList.fetchNextRequest()`
+
+Gets the next [`Request`](../api/request) to process. First, the function gets a request previously reclaimed using the
+[`RequestList.reclaimRequest()`](../api/request-list#reclaimrequest) function, if there is any. Otherwise it gets the next request from sources.
+
+The function's `Promise` resolves to `null` if there are no more requests to process.
+
+**Returns**:
+
+[`Promise<(Request|null)>`](../api/request)
+
+---
+
+<a name="markrequesthandled"></a>
+
+## `requestList.markRequestHandled(request)`
+
+Marks request as handled after successful processing.
+
+**Parameters**:
+
+- **`request`**: [`Request`](../api/request)
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="reclaimrequest"></a>
+
+## `requestList.reclaimRequest(request)`
+
+Reclaims request to the list if its processing failed. The request will become available in the next `this.fetchNextRequest()`.
+
+**Parameters**:
+
+- **`request`**: [`Request`](../api/request)
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="length"></a>
+
+## `requestList.length()`
+
+Returns the total number of unique requests present in the `RequestList`.
+
+**Returns**:
+
+`number`
+
+---
+
+<a name="handledcount"></a>
+
+## `requestList.handledCount()`
+
+Returns number of handled requests.
+
+**Returns**:
+
+`number`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/RequestQueue.md b/website/versioned_docs/version-0.22.4/api/RequestQueue.md
new file mode 100644
index 000000000..1704ace2b
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/RequestQueue.md
@@ -0,0 +1,235 @@
+---
+id: version-0.22.4-request-queue
+title: RequestQueue
+original_id: request-queue
+---
+
+<a name="requestqueue"></a>
+
+Represents a queue of URLs to crawl, which is used for deep crawling of websites where you start with several URLs and then recursively follow links
+to other pages. The data structure supports both breadth-first and depth-first crawling orders.
+
+Each URL is represented using an instance of the [`Request`](../api/request) class. The queue can only contain unique URLs. More precisely, it can
+only contain [`Request`](../api/request) instances with distinct `uniqueKey` properties. By default, `uniqueKey` is generated from the URL, but it can
+also be overridden. To add a single URL multiple times to the queue, corresponding [`Request`](../api/request) objects will need to have different
+`uniqueKey` properties.
+
+Do not instantiate this class directly, use the [`Apify.openRequestQueue()`](../api/apify#openrequestqueue) function instead.
+
+`RequestQueue` is used by [`BasicCrawler`](../api/basic-crawler), [`CheerioCrawler`](../api/cheerio-crawler) and
+[`PuppeteerCrawler`](../api/puppeteer-crawler) as a source of URLs to crawl. Unlike [`RequestList`](../api/request-list), `RequestQueue` supports
+dynamic adding and removing of requests. On the other hand, the queue is not optimized for operations that add or remove a large number of URLs in a
+batch.
+
+`RequestQueue` stores its data either on local disk or in the Apify Cloud, depending on whether the `APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN`
+environment variable is set.
+
+If the `APIFY_LOCAL_STORAGE_DIR` environment variable is set, the queue data is stored in that directory in an SQLite database file.
+
+If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` is not, the data is stored in the
+[Apify Request Queue](https://docs.apify.com/storage/request-queue) cloud storage. Note that you can force usage of the cloud storage also by passing
+the `forceCloud` option to [`Apify.openRequestQueue()`](../api/apify#openrequestqueue) function, even if the `APIFY_LOCAL_STORAGE_DIR` variable is
+set.
+
+**Example usage:**
+
+```javascript
+// Open the default request queue associated with the actor run
+const queue = await Apify.openRequestQueue();
+
+// Open a named request queue
+const queueWithName = await Apify.openRequestQueue('some-name');
+
+// Enqueue few requests
+await queue.addRequest({ url: 'http://example.com/aaa' });
+await queue.addRequest({ url: 'http://example.com/bbb' });
+await queue.addRequest({ url: 'http://example.com/foo/bar' }, { forefront: true });
+```
+
+---
+
+<a name="addrequest"></a>
+
+## `requestQueue.addRequest(requestLike, [options])`
+
+Adds a request to the queue.
+
+If a request with the same `uniqueKey` property is already present in the queue, it will not be updated. You can find out whether this happened from
+the resulting [`QueueOperationInfo`](../typedefs/queue-operation-info) object.
+
+To add multiple requests to the queue by extracting links from a webpage, see the [`utils.enqueueLinks()`](../api/utils#enqueuelinks) helper function.
+
+**Parameters**:
+
+- **`requestLike`**: [`Request`](../api/request) | [`RequestOptions`](../typedefs/request-options) - [`Request`](../api/request) object or vanilla
+ object with request data. Note that the function sets the `uniqueKey` and `id` fields to the passed Request.
+- **`[options]`**: `Object`
+ - **`[forefront]`**: `boolean` <code> = false</code> - If `true`, the request will be added to the foremost position in the queue.
+
+**Returns**:
+
+[`Promise<QueueOperationInfo>`](../typedefs/queue-operation-info)
+
+---
+
+<a name="getrequest"></a>
+
+## `requestQueue.getRequest(id)`
+
+Gets the request from the queue specified by ID.
+
+**Parameters**:
+
+- **`id`**: `string` - ID of the request.
+
+**Returns**:
+
+[`Promise<(Request|null)>`](../api/request) - Returns the request object, or `null` if it was not found.
+
+---
+
+<a name="fetchnextrequest"></a>
+
+## `requestQueue.fetchNextRequest()`
+
+Returns a next request in the queue to be processed, or `null` if there are no more pending requests.
+
+Once you successfully finish processing of the request, you need to call
+[`RequestQueue.markRequestHandled()`](../api/request-queue#markrequesthandled) to mark the request as handled in the queue. If there was some error in
+processing the request, call [`RequestQueue.reclaimRequest()`](../api/request-queue#reclaimrequest) instead, so that the queue will give the request
+to some other consumer in another call to the `fetchNextRequest` function.
+
+Note that the `null` return value doesn't mean the queue processing finished, it means there are currently no pending requests. To check whether all
+requests in queue were finished, use [`RequestQueue.isFinished()`](../api/request-queue#isfinished) instead.
+
+**Returns**:
+
+[`Promise<(Request|null)>`](../api/request) - Returns the request object or `null` if there are no more pending requests.
+
+---
+
+<a name="markrequesthandled"></a>
+
+## `requestQueue.markRequestHandled(request)`
+
+Marks a request that was previously returned by the [`RequestQueue.fetchNextRequest()`](../api/request-queue#fetchnextrequest) function as handled
+after successful processing. Handled requests will never again be returned by the `fetchNextRequest` function.
+
+**Parameters**:
+
+- **`request`**: [`Request`](../api/request)
+
+**Returns**:
+
+[`Promise<QueueOperationInfo>`](../typedefs/queue-operation-info)
+
+---
+
+<a name="reclaimrequest"></a>
+
+## `requestQueue.reclaimRequest(request, [options])`
+
+Reclaims a failed request back to the queue, so that it can be returned for processed later again by another call to
+[`RequestQueue.fetchNextRequest()`](../api/request-queue#fetchnextrequest). The request record in the queue is updated using the provided `request`
+parameter. For example, this lets you store the number of retries or error messages for the request.
+
+**Parameters**:
+
+- **`request`**: [`Request`](../api/request)
+- **`[options]`**: `Object` - **`[forefront]`**: `boolean` <code> = false</code> - If `true` then the request it placed to the beginning of the
+ queue, so that it's returned in the next call to [`RequestQueue.fetchNextRequest()`](../api/request-queue#fetchnextrequest). By default, it's put
+ to the end of the queue.
+
+**Returns**:
+
+[`Promise<QueueOperationInfo>`](../typedefs/queue-operation-info)
+
+---
+
+<a name="isempty"></a>
+
+## `requestQueue.isEmpty()`
+
+Resolves to `true` if the next call to [`RequestQueue.fetchNextRequest()`](../api/request-queue#fetchnextrequest) would return `null`, otherwise it
+resolves to `false`. Note that even if the queue is empty, there might be some pending requests currently being processed. If you need to ensure that
+there is no activity in the queue, use [`RequestQueue.isFinished()`](../api/request-queue#isfinished).
+
+**Returns**:
+
+`Promise<boolean>`
+
+---
+
+<a name="isfinished"></a>
+
+## `requestQueue.isFinished()`
+
+Resolves to `true` if all requests were already handled and there are no more left. Due to the nature of distributed storage used by the queue, the
+function might occasionally return a false negative, but it will never return a false positive.
+
+**Returns**:
+
+`Promise<boolean>`
+
+---
+
+<a name="drop"></a>
+
+## `requestQueue.drop()`
+
+Removes the queue either from the Apify Cloud storage or from the local database, depending on the mode of operation.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="handledcount"></a>
+
+## `requestQueue.handledCount()`
+
+Returns the number of handled requests.
+
+This function is just a convenient shortcut for:
+
+```javascript
+const { handledRequestCount } = await queue.getInfo();
+```
+
+**Returns**:
+
+`Promise<number>`
+
+---
+
+<a name="getinfo"></a>
+
+## `requestQueue.getInfo()`
+
+Returns an object containing general information about the request queue.
+
+The function returns the same object as the Apify API Client's [getQueue](https://docs.apify.com/api/apify-client-js/latest#ApifyClient-requestQueues)
+function, which in turn calls the [Get request queue](https://apify.com/docs/api/v2#/reference/request-queues/queue/get-request-queue) API endpoint.
+
+**Example:**
+
+```
+{
+ id: "WkzbQMuFYuamGv3YF",
+ name: "my-queue",
+ userId: "wRsJZtadYvn4mBZmm",
+ createdAt: new Date("2015-12-12T07:34:14.202Z"),
+ modifiedAt: new Date("2015-12-13T08:36:13.202Z"),
+ accessedAt: new Date("2015-12-14T08:36:13.202Z"),
+ totalRequestCount: 25,
+ handledRequestCount: 5,
+ pendingRequestCount: 20,
+}
+```
+
+**Returns**:
+
+[`Promise<RequestQueueInfo>`](../typedefs/request-queue-info)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/Session.md b/website/versioned_docs/version-0.22.4/api/Session.md
new file mode 100644
index 000000000..2399e7e26
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/Session.md
@@ -0,0 +1,201 @@
+---
+id: version-0.22.4-session
+title: Session
+original_id: session
+---
+
+<a name="session"></a>
+
+Sessions are used to store information such as cookies and can be used for generating fingerprints and proxy sessions. You can imagine each session as
+a specific user, with its own cookies, IP (via proxy) and potentially a unique browser fingerprint. Session internal state can be enriched with custom
+user data for example some authorization tokens and specific headers in general.
+
+---
+
+<a name="exports.session"></a>
+
+## `new Session(options)`
+
+Session configuration.
+
+**Parameters**:
+
+- **`options`**: [`SessionOptions`](../typedefs/session-options)
+
+---
+
+<a name="isblocked"></a>
+
+## `session.isBlocked()`
+
+indicates whether the session is blocked. Session is blocked once it reaches the `maxErrorScore`.
+
+**Returns**:
+
+`boolean`
+
+---
+
+<a name="isexpired"></a>
+
+## `session.isExpired()`
+
+Indicates whether the session is expired. Session expiration is determined by the `maxAgeSecs`. Once the session is older than
+`createdAt + maxAgeSecs` the session is considered expired.
+
+**Returns**:
+
+`boolean`
+
+---
+
+<a name="ismaxusagecountreached"></a>
+
+## `session.isMaxUsageCountReached()`
+
+Indicates whether the session is used maximum number of times. Session maximum usage count can be changed by `maxUsageCount` parameter.
+
+**Returns**:
+
+`boolean`
+
+---
+
+<a name="isusable"></a>
+
+## `session.isUsable()`
+
+Indicates whether the session can be used for next requests. Session is usable when it is not expired, not blocked and the maximum usage count has not
+be reached.
+
+**Returns**:
+
+`boolean`
+
+---
+
+<a name="markgood"></a>
+
+## `session.markGood()`
+
+This method should be called after a successful session usage. It increases `usageCount` and potentially lowers the `errorScore` by the
+`errorScoreDecrement`.
+
+---
+
+<a name="getstate"></a>
+
+## `session.getState()`
+
+Gets session state for persistence in KeyValueStore.
+
+**Returns**:
+
+[`SessionState`](../typedefs/session-state) - represents session internal state.
+
+---
+
+<a name="retire"></a>
+
+## `session.retire()`
+
+Marks session as blocked and emits event on the `SessionPool` This method should be used if the session usage was unsuccessful and you are sure that
+it is because of the session configuration and not any external matters. For example when server returns 403 status code. If the session does not work
+due to some external factors as server error such as 5XX you probably want to use `markBad` method.
+
+---
+
+<a name="markbad"></a>
+
+## `session.markBad()`
+
+Increases usage and error count. Should be used when the session has been used unsuccessfully. For example because of timeouts.
+
+---
+
+<a name="retireonblockedstatuscodes"></a>
+
+## `session.retireOnBlockedStatusCodes(statusCode, [blockedStatusCodes])`
+
+With certain status codes: `401`, `403` or `429` we can be certain that the target website is blocking us. This function helps to do this conveniently
+by retiring the session when such code is received. Optionally the default status codes can be extended in the second parameter.
+
+**Parameters**:
+
+- **`statusCode`**: `number` - HTTP status code
+- **`[blockedStatusCodes]`**: `Array<number>` - Custom HTTP status codes that means blocking on particular website.
+
+**Returns**:
+
+`boolean` - whether the session was retired.
+
+---
+
+<a name="setcookiesfromresponse"></a>
+
+## `session.setCookiesFromResponse(response)`
+
+Saves cookies from an HTTP response to be used with the session. It expects an object with a `headers` property that's either an `Object` (typical
+Node.js responses) or a `Function` (Puppeteer Response).
+
+It then parses and saves the cookies from the `set-cookie` header, if available.
+
+**Parameters**:
+
+- **`response`**: `PuppeteerResponse` | `IncomingMessage`
+
+---
+
+<a name="setpuppeteercookies"></a>
+
+## `session.setPuppeteerCookies(cookies, url)`
+
+Saves an array with cookie objects to be used with the session. The objects should be in the format that
+[Puppeteer uses](https://pptr.dev/#?product=Puppeteer&version=v2.0.0&show=api-pagecookiesurls), but you can also use this function to set cookies
+manually:
+
+```
+[
+ { name: 'cookie1', value: 'my-cookie' },
+ { name: 'cookie2', value: 'your-cookie' }
+]
+```
+
+**Parameters**:
+
+- **`cookies`**: `Array<PuppeteerCookie>`
+- **`url`**: `string`
+
+---
+
+<a name="getpuppeteercookies"></a>
+
+## `session.getPuppeteerCookies(url)`
+
+Returns cookies in a format compatible with puppeteer and ready to be used with `page.setCookie`.
+
+**Parameters**:
+
+- **`url`**: `string` - website url. Only cookies stored for this url will be returned
+
+**Returns**:
+
+`Array<PuppeteerCookie>`
+
+---
+
+<a name="getcookiestring"></a>
+
+## `session.getCookieString(url)`
+
+Returns cookies saved with the session in the typical key1=value1; key2=value2 format, ready to be used in a cookie header or elsewhere.
+
+**Parameters**:
+
+- **`url`**: `string`
+
+**Returns**:
+
+`string` - - represents `Cookie` header.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/SessionPool.md b/website/versioned_docs/version-0.22.4/api/SessionPool.md
new file mode 100644
index 000000000..fe187af9d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/SessionPool.md
@@ -0,0 +1,140 @@
+---
+id: version-0.22.4-session-pool
+title: SessionPool
+original_id: session-pool
+---
+
+<a name="sessionpool"></a>
+
+Handles the rotation, creation and persistence of user-like sessions. Creates a pool of [`Session`](../api/session) instances, that are randomly
+rotated. When some session is marked as blocked. It is removed and new one is created instead. Learn more in the
+[`Session management guide`](../guides/session-management).
+
+You can create one by calling the [`Apify.openSessionPool`](../api/apify#opensessionpool) function.
+
+Session pool is already integrated into crawlers, and it can significantly improve your scraper performance with just 2 lines of code.
+
+**Example usage:**
+
+```javascript
+const crawler = new Apify.CheerioCrawler({
+ useSessionPool: true,
+ persistCookiesPerSession: true,
+ // ...
+});
+```
+
+You can configure the pool with many options. See the [`SessionPoolOptions`](../typedefs/session-pool-options). Session pool is by default persisted
+in default [`KeyValueStore`](../api/key-value-store). If you want to have one pool for all runs you have to specify
+[`SessionPoolOptions.persistStateKeyValueStoreId`](../typedefs/session-pool-options#persiststatekeyvaluestoreid).
+
+**Advanced usage:**
+
+```javascript
+const sessionPool = await Apify.openSessionPool({
+ maxPoolSize: 25,
+ sessionOptions: {
+ maxAgeSecs: 10,
+ maxUsageCount: 150, // for example when you know that the site blocks after 150 requests.
+ },
+ persistStateKeyValueStoreId: 'my-key-value-store-for-sessions',
+ persistStateKey: 'my-session-pool',
+});
+
+// Get random session from the pool
+const session1 = await sessionPool.getSession();
+const session2 = await sessionPool.getSession();
+const session3 = await sessionPool.getSession();
+
+// Now you can mark the session either failed or successful
+
+// Marks session as bad after unsuccessful usage -> it increases error count (soft retire)
+session1.markBad();
+
+// Marks as successful.
+session2.markGood();
+
+// Retires session -> session is removed from the pool
+session3.retire();
+```
+
+---
+
+<a name="usablesessionscount"></a>
+
+## `sessionPool.usableSessionsCount`
+
+Gets count of usable sessions in the pool.
+
+**Returns**:
+
+`number`
+
+---
+
+<a name="retiredsessionscount"></a>
+
+## `sessionPool.retiredSessionsCount`
+
+Gets count of retired sessions in the pool.
+
+**Returns**:
+
+`number`
+
+---
+
+<a name="initialize"></a>
+
+## `sessionPool.initialize()`
+
+Starts periodic state persistence and potentially loads SessionPool state from [`KeyValueStore`](../api/key-value-store). It is called automatically
+by the [`Apify.openSessionPool`](../api/apify#opensessionpool) function.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="getsession"></a>
+
+## `sessionPool.getSession()`
+
+Gets session. If there is space for new session, it creates and return new session. If the session pool is full, it picks a session from the pool, If
+the picked session is usable it is returned, otherwise it creates and returns a new one.
+
+**Returns**:
+
+[`Promise<Session>`](../api/session)
+
+---
+
+<a name="getstate"></a>
+
+## `sessionPool.getState()`
+
+Returns an object representing the internal state of the `SessionPool` instance. Note that the object's fields can change in future releases.
+
+---
+
+<a name="persiststate"></a>
+
+## `sessionPool.persistState()`
+
+Persists the current state of the `SessionPool` into the default [`KeyValueStore`](../api/key-value-store). The state is persisted automatically in
+regular intervals.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="teardown"></a>
+
+## `sessionPool.teardown()`
+
+Removes listener from `persistState` event. This function should be called after you are done with using the `SessionPool` instance.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/Snapshotter.md b/website/versioned_docs/version-0.22.4/api/Snapshotter.md
new file mode 100644
index 000000000..6e131d18f
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/Snapshotter.md
@@ -0,0 +1,129 @@
+---
+id: version-0.22.4-snapshotter
+title: Snapshotter
+original_id: snapshotter
+---
+
+<a name="snapshotter"></a>
+
+Creates snapshots of system resources at given intervals and marks the resource as either overloaded or not during the last interval. Keeps a history
+of the snapshots. It tracks the following resources: Memory, EventLoop, API and CPU. The class is used by the
+[`AutoscaledPool`](../api/autoscaled-pool) class.
+
+When running on the Apify platform, the CPU and memory statistics are provided by the platform, as collected from the running Docker container. When
+running locally, `Snapshotter` makes its own statistics by querying the OS.
+
+CPU becomes overloaded locally when its current use exceeds the `maxUsedCpuRatio` option or when Apify platform marks it as overloaded.
+
+Memory becomes overloaded if its current use exceeds the `maxUsedMemoryRatio` option. It's computed using the total memory available to the container
+when running on the Apify platform and a quarter of total system memory when running locally. Max total memory when running locally may be overridden
+by using the `APIFY_MEMORY_MBYTES` environment variable.
+
+Event loop becomes overloaded if it slows down by more than the `maxBlockedMillis` option.
+
+Client becomes overloaded when rate limit errors (429 - Too Many Requests), typically received from the request queue, exceed the set limit within the
+set interval.
+
+---
+
+<a name="snapshotter"></a>
+
+## `new Snapshotter([options])`
+
+**Parameters**:
+
+- **`[options]`**: [`SnapshotterOptions`](../typedefs/snapshotter-options) - All `Snapshotter` configuration options.
+
+---
+
+<a name="start"></a>
+
+## `snapshotter.start()`
+
+Starts capturing snapshots at configured intervals.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="stop"></a>
+
+## `snapshotter.stop()`
+
+Stops all resource capturing.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="getmemorysample"></a>
+
+## `snapshotter.getMemorySample([sampleDurationMillis])`
+
+Returns a sample of latest memory snapshots, with the size of the sample defined by the sampleDurationMillis parameter. If omitted, it returns a full
+snapshot history.
+
+**Parameters**:
+
+- **`[sampleDurationMillis]`**: `number`
+
+**Returns**:
+
+`Array<*>`
+
+---
+
+<a name="geteventloopsample"></a>
+
+## `snapshotter.getEventLoopSample([sampleDurationMillis])`
+
+Returns a sample of latest event loop snapshots, with the size of the sample defined by the sampleDurationMillis parameter. If omitted, it returns a
+full snapshot history.
+
+**Parameters**:
+
+- **`[sampleDurationMillis]`**: `number`
+
+**Returns**:
+
+`Array<*>`
+
+---
+
+<a name="getcpusample"></a>
+
+## `snapshotter.getCpuSample([sampleDurationMillis])`
+
+Returns a sample of latest CPU snapshots, with the size of the sample defined by the sampleDurationMillis parameter. If omitted, it returns a full
+snapshot history.
+
+**Parameters**:
+
+- **`[sampleDurationMillis]`**: `number`
+
+**Returns**:
+
+`Array<*>`
+
+---
+
+<a name="getclientsample"></a>
+
+## `snapshotter.getClientSample(sampleDurationMillis)`
+
+Returns a sample of latest Client snapshots, with the size of the sample defined by the sampleDurationMillis parameter. If omitted, it returns a full
+snapshot history.
+
+**Parameters**:
+
+- **`sampleDurationMillis`**: `number`
+
+**Returns**:
+
+`Array<*>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/Statistics.md b/website/versioned_docs/version-0.22.4/api/Statistics.md
new file mode 100644
index 000000000..91ddd5195
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/Statistics.md
@@ -0,0 +1,89 @@
+---
+id: version-0.22.4-statistics
+title: Statistics
+original_id: statistics
+---
+
+<a name="statistics"></a>
+
+The statistics class provides an interface to collecting and logging run statistics for requests.
+
+All statistic information is saved on key value store under the key SDK*CRAWLER_STATISTICS*\*, persists between migrations and abort/resurrect
+
+## Properties
+
+### `state`
+
+**Type**: [`StatisticState`](../typedefs/statistic-state)
+
+Current statistic state used for doing calculations on [`Statistics.calculate()`](../api/statistics#calculate) calls
+
+---
+
+### `id`
+
+**Type**: `number`
+
+Statistic instance id
+
+---
+
+### `requestRetryHistogram`
+
+**Type**: `Array<number>`
+
+Contains the current retries histogram. Index 0 means 0 retries, index 2, 2 retries, and so on
+
+---
+
+<a name="reset"></a>
+
+## `statistics.reset()`
+
+Set the current statistic instance to pristine values
+
+---
+
+<a name="calculate"></a>
+
+## `statistics.calculate()`
+
+Calculate the current statistics
+
+---
+
+<a name="startcapturing"></a>
+
+## `statistics.startCapturing()`
+
+Initializes the key value store for persisting the statistics, displaying the current state in predefined intervals
+
+---
+
+<a name="stopcapturing"></a>
+
+## `statistics.stopCapturing()`
+
+Stops logging and remove event listeners, then persist
+
+---
+
+<a name="persiststate"></a>
+
+## `statistics.persistState()`
+
+Persist internal state to the key value store
+
+---
+
+<a name="tojson"></a>
+
+## `statistics.toJSON()`
+
+Make this class serializable when called with `JSON.stringify(statsInstance)` directly or through `keyValueStore.setValue('KEY', statsInstance)`
+
+**Returns**:
+
+[`StatisticPersistedState`](../typedefs/statistic-persisted-state) \| [`StatisticState`](../typedefs/statistic-state)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/StorageManager.md b/website/versioned_docs/version-0.22.4/api/StorageManager.md
new file mode 100644
index 000000000..79543337c
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/StorageManager.md
@@ -0,0 +1,7 @@
+---
+id: version-0.22.4-storage-manager
+title: StorageManager
+original_id: storage-manager
+---
+
+ERROR, Cannot find class.
diff --git a/website/versioned_docs/version-0.22.4/api/SystemStatus.md b/website/versioned_docs/version-0.22.4/api/SystemStatus.md
new file mode 100644
index 000000000..74c5df2b8
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/SystemStatus.md
@@ -0,0 +1,80 @@
+---
+id: version-0.22.4-system-status
+title: SystemStatus
+original_id: system-status
+---
+
+<a name="systemstatus"></a>
+
+Provides a simple interface to reading system status from a [`Snapshotter`](../api/snapshotter) instance. It only exposes two functions
+[`SystemStatus.getCurrentStatus()`](../api/system-status#getcurrentstatus) and
+[`SystemStatus.getHistoricalStatus()`](../api/system-status#gethistoricalstatus). The system status is calculated using a weighted average of
+overloaded messages in the snapshots, with the weights being the time intervals between the snapshots. Each resource is calculated separately and the
+system is overloaded whenever at least one resource is overloaded. The class is used by the [`AutoscaledPool`](../api/autoscaled-pool) class.
+
+[`SystemStatus.getCurrentStatus()`](../api/system-status#getcurrentstatus) returns a boolean that represents the current status of the system. The
+length of the current timeframe in seconds is configurable by the `currentHistorySecs` option and represents the max age of snapshots to be considered
+for the calculation.
+
+[`SystemStatus.getHistoricalStatus()`](../api/system-status#gethistoricalstatus) returns a boolean that represents the long-term status of the system.
+It considers the full snapshot history available in the [`Snapshotter`](../api/snapshotter) instance.
+
+---
+
+<a name="systemstatus"></a>
+
+## `new SystemStatus([options])`
+
+**Parameters**:
+
+- **`[options]`**: [`SystemStatusOptions`](../typedefs/system-status-options) - All `SystemStatus` configuration options.
+
+---
+
+<a name="getcurrentstatus"></a>
+
+## `systemStatus.getCurrentStatus()`
+
+Returns an [`SystemInfo`](../typedefs/system-info) object with the following structure:
+
+```javascript
+{
+ isSystemIdle: Boolean,
+ memInfo: Object,
+ eventLoopInfo: Object,
+ cpuInfo: Object
+}
+```
+
+Where the `isSystemIdle` property is set to `false` if the system has been overloaded in the last `options.currentHistorySecs` seconds, and `true`
+otherwise.
+
+**Returns**:
+
+[`SystemInfo`](../typedefs/system-info)
+
+---
+
+<a name="gethistoricalstatus"></a>
+
+## `systemStatus.getHistoricalStatus()`
+
+Returns an [`SystemInfo`](../typedefs/system-info) object with the following structure:
+
+```javascript
+{
+ isSystemIdle: Boolean,
+ memInfo: Object,
+ eventLoopInfo: Object,
+ cpuInfo: Object
+}
+```
+
+Where the `isSystemIdle` property is set to `false` if the system has been overloaded in the full history of the [`Snapshotter`](../api/snapshotter)
+(which is configurable in the [`Snapshotter`](../api/snapshotter)) and `true` otherwise.
+
+**Returns**:
+
+[`SystemInfo`](../typedefs/system-info)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/exports.md b/website/versioned_docs/version-0.22.4/api/exports.md
new file mode 100644
index 000000000..348e181f6
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/exports.md
@@ -0,0 +1,24 @@
+---
+id: version-0.22.4-exports
+title: exports
+original_id: exports
+---
+
+<a name="exports"></a>
+
+Abstract class with pre-defined method to connect to the Crawlers class by the "use" crawler method.
+
+---
+
+<a name="module.exports"></a>
+
+## `new module.exports(props)`
+
+**Parameters**:
+
+- **`props`**: `Object`
+ - **`pageUrl`**: `string`
+ - **`htmlContent`**: `string`
+ - **`screenshotIndex`**: `number`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/log.md b/website/versioned_docs/version-0.22.4/api/log.md
new file mode 100644
index 000000000..95b72529c
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/log.md
@@ -0,0 +1,211 @@
+---
+id: version-0.22.4-log
+title: utils.log
+original_id: log
+---
+
+<a name="log"></a>
+
+The log instance enables level aware logging of messages and we advise to use it instead of `console.log()` and its aliases in most development
+scenarios.
+
+A very useful use case for `log` is using `log.debug` liberally throughout the codebase to get useful logging messages only when appropriate log level
+is set and keeping the console tidy in production environments.
+
+The available logging levels are, in this order: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `OFF` and can be referenced from the `log.LEVELS` constant, such
+as `log.LEVELS.ERROR`.
+
+To log messages to the system console, use the `log.level(message)` invocation, such as `log.debug('this is a debug message')`.
+
+To prevent writing of messages above a certain log level to the console, simply set the appropriate level. The default log level is `INFO`, which
+means that `DEBUG` messages will not be printed, unless enabled.
+
+**Example:**
+
+```js
+const Apify = require('apify');
+const { log } = Apify.utils;
+
+log.info('Information message', { someData: 123 }); // prints message
+log.debug('Debug message', { debugData: 'hello' }); // doesn't print anything
+
+log.setLevel(log.LEVELS.DEBUG);
+log.debug('Debug message'); // prints message
+
+log.setLevel(log.LEVELS.ERROR);
+log.debug('Debug message'); // doesn't print anything
+log.info('Info message'); // doesn't print anything
+
+log.error('Error message', { errorDetails: 'This is bad!' }); // prints message
+try {
+ throw new Error('Not good!');
+} catch (e) {
+ log.exception(e, 'Exception occurred', { errorDetails: 'This is really bad!' }); // prints message
+}
+
+log.setOptions({ prefix: 'My actor' });
+log.info('I am running!'); // prints "My actor: I am running"
+
+const childLog = log.child({ prefix: 'Crawler' });
+log.info('I am crawling!'); // prints "My actor:Crawler: I am crawling"
+```
+
+Another very useful way of setting the log level is by setting the `APIFY_LOG_LEVEL` environment variable, such as `APIFY_LOG_LEVEL=DEBUG`. This way,
+no code changes are necessary to turn on your debug messages and start debugging right away.
+
+To add timestamps to your logs, you can override the default logger settings:
+
+```js
+log.setOptions({
+ logger: new log.LoggerText({ skipTime: false }),
+});
+```
+
+You can customize your logging further by extending or replacing the default logger instances with your own implementations.
+
+---
+
+<a name="levels"></a>
+
+## `log.LEVELS`
+
+Map of available log levels that's useful for easy setting of appropriate log levels. Each log level is represented internally by a number. Eg.
+`log.LEVELS.DEBUG === 5`.
+
+---
+
+<a name="setlevel"></a>
+
+## `log.setLevel(level)`
+
+Sets the log level to the given value, preventing messages from less important log levels from being printed to the console. Use in conjunction with
+the `log.LEVELS` constants such as
+
+```
+log.setLevel(log.LEVELS.DEBUG);
+```
+
+Default log level is INFO.
+
+**Parameters**:
+
+- **`level`**: `number`
+
+---
+
+<a name="getlevel"></a>
+
+## `log.getLevel()`
+
+Returns the currently selected logging level. This is useful for checking whether a message will actually be printed to the console before one
+actually performs a resource intensive operation to construct the message, such as querying a DB for some metadata that need to be added. If the log
+level is not high enough at the moment, it doesn't make sense to execute the query.
+
+---
+
+<a name="setoptions"></a>
+
+## `log.setOptions(options)`
+
+Configures logger.
+
+**Parameters**:
+
+- **`options`**: [`LoggerOptions`](../typedefs/logger-options)
+
+---
+
+<a name="child"></a>
+
+## `log.child([options])`
+
+Creates a new instance of logger that inherits settings from a parent logger.
+
+**Parameters**:
+
+- **`[options]`**: [`LoggerOptions`](../typedefs/logger-options) - Supports the same options as the `setOptions()` method.
+
+---
+
+<a name="getoptions"></a>
+
+## `log.getOptions()`
+
+Returns the logger configuration.
+
+**Returns**:
+
+[`LoggerOptions`](../typedefs/logger-options)
+
+---
+
+<a name="debug"></a>
+
+## `log.debug(message, [data])`
+
+Logs a `DEBUG` message. By default, it will not be written to the console. To see `DEBUG` messages in the console, set the log level to `DEBUG` either
+using the `log.setLevel(log.LEVELS.DEBUG)` method or using the environment variable `APIFY_LOG_LEVEL=DEBUG`. Data are stringified and appended to the
+message.
+
+**Parameters**:
+
+- **`message`**: `string`
+- **`[data]`**: `Object`
+
+---
+
+<a name="info"></a>
+
+## `log.info(message, [data])`
+
+Logs an `INFO` message. `INFO` is the default log level so info messages will be always logged, unless the log level is changed. Data are stringified
+and appended to the message.
+
+**Parameters**:
+
+- **`message`**: `string`
+- **`[data]`**: `Object`
+
+---
+
+<a name="warning"></a>
+
+## `log.warning(message, [data])`
+
+Logs a `WARNING` level message. Data are stringified and appended to the message.
+
+**Parameters**:
+
+- **`message`**: `string`
+- **`[data]`**: `Object`
+
+---
+
+<a name="error"></a>
+
+## `log.error(message, [data])`
+
+Logs an `ERROR` message. Use this method to log error messages that are not directly connected to an exception. For logging exceptions, use the
+`log.exception` method.
+
+**Parameters**:
+
+- **`message`**: `string`
+- **`[data]`**: `Object`
+
+---
+
+<a name="exception"></a>
+
+## `log.exception(exception, [message], [data])`
+
+Logs an `ERROR` level message with a nicely formatted exception. Note that the exception is the first parameter here and an additional message is only
+optional.
+
+**Parameters**:
+
+- **`exception`**: `Error`
+- **`[message]`**: `string`
+- **`[data]`**: `Object`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/puppeteer.md b/website/versioned_docs/version-0.22.4/api/puppeteer.md
new file mode 100644
index 000000000..09b7da959
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/puppeteer.md
@@ -0,0 +1,471 @@
+---
+id: version-0.22.4-puppeteer
+title: utils.puppeteer
+original_id: puppeteer
+---
+
+<a name="puppeteer"></a>
+
+A namespace that contains various utilities for [Puppeteer](https://github.com/puppeteer/puppeteer) - the headless Chrome Node API.
+
+**Example usage:**
+
+```javascript
+const Apify = require('apify');
+const { puppeteer } = Apify.utils;
+
+// Open https://www.example.com in Puppeteer
+const browser = await Apify.launchPuppeteer();
+const page = await browser.newPage();
+await page.goto('https://www.example.com');
+
+// Inject jQuery into a page
+await puppeteer.injectJQuery(page);
+```
+
+---
+
+<a name="addinterceptrequesthandler"></a>
+
+## `puppeteer.addInterceptRequestHandler`
+
+Adds request interception handler in similar to `page.on('request', handler);` but in addition to that supports multiple parallel handlers.
+
+All the handlers are executed sequentially in the order as they were added. Each of the handlers must call one of `request.continue()`,
+`request.abort()` and `request.respond()`. In addition to that any of the handlers may modify the request object (method, postData, headers) by
+passing its overrides to `request.continue()`. If multiple handlers modify same property then the last one wins. Headers are merged separately so you
+can override only a value of specific header.
+
+If one the handlers calls `request.abort()` or `request.respond()` then request is not propagated further to any of the remaining handlers.
+
+**Example usage:**
+
+```javascript
+// Replace images with placeholder.
+await addInterceptRequestHandler(page, request => {
+ if (request.resourceType() === 'image') {
+ return request.respond({
+ statusCode: 200,
+ contentType: 'image/jpeg',
+ body: placeholderImageBuffer,
+ });
+ }
+ return request.continue();
+});
+
+// Abort all the scripts.
+await addInterceptRequestHandler(page, request => {
+ if (request.resourceType() === 'script') return request.abort();
+ return request.continue();
+});
+
+// Change requests to post.
+await addInterceptRequestHandler(page, request => {
+ return request.continue({
+ method: 'POST',
+ });
+});
+
+await page.goto('http://example.com');
+```
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`handler`**: [`InterceptHandler`](../typedefs/intercept-handler) - Request interception handler.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="removeinterceptrequesthandler"></a>
+
+## `puppeteer.removeInterceptRequestHandler`
+
+Removes request interception handler for given page.
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`handler`**: [`InterceptHandler`](../typedefs/intercept-handler) - Request interception handler.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="gotoextended"></a>
+
+## `puppeteer.gotoExtended`
+
+Extended version of Puppeteer's `page.goto()` allowing to perform requests with HTTP method other than GET, with custom headers and POST payload. URL,
+method, headers and payload are taken from request parameter that must be an instance of Apify.Request class.
+
+_NOTE:_ In recent versions of Puppeteer using requests other than GET, overriding headers and adding payloads disables browser cache which degrades
+performance.
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`request`**: [`Request`](../api/request)
+- **`[gotoOptions]`**: `DirectNavigationOptions` - Custom options for `page.goto()`.
+
+**Returns**:
+
+`Promise<(Response|null)>`
+
+---
+
+<a name="infinitescroll"></a>
+
+## `puppeteer.infiniteScroll`
+
+Scrolls to the bottom of a page, or until it times out. Loads dynamic content when it hits the bottom of a page, and then continues scrolling.
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`[options]`**: `Object`
+ - **`[timeoutSecs]`**: `number` <code> = 0</code> - How many seconds to scroll for. If 0, will scroll until bottom of page.
+ - **`[waitForSecs]`**: `number` <code> = 4</code> - How many seconds to wait for no new content to load before exit.
+ - **`[scrollDownAndUp]`**: `Boolean` <code> = false</code> - If true, it will scroll up a bit after each scroll down. This is required on some
+ websites for the scroll to work.
+ - **`[buttonSelector]`**: `String` - Optionally checks and clicks a button if it appears while scrolling. This is required on some websites for
+ the scroll to work.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="savesnapshot"></a>
+
+## `puppeteer.saveSnapshot`
+
+Saves a full screenshot and HTML of the current page into a Key-Value store.
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`[options]`**: `Object`
+ - **`[key]`**: `string` <code> = &quot;SNAPSHOT&quot;</code> - Key under which the screenshot and HTML will be saved. `.jpg` will be appended
+ for screenshot and `.html` for HTML.
+ - **`[screenshotQuality]`**: `number` <code> = 50</code> - The quality of the image, between 0-100. Higher quality images have bigger size and
+ require more storage.
+ - **`[saveScreenshot]`**: `boolean` <code> = true</code> - If true, it will save a full screenshot of the current page as a record with `key`
+ appended by `.jpg`.
+ - **`[saveHtml]`**: `boolean` <code> = true</code> - If true, it will save a full HTML of the current page as a record with `key` appended by
+ `.html`.
+ - **`[keyValueStoreName]`**: `string` <code> = null</code> - Name or id of the Key-Value store where snapshot is saved. By default it is saved
+ to default Key-Value store.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="enqueuelinksbyclickingelements"></a>
+
+## `puppeteer.enqueueLinksByClickingElements(options)`
+
+The function finds elements matching a specific CSS selector in a Puppeteer page, clicks all those elements using a mouse move and a left mouse button
+click and intercepts all the navigation requests that are subsequently produced by the page. The intercepted requests, including their methods,
+headers and payloads are then enqueued to a provided [`RequestQueue`](../api/request-queue). This is useful to crawl JavaScript heavy pages where
+links are not available in `href` elements, but rather navigations are triggered in click handlers. If you're looking to find URLs in `href`
+attributes of the page, see [`utils.enqueueLinks()`](../api/utils#enqueuelinks).
+
+Optionally, the function allows you to filter the target links' URLs using an array of [`PseudoUrl`](../api/pseudo-url) objects and override settings
+of the enqueued [`Request`](../api/request) objects.
+
+**IMPORTANT**: To be able to do this, this function uses various mutations on the page, such as changing the Z-index of elements being clicked and
+their visibility. Therefore, it is recommended to only use this function as the last operation in the page.
+
+**USING HEADFUL BROWSER**: When using a headful browser, this function will only be able to click elements in the focused tab, effectively limiting
+concurrency to 1. In headless mode, full concurrency can be achieved.
+
+**PERFORMANCE**: Clicking elements with a mouse and intercepting requests is not a low level operation that takes nanoseconds. It's not very CPU
+intensive, but it takes time. We strongly recommend limiting the scope of the clicking as much as possible by using a specific selector that targets
+only the elements that you assume or know will produce a navigation. You can certainly click everything by using the `*` selector, but be prepared to
+wait minutes to get results on a large and complex page.
+
+**Example usage**
+
+```javascript
+await Apify.utils.puppeteer.enqueueLinksByClickingElements({
+ page,
+ requestQueue,
+ selector: 'a.product-detail',
+ pseudoUrls: [
+ 'https://www.example.com/handbags/[.*]'
+ 'https://www.example.com/purses/[.*]'
+ ],
+});
+```
+
+**Parameters**:
+
+- **`options`**: `Object` - All `enqueueLinksByClickingElements()` parameters are passed via an options object with the following keys:
+
+ - **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+ - **`requestQueue`**: [`RequestQueue`](../api/request-queue) - A request queue to which the URLs will be enqueued.
+ - **`selector`**: `string` - A CSS selector matching elements to be clicked on. Unlike in [`utils.enqueueLinks()`](../api/utils#enqueuelinks),
+ there is no default value. This is to prevent suboptimal use of this function by using it too broadly.
+ - **`[pseudoUrls]`**: `Array<(string|RegExp|Object)>` - An array of [`PseudoUrl`](../api/pseudo-url)s matching the URLs to be enqueued, or an
+ array of strings or RegExps or plain Objects from which the [`PseudoUrl`](../api/pseudo-url)s can be constructed.
+
+ The plain objects must include at least the `purl` property, which holds the pseudo-URL string or RegExp. All remaining keys will be used as the
+ `requestTemplate` argument of the [`PseudoUrl`](../api/pseudo-url) constructor, which lets you specify special properties for the enqueued
+ [`Request`](../api/request) objects.
+
+ If `pseudoUrls` is an empty array, `null` or `undefined`, then the function enqueues all links found on the page.
+
+ - **`[transformRequestFunction]`**: [`RequestTransform`](../typedefs/request-transform) - Just before a new [`Request`](../api/request) is
+ constructed and enqueued to the [`RequestQueue`](../api/request-queue), this function can be used to remove it or modify its contents such as
+ `userData`, `payload` or, most importantly `uniqueKey`. This is useful when you need to enqueue multiple `Requests` to the queue that share
+ the same URL, but differ in methods or payloads, or to dynamically update or create `userData`.
+
+ For example: by adding `useExtendedUniqueKey: true` to the `request` object, `uniqueKey` will be computed from a combination of `url`, `method`
+ and `payload` which enables crawling of websites that navigate using form submits (POST requests).
+
+ **Example:**
+
+ ```javascript
+ {
+ transformRequestFunction: request => {
+ request.userData.foo = 'bar';
+ request.useExtendedUniqueKey = true;
+ return request;
+ };
+ }
+ ```
+
+ - **`[waitForPageIdleSecs]`**: `number` <code> = 1</code> - Clicking in the page triggers various asynchronous operations that lead to new URLs
+ being shown by the browser. It could be a simple JavaScript redirect or opening of a new tab in the browser. These events often happen only
+ some time after the actual click. Requests typically take milliseconds while new tabs open in hundreds of milliseconds.
+
+ To be able to capture all those events, the `enqueueLinksByClickingElements()` function repeatedly waits for the `waitForPageIdleSecs`. By
+ repeatedly we mean that whenever a relevant event is triggered, the timer is restarted. As long as new events keep coming, the function will not
+ return, unless the below `maxWaitForPageIdleSecs` timeout is reached.
+
+ You may want to reduce this for example when you're sure that your clicks do not open new tabs, or increase when you're not getting all the
+ expected URLs.
+
+ - **`[maxWaitForPageIdleSecs]`**: `number` <code> = 5</code> - This is the maximum period for which the function will keep tracking events, even
+ if more events keep coming. Its purpose is to prevent a deadlock in the page by periodic events, often unrelated to the clicking itself. See
+ `waitForPageIdleSecs` above for an explanation.
+
+**Returns**:
+
+[`Promise<Array<QueueOperationInfo>>`](../typedefs/queue-operation-info) - Promise that resolves to an array of
+[`QueueOperationInfo`](../typedefs/queue-operation-info) objects.
+
+---
+
+<a name="injectfile"></a>
+
+## `puppeteer.injectFile(page, filePath, [options])`
+
+Injects a JavaScript file into a Puppeteer page. Unlike Puppeteer's `addScriptTag` function, this function works on pages with arbitrary Cross-Origin
+Resource Sharing (CORS) policies.
+
+File contents are cached for up to 10 files to limit file system access.
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`filePath`**: `string` - File path
+- **`[options]`**: `Object`
+ - **`[surviveNavigations]`**: `boolean` - Enables the injected script to survive page navigations and reloads without need to be re-injected
+ manually. This does not mean, however, that internal state will be preserved. Just that it will be automatically re-injected on each
+ navigation before any other scripts get the chance to execute.
+
+**Returns**:
+
+`Promise<*>`
+
+---
+
+<a name="injectjquery"></a>
+
+## `puppeteer.injectJQuery(page)`
+
+Injects the [jQuery](https://jquery.com/) library into a Puppeteer page. jQuery is often useful for various web scraping and crawling tasks. For
+example, it can help extract text from HTML elements using CSS selectors.
+
+Beware that the injected jQuery object will be set to the `window.$` variable and thus it might cause conflicts with other libraries included by the
+page that use the same variable name (e.g. another version of jQuery). This can affect functionality of page's scripts.
+
+The injected jQuery will survive page navigations and reloads.
+
+**Example usage:**
+
+```javascript
+await Apify.utils.puppeteer.injectJQuery(page);
+const title = await page.evaluate(() => {
+ return $('head title').text();
+});
+```
+
+Note that `injectJQuery()` does not affect the Puppeteer's [`page.$()`](https://pptr.dev/#?product=Puppeteer&show=api-pageselector) function in any
+way.
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+
+**Returns**:
+
+`Promise<*>`
+
+---
+
+<a name="injectunderscore"></a>
+
+## `puppeteer.injectUnderscore(page)`
+
+Injects the [Underscore](https://underscorejs.org/) library into a Puppeteer page.
+
+Beware that the injected Underscore object will be set to the `window._` variable and thus it might cause conflicts with libraries included by the
+page that use the same variable name. This can affect functionality of page's scripts.
+
+The injected Underscore will survive page navigations and reloads.
+
+**Example usage:**
+
+```javascript
+await Apify.utils.puppeteer.injectUnderscore(page);
+const escapedHtml = await page.evaluate(() => {
+ return _.escape('<h1>Hello</h1>');
+});
+```
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [Page](https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#class-page) object.
+
+**Returns**:
+
+`Promise<*>`
+
+---
+
+<a name="blockrequests"></a>
+
+## `puppeteer.blockRequests(page, [options])`
+
+Forces the Puppeteer browser tab to block loading URLs that match a provided pattern. This is useful to speed up crawling of websites, since it
+reduces the amount of data that needs to be downloaded from the web, but it may break some websites or unexpectedly prevent loading of resources.
+
+By default, the function will block all URLs including the following patterns:
+
+```json
+[".css", ".jpg", ".jpeg", ".png", ".svg", ".gif", ".woff", ".pdf", ".zip"]
+```
+
+If you want to extend this list further, use the `extraUrlPatterns` option, which will keep blocking the default patterns, as well as add your custom
+ones. If you would like to block only specific patterns, use the `urlPatterns` option, which will override the defaults and block only URLs with your
+custom patterns.
+
+This function does not use Puppeteer's request interception and therefore does not interfere with browser cache. It's also faster than blocking
+requests using interception, because the blocking happens directly in the browser without the round-trip to Node.js, but it does not provide the extra
+benefits of request interception.
+
+The function will never block main document loads and their respective redirects.
+
+**Example usage**
+
+```javascript
+const Apify = require('apify');
+
+const browser = await Apify.launchPuppeteer();
+const page = await browser.newPage();
+
+// Block all requests to URLs that include `adsbygoogle.js` and also all defaults.
+await Apify.utils.puppeteer.blockRequests(page, {
+ extraUrlPatterns: ['adsbygoogle.js'],
+});
+
+await page.goto('https://cnn.com');
+```
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`[options]`**: `Object`
+ - **`[urlPatterns]`**: `Array<string>` - The patterns of URLs to block from being loaded by the browser. Only `*` can be used as a wildcard. It
+ is also automatically added to the beginning and end of the pattern. This limitation is enforced by the DevTools protocol. `.png` is the same
+ as `*.png*`.
+ - **`[extraUrlPatterns]`**: `Array<string>` - If you just want to append to the default blocked patterns, use this property.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="cacheresponses"></a>
+
+## ~~`puppeteer.cacheResponses(page, cache, responseUrlRules)`~~
+
+**_Deprecated_**
+
+_NOTE:_ In recent versions of Puppeteer using this function entirely disables browser cache which resolves in sub-optimal performance. Until this
+resolves, we suggest just relying on the in-browser cache unless absolutely necessary.
+
+Enables caching of intercepted responses into a provided object. Automatically enables request interception in Puppeteer. _IMPORTANT_: Caching
+responses stores them to memory, so too loose rules could cause memory leaks for longer running crawlers. This issue should be resolved or atleast
+mitigated in future iterations of this feature.
+
+**Parameters**:
+
+- **`page`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object.
+- **`cache`**: `Object` - Object in which responses are stored
+- **`responseUrlRules`**: `Array<(string|RegExp)>` - List of rules that are used to check if the response should be cached. String rules are
+ compared as page.url().includes(rule) while RegExp rules are evaluated as rule.test(page.url()).
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="compilescript"></a>
+
+## `puppeteer.compileScript(scriptString, context)`
+
+Compiles a Puppeteer script into an async function that may be executed at any time by providing it with the following object:
+
+```
+{
+ page: Page,
+ request: Request,
+}
+```
+
+Where `page` is a Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) and `request` is a [`Request`](../api/request).
+
+The function is compiled by using the `scriptString` parameter as the function's body, so any limitations to function bodies apply. Return value of
+the compiled function is the return value of the function body = the `scriptString` parameter.
+
+As a security measure, no globals such as `process` or `require` are accessible from within the function body. Note that the function does not provide
+a safe sandbox and even though globals are not easily accessible, malicious code may still execute in the main process via prototype manipulation.
+Therefore you should only use this function to execute sanitized or safe code.
+
+Custom context may also be provided using the `context` parameter. To improve security, make sure to only pass the really necessary objects to the
+context. Preferably making secured copies beforehand.
+
+**Parameters**:
+
+- **`scriptString`**: `string`
+- **`context`**: `Object`
+
+**Returns**:
+
+`function` - `async ({ page, request }) => { scriptString }`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/social.md b/website/versioned_docs/version-0.22.4/api/social.md
new file mode 100644
index 000000000..498428fcb
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/social.md
@@ -0,0 +1,428 @@
+---
+id: version-0.22.4-social
+title: utils.social
+original_id: social
+---
+
+<a name="social"></a>
+
+A namespace that contains various utilities to help you extract social handles from text, URLs and and HTML documents.
+
+**Example usage:**
+
+```javascript
+const Apify = require('apify');
+
+const emails = Apify.utils.social.emailsFromText('[email protected] [email protected]');
+```
+
+---
+
+<a name="linkedin_regex"></a>
+
+## `social.LINKEDIN_REGEX`
+
+Regular expression to exactly match a single LinkedIn profile URL. It has the following form: `/^...$/i` and matches URLs such as:
+
+```
+https://www.linkedin.com/in/alan-turing
+en.linkedin.com/in/alan-turing
+linkedin.com/in/alan-turing
+```
+
+The regular expression does NOT match URLs with additional subdirectories or query parameters, such as:
+
+```
+https://www.linkedin.com/in/linus-torvalds/latest-activity
+```
+
+Example usage:
+
+```
+if (Apify.utils.social.LINKEDIN_REGEX.test('https://www.linkedin.com/in/alan-turing')) {
+ console.log('Match!');
+}
+```
+
+---
+
+<a name="linkedin_regex_global"></a>
+
+## `social.LINKEDIN_REGEX_GLOBAL`
+
+Regular expression to find multiple LinkedIn profile URLs in a text or HTML. It has the following form: `/.../ig` and matches URLs such as:
+
+```
+https://www.linkedin.com/in/alan-turing
+en.linkedin.com/in/alan-turing
+linkedin.com/in/alan-turing
+```
+
+If the profile URL contains subdirectories or query parameters, the regular expression extracts just the base part of the profile URL. For example,
+from text such as:
+
+```
+https://www.linkedin.com/in/linus-torvalds/latest-activity
+```
+
+the expression extracts just the following base URL:
+
+```
+https://www.linkedin.com/in/linus-torvalds
+```
+
+Example usage:
+
+```
+const matches = text.match(Apify.utils.social.LINKEDIN_REGEX_GLOBAL);
+if (matches) console.log(`${matches.length} LinkedIn profiles found!`);
+```
+
+---
+
+<a name="instagram_regex"></a>
+
+## `social.INSTAGRAM_REGEX`
+
+Regular expression to exactly match a single Instagram profile URL. It has the following form: `/^...$/i` and matches URLs such as:
+
+```
+https://www.instagram.com/old_prague
+www.instagram.com/old_prague/
+instagr.am/old_prague
+```
+
+The regular expression does NOT match URLs with additional subdirectories or query parameters, such as:
+
+```
+https://www.instagram.com/cristiano/followers
+```
+
+Example usage:
+
+```
+if (Apify.utils.social.INSTAGRAM_REGEX.test('https://www.instagram.com/old_prague')) {
+ console.log('Match!');
+}
+```
+
+---
+
+<a name="instagram_regex_global"></a>
+
+## `social.INSTAGRAM_REGEX_GLOBAL`
+
+Regular expression to find multiple Instagram profile URLs in a text or HTML. It has the following form: `/.../ig` and matches URLs such as:
+
+```
+https://www.instagram.com/old_prague
+www.instagram.com/old_prague/
+instagr.am/old_prague
+```
+
+If the profile URL contains subdirectories or query parameters, the regular expression extracts just the base part of the profile URL. For example,
+from text such as:
+
+```
+https://www.instagram.com/cristiano/followers
+```
+
+the expression extracts just the following base URL:
+
+```
+https://www.instagram.com/cristiano
+```
+
+Example usage:
+
+```
+const matches = text.match(Apify.utils.social.INSTAGRAM_REGEX_GLOBAL);
+if (matches) console.log(`${matches.length} Instagram profiles found!`);
+```
+
+---
+
+<a name="twitter_regex"></a>
+
+## `social.TWITTER_REGEX`
+
+Regular expression to exactly match a single Twitter profile URL. It has the following form: `/^...$/i` and matches URLs such as:
+
+```
+https://www.twitter.com/apify
+twitter.com/apify
+```
+
+The regular expression does NOT match URLs with additional subdirectories or query parameters, such as:
+
+```
+https://www.twitter.com/realdonaldtrump/following
+```
+
+Example usage:
+
+```
+if (Apify.utils.social.TWITTER_REGEX.test('https://www.twitter.com/apify')) {
+ console.log('Match!');
+}
+```
+
+---
+
+<a name="twitter_regex_global"></a>
+
+## `social.TWITTER_REGEX_GLOBAL`
+
+Regular expression to find multiple Twitter profile URLs in a text or HTML. It has the following form: `/.../ig` and matches URLs such as:
+
+```
+https://www.twitter.com/apify
+twitter.com/apify
+```
+
+If the profile URL contains subdirectories or query parameters, the regular expression extracts just the base part of the profile URL. For example,
+from text such as:
+
+```
+https://www.twitter.com/realdonaldtrump/following
+```
+
+the expression extracts only the following base URL:
+
+```
+https://www.twitter.com/realdonaldtrump
+```
+
+Example usage:
+
+```
+const matches = text.match(Apify.utils.social.TWITTER_REGEX_STRING);
+if (matches) console.log(`${matches.length} Twitter profiles found!`);
+```
+
+---
+
+<a name="facebook_regex"></a>
+
+## `social.FACEBOOK_REGEX`
+
+Regular expression to exactly match a single Facebook profile URL. It has the following form: `/^...$/i` and matches URLs such as:
+
+```
+https://www.facebook.com/apifytech
+facebook.com/apifytech
+fb.com/apifytech
+https://www.facebook.com/profile.php?id=123456789
+```
+
+The regular expression does NOT match URLs with additional subdirectories or query parameters, such as:
+
+```
+https://www.facebook.com/apifytech/photos
+```
+
+Example usage:
+
+```
+if (Apify.utils.social.FACEBOOK_REGEX.test('https://www.facebook.com/apifytech')) {
+ console.log('Match!');
+}
+```
+
+---
+
+<a name="facebook_regex_global"></a>
+
+## `social.FACEBOOK_REGEX_GLOBAL`
+
+Regular expression to find multiple Facebook profile URLs in a text or HTML. It has the following form: `/.../ig` and matches URLs such as:
+
+```
+https://www.facebook.com/apifytech
+facebook.com/apifytech
+fb.com/apifytech
+```
+
+If the profile URL contains subdirectories or query parameters, the regular expression extracts just the base part of the profile URL. For example,
+from text such as:
+
+```
+https://www.facebook.com/apifytech/photos
+```
+
+the expression extracts only the following base URL:
+
+```
+https://www.facebook.com/apifytech
+```
+
+Example usage:
+
+```
+const matches = text.match(Apify.utils.social.FACEBOOK_REGEX_GLOBAL);
+if (matches) console.log(`${matches.length} Facebook profiles found!`);
+```
+
+---
+
+<a name="youtube_regex"></a>
+
+## `social.YOUTUBE_REGEX`
+
+Regular expression to exactly match a single Youtube video URL. It has the following form: `/^...$/i` and matches URLs such as:
+
+```
+https://www.youtube.com/watch?v=kM7YfhfkiEE
+https://youtu.be/kM7YfhfkiEE
+```
+
+Example usage:
+
+```
+if (Apify.utils.social.YOUTUBE_REGEX.test('https://www.youtube.com/watch?v=kM7YfhfkiEE')) {
+ console.log('Match!');
+}
+```
+
+---
+
+<a name="youtube_regex_global"></a>
+
+## `social.YOUTUBE_REGEX_GLOBAL`
+
+Regular expression to find multiple Youtube video URLs in a text or HTML. It has the following form: `/.../ig` and matches URLs such as:
+
+```
+https://www.youtube.com/watch?v=kM7YfhfkiEE
+https://youtu.be/kM7YfhfkiEE
+```
+
+Example usage:
+
+```
+const matches = text.match(Apify.utils.social.YOUTUBE_REGEX_GLOBAL);
+if (matches) console.log(`${matches.length} Youtube videos found!`);
+```
+
+---
+
+<a name="email_regex"></a>
+
+## `social.EMAIL_REGEX`
+
+Regular expression to exactly match a single email address. It has the following form: `/^...$/i`.
+
+---
+
+<a name="email_regex_global"></a>
+
+## `social.EMAIL_REGEX_GLOBAL`
+
+Regular expression to find multiple email addresses in a text. It has the following form: `/.../ig`.
+
+---
+
+<a name="emailsfromtext"></a>
+
+## `social.emailsFromText(text)`
+
+The function extracts email addresses from a plain text. Note that the function preserves the order of emails and keep duplicates.
+
+**Parameters**:
+
+- **`text`**: `string` - Text to search in.
+
+**Returns**:
+
+`Array<string>` - Array of emails addresses found. If no emails are found, the function returns an empty array.
+
+---
+
+<a name="emailsfromurls"></a>
+
+## `social.emailsFromUrls(urls)`
+
+The function extracts email addresses from a list of URLs. Basically it looks for all `mailto:` URLs and returns valid email addresses from them. Note
+that the function preserves the order of emails and keep duplicates.
+
+**Parameters**:
+
+- **`urls`**: `Array<string>` - Array of URLs.
+
+**Returns**:
+
+`Array<string>` - Array of emails addresses found. If no emails are found, the function returns an empty array.
+
+---
+
+<a name="phonesfromtext"></a>
+
+## `social.phonesFromText(text)`
+
+The function attempts to extract phone numbers from a text. Please note that the results might not be accurate, since phone numbers appear in a large
+variety of formats and conventions. If you encounter some problems, please [file an issue](https://github.com/apify/apify-js/issues).
+
+**Parameters**:
+
+- **`text`**: `string` - Text to search the phone numbers in.
+
+**Returns**:
+
+`Array<string>` - Array of phone numbers found. If no phone numbers are found, the function returns an empty array.
+
+---
+
+<a name="phonesfromurls"></a>
+
+## `social.phonesFromUrls(urls)`
+
+Finds phone number links in an array of URLs and extracts the phone numbers from them. Note that the phone number links look like `tel://123456789`,
+`tel:/123456789` or `tel:123456789`.
+
+**Parameters**:
+
+- **`urls`**: `Array<string>` - Array of URLs.
+
+**Returns**:
+
+`Array<string>` - Array of phone numbers found. If no phone numbers are found, the function returns an empty array.
+
+---
+
+<a name="parsehandlesfromhtml"></a>
+
+## `social.parseHandlesFromHtml(html, data)`
+
+The function attempts to extract emails, phone numbers and social profile URLs from a HTML document, specifically LinkedIn, Twitter, Instagram and
+Facebook profile URLs. The function removes duplicates from the resulting arrays and sorts the items alphabetically.
+
+Note that the `phones` field contains phone numbers extracted from the special phone links such as `[call us](tel:+1234556789)` (see
+[`social.phonesFromUrls()`](../api/social#phonesfromurls)) and potentially other sources with high certainty, while `phonesUncertain` contains phone
+numbers extracted from the plain text, which might be very inaccurate.
+
+**Example usage:**
+
+```javascript
+const Apify = require('apify');
+
+const browser = await Apify.launchPuppeteer();
+const page = await browser.newPage();
+await page.goto('http://www.example.com');
+const html = await page.content();
+
+const result = Apify.utils.social.parseHandlesFromHtml(html);
+console.log('Social handles:');
+console.dir(result);
+```
+
+**Parameters**:
+
+- **`html`**: `string` - HTML text
+- **`data`**: `Object` <code> = </code> - Optional object which will receive the `text` and `$` properties that contain text content of the HTML and
+ `cheerio` object, respectively. This is an optimization so that the caller doesn't need to parse the HTML document again, if needed.
+
+**Returns**:
+
+[`SocialHandles`](../typedefs/social-handles) - An object with the social handles.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/api/utils.md b/website/versioned_docs/version-0.22.4/api/utils.md
new file mode 100644
index 000000000..3154346d3
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/api/utils.md
@@ -0,0 +1,307 @@
+---
+id: version-0.22.4-utils
+title: utils
+original_id: utils
+---
+
+<a name="utils"></a>
+
+A namespace that contains various utilities.
+
+**Example usage:**
+
+```javascript
+const Apify = require('apify');
+
+...
+
+// Sleep 1.5 seconds
+await Apify.utils.sleep(1500);
+```
+
+---
+
+<a name="url_no_commas_regex"></a>
+
+## `utils.URL_NO_COMMAS_REGEX`
+
+Default regular expression to match URLs in a string that may be plain text, JSON, CSV or other. It supports common URL characters and does not
+support URLs containing commas or spaces. The URLs also may contain Unicode letters (not symbols).
+
+---
+
+<a name="url_with_commas_regex"></a>
+
+## `utils.URL_WITH_COMMAS_REGEX`
+
+Regular expression that, in addition to the default regular expression `URL_NO_COMMAS_REGEX`, supports matching commas in URL path and query. Note,
+however, that this may prevent parsing URLs from comma delimited lists, or the URLs may become malformed.
+
+---
+
+<a name="enqueuelinks"></a>
+
+## `utils.enqueueLinks(options)`
+
+The function finds elements matching a specific CSS selector (HTML anchor (`<a>`) by default) either in a Puppeteer page, or in a Cheerio object
+(parsed HTML), and enqueues the URLs in their `href` attributes to the provided [`RequestQueue`](../api/request-queue). If you're looking to find URLs
+in JavaScript heavy pages where links are not available in `href` elements, but rather navigations are triggered in click handlers see
+[`puppeteer.enqueueLinksByClickingElements()`](../api/puppeteer#enqueuelinksbyclickingelements).
+
+Optionally, the function allows you to filter the target links' URLs using an array of [`PseudoUrl`](../api/pseudo-url) objects and override settings
+of the enqueued [`Request`](../api/request) objects.
+
+**Example usage**
+
+```javascript
+await Apify.utils.enqueueLinks({
+ page,
+ requestQueue,
+ selector: 'a.product-detail',
+ pseudoUrls: ['https://www.example.com/handbags/[.*]', 'https://www.example.com/purses/[.*]'],
+});
+```
+
+**Parameters**:
+
+- **`options`**: `Object` - All `enqueueLinks()` parameters are passed via an options object with the following keys:
+
+ - **`[page]`**: `Page` - Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) object. Either `page` or `$` option must
+ be provided.
+ - **`[limit]`**: `Number` - Limit the count of actually enqueued URLs to this number. Useful for testing across the entire crawling scope.
+ - **`[$]`**: `CheerioStatic` - [`Cheerio`](https://github.com/cheeriojs/cheerio) function with loaded HTML. Either `page` or `$` option must be
+ provided.
+ - **`requestQueue`**: [`RequestQueue`](../api/request-queue) - A request queue to which the URLs will be enqueued.
+ - **`[selector]`**: `string` <code> = &quot;&#x27;a&#x27;&quot;</code> - A CSS selector matching links to be enqueued.
+ - **`[baseUrl]`**: `string` - A base URL that will be used to resolve relative URLs when using Cheerio. Ignored when using Puppeteer, since the
+ relative URL resolution is done inside the browser automatically.
+ - **`[pseudoUrls]`**: `Array<Object&gt;` | `Array.&lt;string>` - An array of [`PseudoUrl`](../api/pseudo-url)s matching the URLs to be enqueued,
+ or an array of strings or RegExps or plain Objects from which the [`PseudoUrl`](../api/pseudo-url)s can be constructed.
+
+ The plain objects must include at least the `purl` property, which holds the pseudo-URL string or RegExp. All remaining keys will be used as the
+ `requestTemplate` argument of the [`PseudoUrl`](../api/pseudo-url) constructor, which lets you specify special properties for the enqueued
+ [`Request`](../api/request) objects.
+
+ If `pseudoUrls` is an empty array, `null` or `undefined`, then the function enqueues all links found on the page.
+
+ - **`[transformRequestFunction]`**: [`RequestTransform`](../typedefs/request-transform) - Just before a new [`Request`](../api/request) is
+ constructed and enqueued to the [`RequestQueue`](../api/request-queue), this function can be used to remove it or modify its contents such as
+ `userData`, `payload` or, most importantly `uniqueKey`. This is useful when you need to enqueue multiple `Requests` to the queue that share
+ the same URL, but differ in methods or payloads, or to dynamically update or create `userData`.
+
+ For example: by adding `keepUrlFragment: true` to the `request` object, URL fragments will not be removed when `uniqueKey` is computed.
+
+ **Example:**
+
+ ```javascript
+ {
+ transformRequestFunction: request => {
+ request.userData.foo = 'bar';
+ request.keepUrlFragment = true;
+ return request;
+ };
+ }
+ ```
+
+**Returns**:
+
+[`Promise<Array<QueueOperationInfo>>`](../typedefs/queue-operation-info) - Promise that resolves to an array of
+[`QueueOperationInfo`](../typedefs/queue-operation-info) objects.
+
+---
+
+<a name="requestasbrowser"></a>
+
+## `utils.requestAsBrowser(options)`
+
+**IMPORTANT:** This function uses an insecure version of HTTP parser by default and also ignores SSL/TLS errors. This is very useful in scraping,
+because it allows bypassing certain anti-scraping walls, but it also exposes some vulnerability. For other than scraping scenarios, please set
+`useInsecureHttpParser: false` and `ignoreSslErrors: false`.
+
+Sends a HTTP request that looks like a request sent by a web browser, fully emulating browser's HTTP headers.
+
+This function is useful for web scraping of websites that send the full HTML in the first response. Thanks to this function, the target web server has
+no simple way to find out the request hasn't been sent by a full web browser. Using a headless browser for such requests is an order of magnitude more
+resource-intensive than this function. By default it aborts all requests that returns 406 status codes or non-HTML content-types. You can override
+this behavior by passing custom `abortFunction`.
+
+Currently, the function sends requests the same way as Firefox web browser does. In the future, it might add support for other browsers too.
+
+Internally, the function uses `httpRequest` function from the [@apify/http-request](https://github.com/apify/http-request) NPM package to perform the
+request. All `options` not recognized by this function are passed to it, so see it for more details.
+
+**Example usage:**
+
+```js
+const Apify = require('apify');
+
+const { utils: { requestAsBrowser } } = Apify;
+
+...
+
+const response = await requestAsBrowser({ url: 'https://www.example.com/' });
+
+const html = response.body;
+const status = response.statusCode;
+const contentType = response.headers['content-type'];
+```
+
+**Parameters**:
+
+- **`options`**: [`RequestAsBrowserOptions`](../typedefs/request-as-browser-options) - All `requestAsBrowser` configuration options.
+
+**Returns**:
+
+`Promise<(IncomingMessage|Readable)>` - This will typically be a
+[Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage), however, if returned from the cache it will be a
+[response-like object](https://github.com/lukechilds/responselike) which behaves in the same way.
+
+---
+
+<a name="isdocker"></a>
+
+## `utils.isDocker(forceReset)`
+
+Returns a `Promise` that resolves to true if the code is running in a Docker container.
+
+**Parameters**:
+
+- **`forceReset`**: `boolean`
+
+**Returns**:
+
+`Promise<boolean>`
+
+---
+
+<a name="sleep"></a>
+
+## `utils.sleep(millis)`
+
+Returns a `Promise` that resolves after a specific period of time. This is useful to implement waiting in your code, e.g. to prevent overloading of
+target website or to avoid bot detection.
+
+**Example usage:**
+
+```
+const Apify = require('apify');
+
+...
+
+// Sleep 1.5 seconds
+await Apify.utils.sleep(1500);
+```
+
+**Parameters**:
+
+- **`millis`**: `number` - Period of time to sleep, in milliseconds. If not a positive number, the returned promise resolves immediately.
+
+**Returns**:
+
+`Promise<void>`
+
+---
+
+<a name="downloadlistofurls"></a>
+
+## `utils.downloadListOfUrls(options)`
+
+Returns a promise that resolves to an array of urls parsed from the resource available at the provided url. Optionally, custom regular expression and
+encoding may be provided.
+
+**Parameters**:
+
+- **`options`**: `Object`
+ - **`url`**: `string` - URL to the file
+ - **`[encoding]`**: `string` <code> = &quot;&#x27;utf8&#x27;&quot;</code> - The encoding of the file.
+ - **`[urlRegExp]`**: `RegExp` <code> = URL_NO_COMMAS_REGEX</code> - Custom regular expression to identify the URLs in the file to extract. The
+ regular expression should be case-insensitive and have global flag set (i.e. `/something/gi`).
+
+**Returns**:
+
+`Promise<Array<string>>`
+
+---
+
+<a name="extracturls"></a>
+
+## `utils.extractUrls(options)`
+
+Collects all URLs in an arbitrary string to an array, optionally using a custom regular expression.
+
+**Parameters**:
+
+- **`options`**: `Object`
+ - **`string`**: `string`
+ - **`[urlRegExp]`**: `RegExp` <code> = Apify.utils.URL_NO_COMMAS_REGEX</code>
+
+**Returns**:
+
+`Array<string>`
+
+---
+
+<a name="htmltotext"></a>
+
+## `utils.htmlToText(html)`
+
+The function converts a HTML document to a plain text.
+
+The plain text generated by the function is similar to a text captured by pressing Ctrl+A and Ctrl+C on a page when loaded in a web browser. The
+function doesn't aspire to preserve the formatting or to be perfectly correct with respect to HTML specifications. However, it attempts to generate
+newlines and whitespaces in and around HTML elements to avoid merging distinct parts of text and thus enable extraction of data from the text (e.g.
+phone numbers).
+
+**Example usage**
+
+```javascript
+const text = htmlToText('<html><body>Some text</body></html>');
+console.log(text);
+```
+
+Note that the function uses [cheerio](https://www.npmjs.com/package/cheerio) to parse the HTML. Optionally, to avoid duplicate parsing of HTML and
+thus improve performance, you can pass an existing Cheerio object to the function instead of the HTML text. The HTML should be parsed with the
+`decodeEntities` option set to `true`. For example:
+
+```javascript
+const cheerio = require('cheerio');
+const html = '<html><body>Some text</body></html>';
+const text = htmlToText(cheerio.load(html, { decodeEntities: true }));
+```
+
+**Parameters**:
+
+- **`html`**: `string` | `CheerioStatic` - HTML text or parsed HTML represented using a [cheerio](https://www.npmjs.com/package/cheerio) function.
+
+**Returns**:
+
+`string` - Plain text
+
+---
+
+<a name="waitforruntofinish"></a>
+
+## `utils.waitForRunToFinish(options)`
+
+Returns a promise that resolves with the finished Run object when the provided actor run finishes or with the unfinished Run object when the
+`waitSecs` timeout lapses. The promise is NOT rejected based on run status. You can inspect the `status` property of the Run object to find out its
+status.
+
+This is useful when you need to chain actor executions. Similar effect can be achieved by using webhooks, so be sure to review which technique fits
+your use-case better.
+
+**Parameters**:
+
+- **`options`**: `object`
+ - **`actorId`**: `string` - ID of the actor that started the run.
+ - **`runId`**: `string` - ID of the run itself.
+ - **`[waitSecs]`**: `string` - Maximum time to wait for the run to finish, in seconds. If the limit is reached, the returned promise is resolved
+ to a run object that will have status `READY` or `RUNNING`. If `waitSecs` omitted, the function waits indefinitely.
+ - **`[token]`**: `string` - You can supply an Apify token to override the default one that's used by the default ApifyClient instance. E.g. you
+ can track other users' runs.
+
+**Returns**:
+
+[`Promise<ActorRun>`](../typedefs/actor-run)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/examples/accept_user_input.md b/website/versioned_docs/version-0.22.4/examples/accept_user_input.md
new file mode 100644
index 000000000..19c45e74d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/accept_user_input.md
@@ -0,0 +1,26 @@
+---
+id: version-0.22.4-accept-user-input
+title: Accept user input
+original_id: accept-user-input
+---
+
+This example accepts and logs user input:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const input = await Apify.getInput();
+ console.log(input);
+});
+```
+
+To provide the actor with input, create a `INPUT.json` file inside the "default" key-value store:
+
+```bash
+{PROJECT_FOLDER}/apify_storage/key_value_stores/default/INPUT.json
+```
+
+Anything in this file will be available to the actor when it runs.
+
+To learn about other ways to provide an actor with input, refer to the [Apify Platform Documentation](https://apify.com/docs/actor#run).
diff --git a/website/versioned_docs/version-0.22.4/examples/add_data_to_dataset.md b/website/versioned_docs/version-0.22.4/examples/add_data_to_dataset.md
new file mode 100644
index 000000000..76114cc2f
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/add_data_to_dataset.md
@@ -0,0 +1,38 @@
+---
+id: version-0.22.4-add-data-to-dataset
+title: Add data to dataset
+original_id: add-data-to-dataset
+---
+
+This example opens a dataset named `"my-cool-dataset"` and adds the URL of each request to it. If the dataset doesn't exist, it will be created.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Function called for each URL
+ const handleRequestFunction = async ({ request }) => {
+ // Open a dataset
+ const dataset = await Apify.openDataset('my-cool-dataset');
+ // Add data to dataset
+ await dataset.pushData({ url: request.url });
+ };
+ const crawler = new Apify.BasicCrawler({
+ requestList,
+ handleRequestFunction,
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+Each item in this dataset will be saved to its own file in the following directory:
+
+```bash
+{PROJECT_FOLDER}/apify_storage/datasets/my-cool-dataset/
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/basic_crawler.md b/website/versioned_docs/version-0.22.4/examples/basic_crawler.md
new file mode 100644
index 000000000..03c003d58
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/basic_crawler.md
@@ -0,0 +1,52 @@
+---
+id: version-0.22.4-basic-crawler
+title: Basic crawler
+original_id: basic-crawler
+---
+
+This is the most basic example of the Apify SDK, which demonstrates some of its elementary tools such as the [`BasicCrawler`](/docs/api/basic-crawler)
+and [`RequestList`](/docs/api/request-list) classes. The script simply downloads several web pages with plain HTTP requests using the
+[`Apify.utils.requestAsBrowser()`](/docs/api/utils#requestasbrowser) convenience function and stores their raw HTML and URL in the default dataset. In
+local configuration, the data will be stored as JSON files in `./apify_storage/datasets/default`.
+
+```javascript
+const Apify = require('apify');
+
+// Apify.main() function wraps the crawler logic (it is optional).
+Apify.main(async () => {
+ // Create and initialize an instance of the RequestList class that contains
+ // a list of URLs to crawl. Here we use just a few hard-coded URLs.
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.google.com/' },
+ { url: 'http://www.example.com/' },
+ { url: 'http://www.bing.com/' },
+ { url: 'http://www.wikipedia.com/' },
+ ]);
+
+ // Create a BasicCrawler - the simplest crawler that enables
+ // users to implement the crawling logic themselves.
+ const crawler = new Apify.BasicCrawler({
+ // Let the crawler fetch URLs from our list.
+ requestList,
+
+ // This function will be called for each URL to crawl.
+ handleRequestFunction: async ({ request }) => {
+ console.log(`Processing ${request.url}...`);
+
+ // Fetch the page HTML via Apify utils requestAsBrowser
+ const { body } = await Apify.utils.requestAsBrowser({ url: request.url });
+
+ // Store the HTML and URL to the default dataset.
+ await Apify.pushData({
+ url: request.url,
+ html: body,
+ });
+ },
+ });
+
+ // Run the crawler and wait for it to finish.
+ await crawler.run();
+
+ console.log('Crawler finished.');
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/call_actor.md b/website/versioned_docs/version-0.22.4/examples/call_actor.md
new file mode 100644
index 000000000..41f666dac
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/call_actor.md
@@ -0,0 +1,53 @@
+---
+id: version-0.22.4-call-actor
+title: Call actor
+original_id: call-actor
+---
+
+This example demonstrates how to start an Apify actor using [`Apify.call()`](/docs/api/apify#call) and how to call the Apify API using
+[`Apify.client`](/docs/api/apify#client). The script gets a random weird word and its explanation from [randomword.com](https://randomword.com/) and
+sends it to your email using the [`apify/send-mail`](https://apify.com/apify/send-mail) actor.
+
+To make the example work, you'll need an [Apify account](https://my.apify.com/). Go to the
+[Account - Integrations](https://my.apify.com/account#/integrations) page to obtain your API token and set it to the
+[`APIFY_TOKEN`](/docs/guides/environment-variables#APIFY_TOKEN) environment variable, or run the script using the Apify CLI. If you deploy this actor
+to the Apify Cloud, you can do things like set up a scheduler to run your actor early in the morning.
+
+To see what other actors are available, visit the [Apify Store](https://apify.com/store).
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Launch the web browser.
+ const browser = await Apify.launchPuppeteer();
+
+ console.log('Obtaining email address...');
+ const user = await Apify.client.users.getUser();
+
+ // Load randomword.com and get a random word
+ console.log('Fetching a random word.');
+ const page = await browser.newPage();
+ await page.goto('https://randomword.com/');
+ const randomWord = await page.$eval('#shared_section', el => el.outerHTML);
+
+ // Send random word to your email. For that, you can use an actor we already
+ // have available on the platform under the name: apify/send-mail.
+ // The second parameter to the Apify.call() invocation is the actor's
+ // desired input. You can find the required input parameters by checking
+ // the actor's documentation page: https://apify.com/apify/send-mail
+ console.log(`Sending email to ${user.email}...`);
+ await Apify.call('apify/send-mail', {
+ to: user.email,
+ subject: 'Random Word',
+ html: `<h1>Random Word</h1>${randomWord}`,
+ });
+ console.log('Email sent. Good luck!');
+
+ // Close Browser
+ await browser.close();
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/capture_screenshot.md b/website/versioned_docs/version-0.22.4/examples/capture_screenshot.md
new file mode 100644
index 000000000..9150ee17f
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/capture_screenshot.md
@@ -0,0 +1,137 @@
+---
+id: version-0.22.4-capture-screenshot
+title: Capture a screenshot
+original_id: capture-screenshot
+---
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+This example captures of a screenshot of a web page using `Puppeteer`:
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- PageScreenshot -->
+
+\
+Using `page.screenshot()`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const url = 'http://www.example.com/';
+ // Start a browser
+ const browser = await Apify.launchPuppeteer();
+ // Open new tab in the browser
+ const page = await browser.newPage();
+ // Navigate to the URL
+ await page.goto(url);
+ // Capture the screenshot
+ const screenshot = await page.screenshot();
+ // Save the screenshot to the default key-value store
+ await Apify.setValue('my-key', screenshot, { contentType: 'image/png' });
+ // Close Puppeteer
+ await browser.close();
+});
+```
+
+<!-- ApifySnapshot -->
+
+\
+Using `Apify.utils.puppeteer.saveSnapshot()`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const url = 'http://www.example.com/';
+ // Start a browser
+ const browser = await Apify.launchPuppeteer();
+ // Open new tab in the browser
+ const page = await browser.newPage();
+ // Navigate to the URL
+ await page.goto(url);
+ // Capture the screenshot
+ await Apify.utils.puppeteer.saveSnapshot(page, { key: 'my-key', saveHtml: false });
+ // Close Puppeteer
+ await browser.close();
+});
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
+
+This example captures a screenshot of multiple web pages when using `PuppeteerCrawler`:
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- PageScreenshot -->
+
+\
+Using `page.screenshot()`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Add URLs to a RequestList
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Function called for each URL
+ const handlePageFunction = async ({ request, page }) => {
+ // Capture the screenshot with Puppeteer
+ const screenshot = await page.screenshot();
+ // Convert the URL into a valid key
+ const key = request.url.replace(/[:/]/g, '_');
+ // Save the screenshot to the default key-value store
+ await Apify.setValue(key, screenshot, { contentType: 'image/png' });
+ };
+ // Create a PuppeteerCrawler
+ const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ handlePageFunction,
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!-- ApifySnapshot -->
+
+\
+Using `Apify.utils.puppeteer.saveSnapshot()`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Add URLs to a RequestList
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Function called for each URL
+ const handlePageFunction = async ({ request, page }) => {
+ // Convert the URL into a valid key
+ const key = request.url.replace(/[:/]/g, '_');
+ // Capture the screenshot
+ await Apify.utils.puppeteer.saveSnapshot(page, { key, saveHtml: false });
+ };
+ // Create a PuppeteerCrawler
+ const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ handlePageFunction,
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
+
+In both examples using `page.screenshot()`, a `key` variable is created based on the URL of the web page. This variable is used as the key when saving
+each screenshot into a key-value store.
diff --git a/website/versioned_docs/version-0.22.4/examples/cheerio_crawler.md b/website/versioned_docs/version-0.22.4/examples/cheerio_crawler.md
new file mode 100644
index 000000000..0e29d4e14
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/cheerio_crawler.md
@@ -0,0 +1,88 @@
+---
+id: version-0.22.4-cheerio-crawler
+title: Cheerio crawler
+original_id: cheerio-crawler
+---
+
+This example demonstrates how to use [`CheerioCrawler`](/docs/api/cheerio-crawler) to crawl a list of URLs from an external file, load each URL using
+a plain HTTP request, parse the HTML using the [Cheerio library](https://www.npmjs.com/package/cheerio) and extract some data from it: the page title
+and all `h1` tags.
+
+```javascript
+const Apify = require('apify');
+
+// Apify.utils contains various utilities, e.g. for logging.
+// Here we use debug level of logging to improve the debugging experience.
+// This functionality is optional!
+const { log } = Apify.utils;
+log.setLevel(log.LEVELS.DEBUG);
+
+// Apify.main() function wraps the crawler logic (it is optional).
+Apify.main(async () => {
+ // Create an instance of the RequestList class that contains a list of URLs to crawl.
+ // Add URLs to a RequestList
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Create an instance of the CheerioCrawler class - a crawler
+ // that automatically loads the URLs and parses their HTML using the cheerio library.
+ const crawler = new Apify.CheerioCrawler({
+ // Let the crawler fetch URLs from our list.
+ requestList,
+
+ // The crawler downloads and processes the web pages in parallel, with a concurrency
+ // automatically managed based on the available system memory and CPU (see AutoscaledPool class).
+ // Here we define some hard limits for the concurrency.
+ minConcurrency: 10,
+ maxConcurrency: 50,
+
+ // On error, retry each page at most once.
+ maxRequestRetries: 1,
+
+ // Increase the timeout for processing of each page.
+ handlePageTimeoutSecs: 30,
+
+ // Limit to 10 requests per one crawl
+ maxRequestsPerCrawl: 10,
+
+ // This function will be called for each URL to crawl.
+ // It accepts a single parameter, which is an object with options as:
+ // https://sdk.apify.com/docs/typedefs/cheerio-crawler-options#handlepagefunction
+ // We use for demonstration only 2 of them:
+ // - request: an instance of the Request class with information such as URL and HTTP method
+ // - $: the cheerio object containing parsed HTML
+ handlePageFunction: async ({ request, $ }) => {
+ log.debug(`Processing ${request.url}...`);
+
+ // Extract data from the page using cheerio.
+ const title = $('title').text();
+ const h1texts = [];
+ $('h1').each((index, el) => {
+ h1texts.push({
+ text: $(el).text(),
+ });
+ });
+
+ // Store the results to the default dataset. In local configuration,
+ // the data will be stored as JSON files in ./apify_storage/datasets/default
+ await Apify.pushData({
+ url: request.url,
+ title,
+ h1texts,
+ });
+ },
+
+ // This function is called if the page processing failed more than maxRequestRetries+1 times.
+ handleFailedRequestFunction: async ({ request }) => {
+ log.debug(`Request ${request.url} failed twice.`);
+ },
+ });
+
+ // Run the crawler and wait for it to finish.
+ await crawler.run();
+
+ log.debug('Crawler finished.');
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/crawl_all_links.md b/website/versioned_docs/version-0.22.4/examples/crawl_all_links.md
new file mode 100644
index 000000000..62571b276
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/crawl_all_links.md
@@ -0,0 +1,82 @@
+---
+id: version-0.22.4-crawl-all-links
+title: Crawl all links on a website
+original_id: crawl-all-links
+---
+
+This example uses the `Apify.enqueueLinks()` method to add new links to the `RequestQueue` as the crawler navigates from page to page. If only the
+required parameters are defined, all links will be crawled.
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- CheerioCrawler -->
+
+\
+Using `CheerioCrawler`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Create a RequestQueue
+ const requestQueue = await Apify.openRequestQueue();
+ // Define the starting URL
+ await requestQueue.addRequest({ url: 'https://apify.com/' });
+ // Function called for each URL
+ const handlePageFunction = async ({ request, $ }) => {
+ console.log(request.url);
+ // Add all links from page to RequestQueue
+ await Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ baseUrl: request.loadedUrl,
+ });
+ };
+ // Create a CheerioCrawler
+ const crawler = new Apify.CheerioCrawler({
+ requestQueue,
+ handlePageFunction,
+ maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl all links)
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!-- PuppeteerCrawler -->
+
+\
+Using `PuppeteerCrawler`:
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Create a RequestQueue
+ const requestQueue = await Apify.openRequestQueue();
+ // Define the starting URL
+ await requestQueue.addRequest({ url: 'https://apify.com/' });
+ // Function called for each URL
+ const handlePageFunction = async ({ request, page }) => {
+ console.log(request.url);
+ // Add all links from page to RequestQueue
+ await Apify.utils.enqueueLinks({
+ page,
+ requestQueue,
+ });
+ };
+ // Create a PuppeteerCrawler
+ const crawler = new Apify.PuppeteerCrawler({
+ requestQueue,
+ handlePageFunction,
+ maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl all links)
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
diff --git a/website/versioned_docs/version-0.22.4/examples/crawl_multiple_urls.md b/website/versioned_docs/version-0.22.4/examples/crawl_multiple_urls.md
new file mode 100644
index 000000000..595c4111b
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/crawl_multiple_urls.md
@@ -0,0 +1,104 @@
+---
+id: version-0.22.4-crawl-multiple-urls
+title: Crawl multiple URLs
+original_id: crawl-multiple-urls
+---
+
+This example crawls the specified list of URLs.
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- CheerioCrawler -->
+
+\
+Using `CheerioCrawler`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Create a RequestList
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Function called for each URL
+ const handlePageFunction = async ({ request, $ }) => {
+ const title = $('title').text();
+ console.log(`URL: ${request.url}\nTITLE: ${title}`);
+ };
+ // Create a CheerioCrawler
+ const crawler = new Apify.CheerioCrawler({
+ requestList,
+ handlePageFunction,
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!-- PuppeteerCrawler -->
+
+\
+Using `PuppeteerCrawler`:
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Create a RequestList
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Function called for each URL
+ const handlePageFunction = async ({ request, page }) => {
+ const title = await page.title();
+ console.log(`URL: ${request.url}\nTITLE: ${title}`);
+ };
+ // Create a PuppeteerCrawler
+ const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ handlePageFunction,
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!-- BasicCrawler -->
+
+\
+Using `BasicCrawler`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Create a RequestList
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Function called for each URL
+ const handleRequestFunction = async ({ request }) => {
+ const { body } = await Apify.utils.requestAsBrowser(request);
+ console.log(`URL: ${request.url}\nHTML:\n${body}`);
+ };
+ // Create a BasicCrawler
+ const crawler = new Apify.BasicCrawler({
+ requestList,
+ handleRequestFunction,
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
diff --git a/website/versioned_docs/version-0.22.4/examples/crawl_relative_links.md b/website/versioned_docs/version-0.22.4/examples/crawl_relative_links.md
new file mode 100644
index 000000000..74fc86d5a
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/crawl_relative_links.md
@@ -0,0 +1,37 @@
+---
+id: version-0.22.4-crawl-relative-links
+title: Crawl a website with relative links
+original_id: crawl-relative-links
+---
+
+If a website uses relative links, [`CheerioCrawler`](/docs/api/cheerio-crawler) and `Apify.enqueueLinks()` may have trouble following them. This is
+why it is important to set the `baseUrl` property within `Apify.enqueueLinks()` to `request.loadedUrl`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Create a RequestQueue
+ const requestQueue = await Apify.openRequestQueue();
+ // Define the starting URL
+ await requestQueue.addRequest({ url: 'https://apify.com/' });
+ // Function called for each URL
+ const handlePageFunction = async ({ request, $ }) => {
+ console.log(request.url);
+ // Add all links from page to RequestQueue
+ await Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ baseUrl: request.loadedUrl, // <-------------- important to set the base url here
+ });
+ };
+ // Create a CheerioCrawler
+ const crawler = new Apify.CheerioCrawler({
+ requestQueue,
+ handlePageFunction,
+ maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl all links)
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/crawl_single_url.md b/website/versioned_docs/version-0.22.4/examples/crawl_single_url.md
new file mode 100644
index 000000000..642624222
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/crawl_single_url.md
@@ -0,0 +1,19 @@
+---
+id: version-0.22.4-crawl-single-url
+title: Crawl a single URL
+original_id: crawl-single-url
+---
+
+This example uses the [`Apify.utils.requestAsBrowser()`](/docs/api/utils#utilsrequestasbrowseroptions) function to grab the HTML of a web page.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Get the HTML of a web page
+ const { body } = await Apify.utils.requestAsBrowser({ url: 'https://www.example.com' });
+ console.log(body);
+});
+```
+
+If you don't want to hard-code the URL into the script, refer to the [Accept User Input](accept-user-input) example.
diff --git a/website/versioned_docs/version-0.22.4/examples/crawl_sitemap.md b/website/versioned_docs/version-0.22.4/examples/crawl_sitemap.md
new file mode 100644
index 000000000..686d02528
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/crawl_sitemap.md
@@ -0,0 +1,104 @@
+---
+id: version-0.22.4-crawl-sitemap
+title: Crawl a sitemap
+original_id: crawl-sitemap
+---
+
+This example downloads and crawls the URLs from a sitemap.
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- BasicCrawler -->
+
+\
+Using `BasicCrawler`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Add URLs to a RequestList from a sitemap
+ const requestList = new Apify.RequestList({
+ sources: [{ requestsFromUrl: 'https://apify.com/sitemap.xml' }], // Sitemap url goes here
+ });
+ // Initialize the RequestList
+ await requestList.initialize();
+ // Function called for each URL
+ const handleRequestFunction = async ({ request }) => {
+ console.log(request.url);
+ };
+ // Create a BasicCrawler
+ const crawler = new Apify.BasicCrawler({
+ requestList,
+ handleRequestFunction,
+ maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl a sitemap)
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!-- CheerioCrawler -->
+
+\
+Using `CheerioCrawler`:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Add URLs to a RequestList from a sitemap
+ const requestList = new Apify.RequestList({
+ sources: [{ requestsFromUrl: 'https://apify.com/sitemap.xml' }], // Sitemap url goes here
+ });
+ // Initialize the RequestList
+ await requestList.initialize();
+ // Function called for each URL
+ const handlePageFunction = async ({ request }) => {
+ console.log(request.url);
+ };
+ // Create a CheerioCrawler
+ const crawler = new Apify.CheerioCrawler({
+ requestList,
+ handlePageFunction,
+ maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl a sitemap)
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!-- PuppeteerCrawler -->
+
+\
+Using `PuppeteerCrawler`:
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Add URLs to a RequestList from a sitemap
+ const requestList = new Apify.RequestList({
+ sources: [{ requestsFromUrl: 'https://apify.com/sitemap.xml' }], // Sitemap url goes here
+ });
+ // Initialize the RequestList
+ await requestList.initialize();
+ // Function called for each URL
+ const handlePageFunction = async ({ request }) => {
+ console.log(request.url);
+ };
+ // Create a PuppeteerCrawler
+ const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ handlePageFunction,
+ maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl a sitemap)
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
diff --git a/website/versioned_docs/version-0.22.4/examples/crawl_some_links.md b/website/versioned_docs/version-0.22.4/examples/crawl_some_links.md
new file mode 100644
index 000000000..bcf6aaee1
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/crawl_some_links.md
@@ -0,0 +1,38 @@
+---
+id: version-0.22.4-crawl-some-links
+title: Crawl some links on a website
+original_id: crawl-some-links
+---
+
+This [`CheerioCrawler`](/docs/api/cheerio-crawler) example uses the [`pseudoUrls`](/docs/api/pseudo-url) property in the `Apify.enqueueLinks()` method
+to only add links to the `RequestList` queue if they match the specified regular expression.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Create a RequestQueue
+ const requestQueue = await Apify.openRequestQueue();
+ // Define the starting URL
+ await requestQueue.addRequest({ url: 'https://apify.com/store' });
+ // Function called for each URL
+ const handlePageFunction = async ({ request, $ }) => {
+ console.log(request.url);
+ // Add some links from page to RequestQueue
+ await Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ baseUrl: request.loadedUrl,
+ pseudoUrls: ['http[s?]://apify.com/[.+]/[.+]'],
+ });
+ };
+ // Create a CheerioCrawler
+ const crawler = new Apify.CheerioCrawler({
+ requestQueue,
+ handlePageFunction,
+ maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl all links)
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/forms.md b/website/versioned_docs/version-0.22.4/examples/forms.md
new file mode 100644
index 000000000..f56a4b67d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/forms.md
@@ -0,0 +1,53 @@
+---
+id: version-0.22.4-forms
+title: Forms
+original_id: forms
+---
+
+This example demonstrates how to use [`PuppeteerCrawler`](/docs/api/puppeteer-crawler) to automatically fill and submit a search form to look up
+repositories on [GitHub](https://github.com) using headless Chrome / Puppeteer. The actor first fills in the search term, repository owner, start date
+and language of the repository, then submits the form and prints out the results. Finally, the results are saved either on the Apify platform to the
+default [`dataset`](/docs/api/dataset) or on the local machine as JSON files in `./apify_storage/datasets/default`.
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Launch the web browser.
+ const browser = await Apify.launchPuppeteer();
+
+ // Create and navigate new page
+ console.log('Open target page');
+ const page = await browser.newPage();
+ await page.goto('https://github.com/search/advanced');
+
+ // Fill form fields and select desired search options
+ console.log('Fill in search form');
+ await page.type('#adv_code_search input.js-advanced-search-input', 'apify-js');
+ await page.type('#search_from', 'apify');
+ await page.type('#search_date', '>2015');
+ await page.select('select#search_language', 'JavaScript');
+
+ // Submit the form and wait for full load of next page
+ console.log('Submit search form');
+ await Promise.all([page.waitForNavigation(), page.click('#adv_code_search button[type="submit"]')]);
+
+ // Obtain and print list of search results
+ const results = await page.$$eval('div.f4.text-normal a', nodes =>
+ nodes.map(node => ({
+ url: node.href,
+ name: node.innerText,
+ })),
+ );
+ console.log('Results:', results);
+
+ // Store data in default dataset
+ await Apify.pushData(results);
+
+ // Close browser
+ await browser.close();
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/handle_broken_links.md b/website/versioned_docs/version-0.22.4/examples/handle_broken_links.md
new file mode 100644
index 000000000..84fee4e88
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/handle_broken_links.md
@@ -0,0 +1,41 @@
+---
+id: version-0.22.4-handle-broken-links
+title: Handle broken links
+original_id: handle-broken-links
+---
+
+This example uses the `handleFailedRequestFunction` function to log failed requests. In a real-world project, you might choose to keep track of these
+failed requests by [saving them to a dataset](add-data-to-dataset).
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestList = await Apify.openRequestList('my-list', [
+ { url: 'http://www.example.com/page-1' },
+ { url: 'http://www.example.com/page-2' },
+ { url: 'http://www.example.com/page-3' },
+ ]);
+ // Function called for each successful request
+ const handleRequestFunction = async ({ request }) => {
+ if (request.url === 'http://www.example.com/page-3') {
+ throw new Error('Request function failed.');
+ } else {
+ console.log(`[success] ${request.url}`);
+ }
+ };
+ // Function called for each failed request
+ const handleFailedRequestFunction = async ({ request, error }) => {
+ console.log(`[failed] ${request.url} with error: ${error}`);
+ };
+ // Create a BasicCrawler
+ const crawler = new Apify.BasicCrawler({
+ requestList,
+ handleRequestFunction,
+ handleFailedRequestFunction,
+ maxRequestRetries: 1,
+ });
+ // Run the crawler
+ await crawler.run();
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/map_and_reduce.md b/website/versioned_docs/version-0.22.4/examples/map_and_reduce.md
new file mode 100644
index 000000000..1849d2c3b
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/map_and_reduce.md
@@ -0,0 +1,100 @@
+---
+id: version-0.22.4-map-and-reduce
+title: Dataset Map and Reduce methods
+original_id: map-and-reduce
+---
+
+This example shows an easy use-case of the [Apify dataset](https://docs.apify.com/storage/dataset) [`map`](/docs/api/dataset#map) and
+[`reduce`](/docs/api/dataset#reduce) methods. Both methods can be used to simplify the dataset results workflow process. Both can be called on the
+[dataset](/docs/api/dataset) directly.
+
+Important to mention is that both methods return a new result (`map` returns a new array and `reduce` can return any type) - neither method updates
+the dataset in any way.
+
+Examples for both methods are demonstrated on a simple dataset containing the results scraped from a page: the `URL` and a hypothetical number of
+`h1` - `h3` header elements under the `headingCount` key.
+
+This data structure is stored in the default dataset under `{PROJECT_FOLDER}/apify_storage/datasets/default/`. If you want to simulate the
+functionality, you can use the [`dataset.PushData()`](/docs/api/dataset#pushdata) method to save the example `JSON array` to your dataset.
+
+```json
+[
+ {
+ "url": "https://apify.com/",
+ "headingCount": 11
+ },
+ {
+ "url": "https://apify.com/storage",
+ "headingCount": 8
+ },
+ {
+ "url": "https://apify.com/proxy",
+ "headingCount": 4
+ }
+]
+```
+
+### Map
+
+The dataset `map` method is very similar to standard Array mapping methods. It produces a new array of values by mapping each value in the existing
+array through a transformation function and an options parameter.
+
+The `map` method used to check if are there more than 5 header elements on each page:
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // open default dataset
+ const dataSet = await Apify.openDataset();
+
+ // calling map function and filtering through mapped items
+ const moreThan5headers = (await dataSet.map(item => item.headingCount)).filter(count => count > 5);
+
+ // saving result of map to default Key-value store
+ await Apify.setValue('pages_with_more_than_5_headers', moreThan5headers);
+});
+```
+
+The `moreThan5headers` variable is an array of `headingCount` attributes where the number of headers is greater than 5.
+
+The `map` method's result value saved to the [`key-value store`](/docs/api/key-value-store) should be:
+
+```javascript
+[11, 8];
+```
+
+### Reduce
+
+The dataset `reduce` method does not produce a new array of values - it reduces a list of values down to a single value. The method iterates through
+the items in the dataset using the [`memo` argument](/docs/api/dataset#datasetreduceiteratee-memo-options). After performing the necessary
+calculation, the `memo` is sent to the next iteration, while the item just processed is reduced (removed).
+
+Using the `reduce` method to get the total number of headers scraped (all items in the dataset):
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // open default dataset
+ const dataSet = await Apify.openDataset();
+
+ // calling reduce function and using memo to calculate number of headers
+ const pagesHeadingCount = await dataSet.reduce((memo, value) => {
+ memo += value.headingCount;
+ return memo;
+ }, 0);
+
+ // saving result of reduce to default Key-value store
+ await Apify.setValue('pages_heading_count', pagesHeadingCount);
+});
+```
+
+The original dataset will be reduced to a single value, `pagesHeadingCount`, which contains the count of all headers for all scraped pages (all
+dataset items).
+
+The `reduce` method's result value saved to the [key-value store](/docs/api/key-value-store) should be:
+
+```javascript
+23;
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/puppeteer_crawler.md b/website/versioned_docs/version-0.22.4/examples/puppeteer_crawler.md
new file mode 100644
index 000000000..b47eaa40a
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/puppeteer_crawler.md
@@ -0,0 +1,90 @@
+---
+id: version-0.22.4-puppeteer-crawler
+title: Puppeteer crawler
+original_id: puppeteer-crawler
+---
+
+This example demonstrates how to use [`PuppeteerCrawler`](/docs/api/puppeteer-crawler) in combination with [`RequestQueue`](/docs/api/request-queue)
+to recursively scrape the [Hacker News website](https://news.ycombinator.com) using headless Chrome / Puppeteer. The crawler starts with a single URL,
+finds links to next pages, enqueues them and continues until no more desired links are available. The results are stored to the default dataset. In
+local configuration, the results are stored as JSON files in `./apify_storage/datasets/default`
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Apify.openRequestQueue() is a factory to get a preconfigured RequestQueue instance.
+ // We add our first request to it - the initial page the crawler will visit.
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://news.ycombinator.com/' });
+
+ // Create an instance of the PuppeteerCrawler class - a crawler
+ // that automatically loads the URLs in headless Chrome / Puppeteer.
+ const crawler = new Apify.PuppeteerCrawler({
+ requestQueue,
+
+ // Here you can set options that are passed to the Apify.launchPuppeteer() function.
+ launchPuppeteerOptions: {
+ // For example, by adding "slowMo" you'll slow down Puppeteer operations to simplify debugging
+ // slowMo: 500,
+ },
+
+ // Stop crawling after several pages
+ maxRequestsPerCrawl: 10,
+
+ // This function will be called for each URL to crawl.
+ // Here you can write the Puppeteer scripts you are familiar with,
+ // with the exception that browsers and pages are automatically managed by the Apify SDK.
+ // The function accepts a single parameter, which is an object with the following fields:
+ // - request: an instance of the Request class with information such as URL and HTTP method
+ // - page: Puppeteer's Page object (see https://pptr.dev/#show=api-class-page)
+ handlePageFunction: async ({ request, page }) => {
+ console.log(`Processing ${request.url}...`);
+
+ // A function to be evaluated by Puppeteer within the browser context.
+ const data = await page.$$eval('.athing', $posts => {
+ const scrapedData = [];
+
+ // We're getting the title, rank and URL of each post on Hacker News.
+ $posts.forEach($post => {
+ scrapedData.push({
+ title: $post.querySelector('.title a').innerText,
+ rank: $post.querySelector('.rank').innerText,
+ href: $post.querySelector('.title a').href,
+ });
+ });
+
+ return scrapedData;
+ });
+
+ // Store the results to the default dataset.
+ await Apify.pushData(data);
+
+ // Find a link to the next page and enqueue it if it exists.
+ const infos = await Apify.utils.enqueueLinks({
+ page,
+ requestQueue,
+ selector: '.morelink',
+ });
+
+ if (infos.length === 0) console.log(`${request.url} is the last page!`);
+ },
+
+ // This function is called if the page processing failed more than maxRequestRetries+1 times.
+ handleFailedRequestFunction: async ({ request }) => {
+ console.log(`Request ${request.url} failed too many times`);
+ await Apify.pushData({
+ '#debug': Apify.utils.createRequestDebugInfo(request),
+ });
+ },
+ });
+
+ // Run the crawler and wait for it to finish.
+ await crawler.run();
+
+ console.log('Crawler finished.');
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/puppeteer_recursive_crawl.md b/website/versioned_docs/version-0.22.4/examples/puppeteer_recursive_crawl.md
new file mode 100644
index 000000000..39de7e78b
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/puppeteer_recursive_crawl.md
@@ -0,0 +1,38 @@
+---
+id: version-0.22.4-puppeteer-recursive-crawl
+title: Puppeteer recursive crawl
+original_id: puppeteer-recursive-crawl
+---
+
+Run the following example to perform a recursive crawl of a website using [`PuppeteerCrawler`](/docs/api/puppeteer-crawler).
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://www.iana.org/' });
+ const pseudoUrls = [new Apify.PseudoUrl('https://www.iana.org/[.*]')];
+
+ const crawler = new Apify.PuppeteerCrawler({
+ requestQueue,
+ handlePageFunction: async ({ request, page }) => {
+ const title = await page.title();
+ console.log(`Title of ${request.url}: ${title}`);
+ await Apify.utils.enqueueLinks({
+ page,
+ selector: 'a',
+ pseudoUrls,
+ requestQueue,
+ });
+ },
+ maxRequestsPerCrawl: 10,
+ maxConcurrency: 10,
+ });
+
+ await crawler.run();
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/puppeteer_sitemap.md b/website/versioned_docs/version-0.22.4/examples/puppeteer_sitemap.md
new file mode 100644
index 000000000..707eb9f7e
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/puppeteer_sitemap.md
@@ -0,0 +1,39 @@
+---
+id: version-0.22.4-puppeteer-sitemap
+title: Puppeteer sitemap
+original_id: puppeteer-sitemap
+---
+
+This example demonstrates how to use [`PuppeteerCrawler`](/docs/api/puppeteer-crawler) to crawl a list of web pages specified in a sitemap. The
+crawler extracts the page title and URL from each page and stores them as a record in the default dataset. In local configuration, the results are
+stored as JSON files in `./apify_storage/datasets/default`.
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestList = new Apify.RequestList({
+ sources: [{ requestsFromUrl: 'https://apify.com/sitemaps.xml' }],
+ });
+ await requestList.initialize();
+
+ const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ maxRequestsPerCrawl: 10,
+ handlePageFunction: async ({ page, request }) => {
+ console.log(`Processing ${request.url}...`);
+ await Apify.pushData({
+ url: request.url,
+ title: await page.title(),
+ html: await page.content(),
+ });
+ },
+ });
+
+ await crawler.run();
+ console.log('Done.');
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/puppeteer_with_proxy.md b/website/versioned_docs/version-0.22.4/examples/puppeteer_with_proxy.md
new file mode 100644
index 000000000..4b96a4096
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/puppeteer_with_proxy.md
@@ -0,0 +1,34 @@
+---
+id: version-0.22.4-puppeteer-with-proxy
+title: Puppeteer with proxy
+original_id: puppeteer-with-proxy
+---
+
+This example demonstrates how to load pages in headless Chrome / Puppeteer over [Apify Proxy](https://docs.apify.com/proxy). To make it work, you'll
+need an Apify account with access to the proxy. Visit the [Apify platform introduction](/docs/guides/apify-platform) to find how to log into your
+account from the SDK.
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestList = await Apify.openRequestList('my-list', ['https://en.wikipedia.org/wiki/Main_Page']);
+ const proxyConfiguration = await Apify.createProxyConfiguration();
+
+ const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ proxyConfiguration,
+ handlePageFunction: async ({ page }) => {
+ const title = await page.title();
+ console.log(`Page title: ${title}`);
+ },
+ });
+
+ console.log('Running Puppeteer script...');
+ await crawler.run();
+ console.log('Puppeteer closed.');
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/screenshots.md b/website/versioned_docs/version-0.22.4/examples/screenshots.md
new file mode 100644
index 000000000..35c8fb814
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/screenshots.md
@@ -0,0 +1,65 @@
+---
+id: version-0.22.4-screenshots
+title: Screenshots
+original_id: screenshots
+---
+
+This example demonstrates how to read and write data to the default key-value store using [`Apify.getValue()`](/docs/api/apify#apifygetvaluekey) and
+[`Apify.setValue()`](/docs/api/apify#apifysetvaluekey-value-options).
+
+The script crawls a list of URLs using Puppeteer, captures a screenshot of each page, and saves it to the store. The list of URLs is provided as actor
+input that is also read from the store.
+
+In local configuration, the input is stored in the default key-value store's directory as a JSON file at
+`./apify_storage/key_value_stores/default/INPUT.json`. You need to create the file and set it with the following content:
+
+```json
+{ "sources": [{ "url": "https://www.google.com" }, { "url": "https://www.duckduckgo.com" }] }
+```
+
+On the Apify cloud, the input can be either set manually in the UI app or passed as the POST payload to the
+[Run actor API call](https://apify.com/docs/api/v2#/reference/actors/run-collection/run-actor). For more details, see
+[Input and output](https://docs.apify.com/actor/run#input-and-output) in the Apify Actor documentation.
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the source tab of your
+> actor configuration.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Read the actor input configuration containing the URLs for the screenshot.
+ // By convention, the input is present in the actor's default key-value store under the "INPUT" key.
+ const input = await Apify.getInput();
+ if (!input) throw new Error('Have you passed the correct INPUT ?');
+
+ const { sources } = input;
+
+ const requestList = new Apify.RequestList({ sources });
+ await requestList.initialize();
+
+ const crawler = new Apify.PuppeteerCrawler({
+ requestList,
+ handlePageFunction: async ({ page, request }) => {
+ console.log(`Processing ${request.url}...`);
+
+ // This is a Puppeteer function that takes a screenshot of the page and returns its buffer.
+ const screenshotBuffer = await page.screenshot();
+
+ // The record key may only include the following characters: a-zA-Z0-9!-_.'()
+ const key = request.url.replace(/[:/]/g, '_');
+
+ // Save the screenshot. Choosing the right content type will automatically
+ // assign the local file the right extension, in this case .png.
+ // The screenshots will be stored in ./apify_storage/key_value_stores/default/
+ await Apify.setValue(key, screenshotBuffer, { contentType: 'image/png' });
+ console.log(`Screenshot of ${request.url} saved.`);
+ },
+ });
+
+ // Run crawler.
+ await crawler.run();
+
+ console.log('Crawler finished.');
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/examples/synchronous_run.md b/website/versioned_docs/version-0.22.4/examples/synchronous_run.md
new file mode 100644
index 000000000..14a17230e
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/examples/synchronous_run.md
@@ -0,0 +1,39 @@
+---
+id: version-0.22.4-synchronous-run
+title: Synchronous run
+original_id: synchronous-run
+---
+
+This example shows a quick actor that has a run time of just a few seconds. It opens a [web page](https://en.wikipedia.org) (the Wikipedia home page),
+which contains a list of "Did you know" texts that change daily. The actor scrapes all the "Did you know" items and saves them to the default dataset.
+
+This actor can be invoked synchronously using a single HTTP request to directly obtain its output as a response, using the
+[Run actor synchronously](https://apify.com/docs/api/v2#/reference/actors/run-actor-synchronously/without-input) Apify API endpoint.
+
+> To run this example on the Apify Platform, select the `Node.js 12 + Chrome on Debian (apify/actor-node-chrome)` base image on the **Source** tab
+> when configuring the actor.
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ // Launch web browser.
+ const browser = await Apify.launchPuppeteer({ headless: true });
+ // Load https://en.wikipedia.org and get all "Did you know" texts.
+ console.log('Opening web page...');
+ const page = await browser.newPage();
+ await page.goto('https://en.wikipedia.org');
+
+ // Get all "Did you know" items from the page.
+ console.log('Getting "Did you know" items from the page.');
+ const results = await page.$$eval('div#mp-dyk > ul li', nodes => nodes.map(node => node.innerText.replace('...', 'Did you know')));
+ console.log(results);
+
+ // Save all the items to the Apify dataSet.
+ await Apify.pushData(results);
+ console.log('Actor finished.');
+
+ // Close browser
+ await browser.close();
+});
+```
diff --git a/website/versioned_docs/version-0.22.4/guides/apify_platform.md b/website/versioned_docs/version-0.22.4/guides/apify_platform.md
new file mode 100644
index 000000000..cc0c72214
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/apify_platform.md
@@ -0,0 +1,71 @@
+---
+id: version-0.22.4-apify-platform
+title: Apify Platform
+original_id: apify-platform
+---
+
+Apify is a [platform](https://apify.com) built to serve large scale and high performance web scraping
+and automation needs. It provides easy access to [compute instances (Actors)](#what-is-an-actor),
+[convenient storages](../guides/data-storage), [proxies](../guides/proxy-management),
+[scheduling](https://docs.apify.com/scheduler), [webhooks](https://docs.apify.com/webhooks)
+and [more](https://docs.apify.com/), accessible through a [web interface](https://my.apify.com)
+or an [API](https://docs.apify.com/api).
+
+While we think that the Apify platform is super cool, and you should definitely try the
+[free account](https://my.apify.com/sign-up), **Apify SDK is and will always be open source**,
+runnable locally or on any cloud infrastructure.
+
+> Note that we do not test Apify SDK in other cloud environments such as Lambda or on specific
+> architectures such as Raspberry PI. We strive to make it work, but there's no guarantee.
+
+## Logging into Apify platform from Apify SDK
+To access your [Apify account](https://my.apify.com/sign-up) from the SDK, you must provide
+credentials - [your API token](https://my.apify.com/account#/integrations). You can do that
+either by utilizing [Apify CLI](https://github.com/apify/apify-cli) or by environment
+variables.
+
+Once you provide credentials to your scraper, you will be able to use all the Apify platform
+features of the SDK, such as calling Actors, saving to cloud storages, using Apify proxies,
+setting up webhooks and so on.
+
+### Log in with CLI
+Apify CLI allows you to log in to your Apify account on your computer. If you then run your
+scraper using the CLI, your credentials will automatically be added.
+
+```
+npm install -g apify-cli
+```
+```
+apify login -t YOUR_API_TOKEN
+```
+In your project folder:
+```
+apify run -p
+```
+
+### Log in with environment variables
+If you prefer not to use Apify CLI, you can always provide credentials to your scraper
+by setting the [`APIFY_TOKEN`](../guides/environment-variables#apify_token) environment
+variable to your API token.
+
+> There's also the [`APIFY_PROXY_PASSWORD`](../guides/environment-variables#apify_proxy_password)
+> environment variable. It is automatically inferred from your token by the SDK, but it can be useful
+> when you need to access proxies from a different account than your token represents.
+
+## What is an Actor
+When you deploy your script to the Apify platform, it becomes an [actor](https://apify.com/actors).
+Actor is a serverless microservice that accepts an input and produces an output. It can run for
+a few seconds, hours or even infinitely. An actor can perform anything from a simple action such
+as filling out a web form or sending an email, to complex operations such as crawling an entire website
+and removing duplicates from a large dataset.
+
+Actors can be shared in the [Apify Store](https://apify.com/store) so that other people can use them.
+But don't worry, if you share your actor in the store and somebody uses it, it runs under their account,
+not yours.
+
+**Related links**
+
+- [Store of existing actors](https://apify.com/store)
+- [Documentation](https://docs.apify.com/actor)
+- [View actors in Apify app](https://my.apify.com/actors)
+- [API reference](https://apify.com/docs/api/v2#/reference/actors)
diff --git a/website/versioned_docs/version-0.22.4/guides/data_storage.md b/website/versioned_docs/version-0.22.4/guides/data_storage.md
new file mode 100644
index 000000000..44b5f3262
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/data_storage.md
@@ -0,0 +1,163 @@
+---
+id: version-0.22.4-data-storage
+title: Data Storage
+original_id: data-storage
+---
+
+The Apify SDK has several data storage types that are useful for specific tasks. The data is stored either on local disk to a directory defined by the
+`APIFY_LOCAL_STORAGE_DIR` environment variable, or on the [Apify platform](../guides/apify-platform) under the user account
+identified by the API token defined by the `APIFY_TOKEN` environment variable. If neither of these variables is defined, by default Apify SDK sets
+`APIFY_LOCAL_STORAGE_DIR` to `./apify_storage` in the current working directory and prints a warning.
+
+Typically, you will be developing the code on your local computer and thus set the `APIFY_LOCAL_STORAGE_DIR` environment variable. Once the code is
+ready, you will deploy it to the Apify platform, where it will automatically set the `APIFY_TOKEN` environment variable and thus use cloud storage. No
+code changes are needed.
+
+**Related links**
+
+- [Apify platform storage documentation](https://docs.apify.com/storage)
+- [View storage in Apify app](https://my.apify.com/storage)
+- [API reference](https://apify.com/docs/api/v2#/reference/key-value-stores)
+
+## Key-value store
+
+The key-value store is used for saving and reading data records or files. Each data record is represented by a unique key and associated with a MIME
+content type. Key-value stores are ideal for saving screenshots of web pages, PDFs or to persist the state of crawlers.
+
+Each actor run is associated with a **default key-value store**, which is created exclusively for the actor run. By convention, the actor run input
+and output is stored in the default key-value store under the `INPUT` and `OUTPUT` key, respectively. Typically the input and output is a JSON file,
+although it can be any other format.
+
+In the Apify SDK, the key-value store is represented by the [`KeyValueStore`](../api/key-value-store) class. In order to simplify access to the default
+key-value store, the SDK also provides [`Apify.getValue()`](../api/apify#getvalue) and
+[`Apify.setValue()`](../api/apify#setvalue) functions.
+
+In local configuration, the data is stored in the directory specified by the `APIFY_LOCAL_STORAGE_DIR` environment variable as follows:
+
+```
+{APIFY_LOCAL_STORAGE_DIR}/key_value_stores/{STORE_ID}/{KEY}.{EXT}
+```
+
+Note that `{STORE_ID}` is the name or ID of the key-value store. The default key value store has ID `default`, unless you override it by setting the
+`APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable. The `{KEY}` is the key of the record and `{EXT}` corresponds to the MIME content type of the
+data value.
+
+The following code demonstrates basic operations of key-value stores:
+
+```javascript
+// Get actor input from the default key-value store
+const input = await Apify.getInput();
+
+// Write actor output to the default key-value store.
+await Apify.setValue('OUTPUT', { myResult: 123 });
+
+// Open a named key-value store
+const store = await Apify.openKeyValueStore('some-name');
+
+// Write record. JavaScript object is automatically converted to JSON,
+// strings and binary buffers are stored as they are
+await store.setValue('some-key', { foo: 'bar' });
+
+// Read record. Note that JSON is automatically parsed to a JavaScript object,
+// text data returned as a string and other data is returned as binary buffer
+const value = await store.getValue('some-key');
+
+// Delete record
+await store.setValue('some-key', null);
+```
+
+To see a real-world example of how to get the input from the key-value store, see the [Screenshots](../examples/screenshots) example.
+
+## Dataset
+
+Datasets are used to store structured data where each object stored has the same attributes, such as online store products or real estate offers. You
+can imagine a dataset as a table, where each object is a row and its attributes are columns. Dataset is an append-only storage - you can only add new
+records to it but you cannot modify or remove existing records.
+
+When the dataset is stored on the [Apify platform](../guides/apify-platform), you can export its data to the following formats: HTML,
+JSON, CSV, Excel, XML and RSS. The datasets are displayed on the actor run details page and in the
+[Storage](https://my.apify.com/storage) section in the Apify app. The actual data is exported using the
+[Get dataset items](https://apify.com/docs/api/v2#/reference/datasets/item-collection/get-items) Apify API endpoint. This
+way you can easily share crawling results.
+
+Each actor run is associated with a **default dataset**, which is created exclusively for the actor run. Typically, it is used to store crawling
+results specific for the actor run. Its usage is optional.
+
+In the Apify SDK, the dataset is represented by the [`Dataset`](../api/dataset) class. In order to simplify writes to the default dataset, the SDK
+also provides the [`Apify.pushData()`](../api/apify#pushdata) function.
+
+In local configuration, the data is stored in the directory specified by the `APIFY_LOCAL_STORAGE_DIR` environment variable as follows:
+
+```
+{APIFY_LOCAL_STORAGE_DIR}/datasets/{DATASET_ID}/{INDEX}.json
+```
+
+Note that `{DATASET_ID}` is the name or ID of the dataset. The default dataset has ID `default`, unless you override it by setting the
+`APIFY_DEFAULT_DATASET_ID` environment variable. Each dataset item is stored as a separate JSON file, where `{INDEX}` is a zero-based index of the
+item in the dataset.
+
+The following code demonstrates basic operations of the dataset:
+
+```javascript
+// Write a single row to the default dataset
+await Apify.pushData({ col1: 123, col2: 'val2' });
+
+// Open a named dataset
+const dataset = await Apify.openDataset('some-name');
+
+// Write a single row
+await dataset.pushData({ foo: 'bar' });
+
+// Write multiple rows
+await dataset.pushData([{ foo: 'bar2', col2: 'val2' }, { col3: 123 }]);
+```
+
+To see how to use the dataset to store crawler results, see the [Cheerio Crawler](../examples/cheerio-crawler) example.
+
+## Request queue
+
+The request queue is a storage of URLs to crawl. The queue is used for the deep crawling of websites, where you start with several URLs and then
+recursively follow links to other pages. The data structure supports both breadth-first and depth-first crawling orders.
+
+Each actor run is associated with a **default request queue**, which is created exclusively for the actor run. Typically, it is used to store URLs to
+crawl in the specific actor run. Its usage is optional.
+
+In Apify SDK, the request queue is represented by the [`RequestQueue`](../api/request-queue) class.
+
+In local configuration, the request queue data is stored in the directory specified by the `APIFY_LOCAL_STORAGE_DIR` environment variable as follows:
+
+```
+{APIFY_LOCAL_STORAGE_DIR}/request_queues/{QUEUE_ID}/{STATE}/{NUMBER}.json
+```
+
+Note that `{QUEUE_ID}` is the name or ID of the request queue. The default queue has ID `default`, unless you override it by setting the
+`APIFY_DEFAULT_REQUEST_QUEUE_ID` environment variable. Each request in the queue is stored as a separate JSON file, where `{STATE}` is either
+`handled` or `pending`, and `{NUMBER}` is an integer indicating the position of the request in the queue.
+
+The following code demonstrates basic operations of the request queue:
+
+```javascript
+// Open the default request queue associated with the actor run
+const queue = await Apify.openRequestQueue();
+
+// Open a named request queue
+const queueWithName = await Apify.openRequestQueue('some-name');
+
+// Enqueue few requests
+await queue.addRequest({ url: 'http://example.com/aaa' });
+await queue.addRequest({ url: 'http://example.com/bbb' });
+await queue.addRequest({ url: 'http://example.com/foo/bar' }, { forefront: true });
+
+// Get requests from queue
+const request1 = await queue.fetchNextRequest();
+const request2 = await queue.fetchNextRequest();
+const request3 = await queue.fetchNextRequest();
+
+// Mark a request as handled
+await queue.markRequestHandled(request1);
+
+// If processing fails then reclaim the request back to the queue, so that it's crawled again
+await queue.reclaimRequest(request2);
+```
+
+To see how to use the request queue with a crawler, see the [Puppeteer Crawler](../examples/puppeteer-crawler) example.
diff --git a/website/versioned_docs/version-0.22.4/guides/environment_variables.md b/website/versioned_docs/version-0.22.4/guides/environment_variables.md
new file mode 100644
index 000000000..6f344f424
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/environment_variables.md
@@ -0,0 +1,76 @@
+---
+id: version-0.22.4-environment-variables
+title: Environment Variables
+original_id: environment-variables
+---
+
+The following is a list of the environment variables used by Apify SDK that are available to the user.
+The SDK is capable of running without any env vars present, but certain features will only become available
+after env vars are properly set. You can use [Apify CLI](https://github.com/apify/apify-cli)
+to set the env vars for you. [Apify platform](../guides/apify-platform) also sets the variables automatically.
+
+## Important env vars:
+The following environment variables have large impact on the way Apify SDK works and its behavior
+can be changed significantly by setting or unsetting them.
+
+### `APIFY_LOCAL_STORAGE_DIR`
+Defines the path to a local directory where [`KeyValueStore`](../api/key-value-store),
+[`Dataset`](../api/dataset), and [`RequestQueue`](../api/request-queue) store their data.
+Typically it is set to `./apify_storage`. If omitted, you should define the [`APIFY_TOKEN`](#apify_token)
+environment variable instead.
+
+### `APIFY_TOKEN`
+The API token for your Apify account. It is used to access the Apify API, e.g. to access cloud storage
+or to run an actor on the Apify platform. You can find your API token on the
+[Account - Integrations](https://my.apify.com/account#/integrations) page. If omitted,
+you should define the `APIFY_LOCAL_STORAGE_DIR` environment variable instead.
+
+### Combinations of `APIFY_LOCAL_STORAGE_DIR` and `APIFY_TOKEN`
+By combining the env vars in various ways, you can greatly influence the behavior of Apify SDK.
+
+| Env Vars | API | Storages |
+| ------------------------------------------- | --- | -------------- |
+| none OR `APIFY_LOCAL_STORAGE_DIR` | no | local |
+| `APIFY_TOKEN` | yes | Apify platform |
+| `APIFY_TOKEN` AND `APIFY_LOCAL_STORAGE_DIR` | yes | local+platform |
+
+When using both `APIFY_TOKEN` and `APIFY_LOCAL_STORAGE_DIR`, you can use all the Apify platform
+features and your data will be stored locally by default. If you want to access platform storages,
+you can use the `{ forceCloud: true }` option in their respective functions.
+
+```js
+const localDataset = await Apify.openDataset('my-local-data');
+const remoteDataset = await Apify.openDataset('my-remote-data', { forceCloud: true });
+```
+
+## Convenience env vars:
+The next group includes env vars that can help achieve certain goals without having to change
+your code, such as temporarily switching log level to DEBUG.
+
+### `APIFY_HEADLESS`
+If set to `1`, web browsers launched by Apify SDK will run in the headless mode. You can still override
+this setting in the code, e.g. by passing the `headless: true` option to the
+[`Apify.launchPuppeteer()`](../api/apify#launchpuppeteer) function. But having this setting
+in an environment variable allows you to develop the crawler locally in headful mode to simplify the debugging,
+and only run the crawler in headless mode once you deploy it to the Apify platform. By default, the browsers
+are launched in headful mode, i.e. with windows.
+
+### `APIFY_LOG_LEVEL`
+Specifies the minimum log level, which can be one of the following values (in order of severity):
+`DEBUG`, `INFO`, `WARNING` and `ERROR`. By default, the log level is set to `INFO`,
+which means that `DEBUG` messages are not printed to console. See the [`utils.log`](../api/log)
+namespace for logging utilities.
+
+### `APIFY_MEMORY_MBYTES`
+Sets the amount of system memory in megabytes to be used by the [`AutoscaledPool`](../api/autoscaled-pool).
+It is used to limit the number of concurrently running tasks. By default, the max amount of memory
+to be used is set to one quarter of total system memory, i. e. on a system with 8192 MB of memory,
+the autoscaling feature will only use up to 2048 MB of memory.
+
+### `APIFY_PROXY_PASSWORD`
+Optional password to [Apify Proxy](https://docs.apify.com/proxy) for IP address rotation.
+If you have an Apify Account, you can find the password on the [Proxy page](https://my.apify.com/proxy)
+in the Apify app. The password is automatically inferred using the `APIFY_TOKEN` env var,
+so in most cases, you don't need to touch it. You should use it when, for some reason,
+you need access to Apify Proxy, but no access to Apify API, or when you need access to
+proxy from a different account than your token represents.
diff --git a/website/versioned_docs/version-0.22.4/guides/getting_started.md b/website/versioned_docs/version-0.22.4/guides/getting_started.md
new file mode 100644
index 000000000..e7f3b2808
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/getting_started.md
@@ -0,0 +1,1745 @@
+---
+id: version-0.22.4-getting-started
+title: Getting Started
+original_id: getting-started
+---
+
+Without the right tools, crawling and scraping the web can be a difficult thing. At the very least, you need an HTTP client to make the necessary
+requests, but that only gets you raw HTML and sometimes not even that. Then you have to read this HTML and extract the data you're interested in. Once
+extracted, it must be stored in a machine readable format and easily accessible for further processing, because it is the processed data that hold
+value.
+
+Apify SDK covers the process end-to-end. From crawling the web for links and scraping the raw data to storing it in various machine readable formats,
+ready for processing. With this guide in hand, you should have your own data extraction solutions up and running in a few hours.
+
+## Intro
+
+The goal of this getting started guide is to provide a step-by-step introduction to all the features of the Apify SDK. It will walk you through
+creating the simplest of crawlers that only print text to console, all the way up to complex systems that crawl pages, interact with them as if a real
+user were sitting in front of a real browser and output structured data.
+
+Since Apify SDK is usable both locally on any computer and on the [Apify Platform](../guides/apify-platform), you will be able
+to use the source code in both environments interchangeably. Nevertheless, some initial setup is still required, so choose your preferred starting
+environment and let's get into it.
+
+## Setting up locally
+
+To run Apify SDK on your own computer, you need to meet the following pre-requisites first:
+
+1. Have Node.js version 10.17 or higher, with the exception of Node.js 11, installed.
+ - Visit [Node.js website](https://nodejs.org/en/download/) to download or use
+ [nvm](https://github.com/creationix/nvm)
+2. Have NPM installed.
+ - NPM comes bundled with Node.js so you should already have it. If not, reinstall Node.js.
+
+If you're not certain, confirm the pre-requisites by running:
+
+```bash
+node -v
+```
+
+```bash
+npm -v
+```
+
+### Creating a new project
+
+The fastest and best way to create new projects with the Apify SDK is to use our own
+[Apify CLI](https://www.npmjs.com/package/apify-cli). This command line tool allows you to create, run and manage Apify
+projects with ease, including their deployment to the [Apify platform](../guides/apify-platform) if you wish to run them in the
+cloud after developing them locally.
+
+Let's install the Apify CLI with the following command:
+
+```bash
+npm install -g apify-cli
+```
+
+Once the installation finishes, all you need to do to set up an Apify SDK project is to run:
+
+```bash
+apify create my-new-project
+```
+
+A prompt will be shown, asking to choose a template. Disregard the different options for now and choose the template labeled `Hello world`. The
+command will now create a new directory in your current working directory, called `my-new-project`, create a `package.json` in this folder and install
+all the necessary dependencies. It will also add example source code that you can immediately run.
+
+Let's try that!
+
+```bash
+cd my-new-project
+```
+
+```bash
+apify run -p
+```
+
+> The `-p` flag is great to remember, because it stands for `--purge` and it clears out your persistent storages before starting the actor.
+> `INPUT.json` and named storages are kept. Whenever you're just restarting your actor and you're not interested in the data of the previous run, you
+> should use `apify run -p` to prevent the old state from messing with your current run. If this is confusing, don't worry. You'll learn about
+> storages and `INPUT.json` soon.
+
+You should start seeing log messages in the terminal as the system boots up and after a second, a Chromium browser window should pop up. In the
+window, you'll see quickly changing pages and back in the terminal, you should see the titles (contents of the `<title>` HTML tags) of the pages
+printed.
+
+You can always terminate the crawl with a keypress in the terminal:
+
+```bash
+CTRL+C
+```
+
+Did you see all that? If you did, congratulations! You're ready to go!
+
+## Setting up on the Apify Platform
+
+Maybe you don't have Node.js installed and don't want the hassle. Or you can't install anything on your computer because you're using a company
+provided one. Or perhaps you'd just prefer to start working in the cloud right away. Well, no worries, we've got you covered.
+
+The [Apify platform](../guides/apify-platform) is the foundational product of
+[Apify](https://apify.com). It's a serverless cloud computing platform, specifically designed for any web automation jobs,
+that may include crawling and scraping, but really works amazing for any batch jobs and long running tasks.
+
+It comes with a free account, so let's go to our [sign-up page](https://my.apify.com/sign-up) and create one, if you
+haven't already. Don't forget to verify your email. Without it, you won't be able to run any projects.
+
+Once you're in, you might be prompted by our in-app help to walk through a step-by-step guide into some of our new features. Feel free to finish that,
+if you'd like, but once you're done, click on the **Actors** tab in the left menu. To read more about **Actors**, see:
+[What is an Actor](../guides/apify-platform#what-is-an-actor).
+
+### Creating a new project
+
+In the page that shows after clicking on Actors in the left menu, choose **Create new**. Give it a name in the form that opens, let's say,
+`my-new-actor`. Disregard all the available options for now and save your changes.
+
+Now click on the **Sources** tab at the top. Disregard the version and environment variables inputs for now and proceed directly to **Source code**.
+This is where you develop the actor, if you choose not to do it locally. Just press **Run** below the **Source code** panel. It will automatically
+build and run the example source code. You should start seeing log messages that represent the build and after the build is complete, log messages of
+the running actor. Feel free to check out the other **Run** tabs, such as **Info**, where you can find useful information about the run, or
+**Key-value-store**, where the actor's **INPUT** and **OUTPUT** are stored.
+
+Good job. You're now ready to run your own source code on the Apify Platform. For more information visit the
+[Actor documentation page](https://docs.apify.com/actor), where you'll find everything about the platform's various
+options.
+
+## First crawler
+
+Whether you've chosen to develop locally or in the cloud, it's time to start writing some actual source code. But before we do, let me just briefly
+introduce all the Apify SDK classes necessary to make it happen.
+
+### The general idea
+
+There are 3 crawler classes available for use in the Apify SDK. [`BasicCrawler`](../api/basic-crawler), [`CheerioCrawler`](../api/cheerio-crawler)
+and [`PuppeteerCrawler`](../api/puppeteer-crawler). We'll talk about their differences later. Now, let's talk about what they have in common.
+
+All the crawlers' general idea is to go to a web page, open it, do some stuff there, save some results and continue to the next page, until it's done
+its job. So each time the crawler needs to find answers to two questions: **Where should I go?** and **What should I do there?**. Answering those two
+questions is the only setup mandatory to run the crawlers.
+
+### The Where - `Request`, `RequestList` and `RequestQueue`
+
+All crawlers use instances of the [`Request`](../api/request) class to determine where they need to go. Each request may hold a lot of information,
+but at the very least, it must hold a URL - a web page to open. But having only one URL would not make sense for crawling. We need to either have a
+pre-existing list of our own URLs that we wish to visit, perhaps a thousand, or a million, or we need to build this list dynamically as we crawl,
+adding more and more URLs to the list as we progress.
+
+A representation of the pre-existing list is an instance of the [`RequestList`](../api/request-list) class. It is a static, immutable list of URLs and
+other metadata (see the [`Request`](../api/request) object) that the crawler will visit, one by one, retrying whenever an error occurs, until there
+are no more `Requests` to process.
+
+[`RequestQueue`](../api/request-queue) on the other hand, represents a dynamic queue of `Requests`. One that can be updated at runtime by adding more
+pages - `Requests` to process. This allows the crawler to open one page, extract interesting URLs, such as links to other pages on the same domain,
+add them to the queue (called _enqueuing_) and repeat this process to build a queue of tens of thousands or more URLs while knowing only a single one
+at the beginning.
+
+`RequestList` and `RequestQueue` are essential for the crawler's operation. There is no other way to supply `Requests` = "pages to crawl" to the
+crawlers. At least one of them always needs to be provided while setting up. You can also use both at the same time, if you wish.
+
+### The What - `handlePageFunction`
+
+The `handlePageFunction` is the brain of the crawler. It tells it what to do at each and every page it visits. Generally it handles extraction of data
+from the page, processing the data, saving it, calling APIs, doing calculations and whatever else you need it to do, really.
+
+The `handlePageFunction` is provided by you, the user, and invoked automatically by the crawler for each `Request` from either the `RequestList` or
+`RequestQueue`. It always receives a single argument and that is a plain `Object`. Its properties change depending on the used crawler class, but it
+always includes at least the `request` property, which represents the currently crawled `Request` instance (i.e. the URL the crawler is visiting and
+related metadata) and the `autoscaledPool` property, which is an instance of the [`AutoscaledPool`](../api/autoscaled-pool) class and we'll talk about
+it in detail later.
+
+```js
+// The object received as a single argument by the handlePageFunction
+{
+ request: Request,
+ autoscaledPool: AutoscaledPool
+}
+```
+
+### Putting it all together
+
+Enough theory! Let's put some of those hard learned facts into practice. We learned above that we need `Requests` and a `handlePageFunction` to setup
+a crawler. We will also use the [`Apify.main()`](../api/apify#main) function. It's not mandatory, but it makes our life easier. We'll
+learn about it in detail later on.
+
+Let's start super easy. Visit one page, get its title and close. First of all we need to require Apify, to make all of its features available to us:
+
+```js
+const Apify = require('apify');
+```
+
+Easy right? It doesn't get much more difficult, trust me. For the purposes of this tutorial, we'll be scraping our own webpage
+[https://apify.com](https://apify.com). Now, to get there, we need a `Request` with the page's URL in one of our sources,
+`RequestList` or `RequestQueue`. Let's go with `RequestQueue` for now.
+
+```js
+const Apify = require('apify');
+
+// This is how you use the Apify.main() function.
+Apify.main(async () => {
+ // First we create the request queue instance.
+ const requestQueue = await Apify.openRequestQueue();
+ // And then we add a request to it.
+ await requestQueue.addRequest({ url: 'https://apify.com' });
+});
+```
+
+> If you're not familiar with the `async` and `await` keywords used in the example, trust that it is a native syntax in modern JavaScript and you can
+> [learn more about it here](https://nikgrozev.com/2017/10/01/async-await/).
+
+The [`requestQueue.addRequest()`](../api/request-queue#addrequest) function automatically converts the plain object we passed to it to a
+`Request` instance, so now we have a `requestQueue` that holds one `request` which points to `https://apify.com`. Now we need the
+`handlePageFunction`.
+
+```js
+// We'll define the function separately so it's more obvious.
+const handlePageFunction = async ({ request, $ }) => {
+ // This should look familiar if you ever worked with jQuery.
+ // We're just getting the text content of the <title> HTML element.
+ const title = $('title').text();
+
+ console.log(`The title of "${request.url}" is: ${title}.`);
+};
+```
+
+Wait, where did the `$` come from? Remember what we learned about the `handlePageFunction` earlier. It expects a plain `Object` as an argument that
+will always have a `request` property, but it will also have other properties, depending on the chosen crawler class. Well, `$` is a property provided
+by the `CheerioCrawler` class which we'll set up right now.
+
+```js
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://apify.com' });
+
+ const handlePageFunction = async ({ request, $ }) => {
+ const title = $('title').text();
+
+ console.log(`The title of "${request.url}" is: ${title}.`);
+ };
+
+ // Set up the crawler, passing a single options object as an argument.
+ const crawler = new Apify.CheerioCrawler({
+ requestQueue,
+ handlePageFunction,
+ });
+
+ await crawler.run();
+});
+```
+
+And we're done! You just created your first crawler from scratch. It will download the HTML of `https://apify.com`, find the `<title>` element, get
+its text content and print it to console. Good job!
+
+To run the code locally, copy and paste the code, if you haven't already typed it in yourself, to the `main.js` file in the `my-new-project` we
+created earlier and run `apify run` from that project's directory.
+
+To run the code on Apify Platform, just replace the original example with your new code and hit Run.
+
+Whichever environment you choose, you should see the message
+`The title of "https://apify.com" is: Web Scraping, Data Extraction and Automation - Apify.` printed to the screen. If you do, congratulations and
+let's move onto some bigger challenges! And if you feel like you don't really know what just happened there, no worries, it will all become clear when
+you learn more about the `CheerioCrawler`.
+
+## CheerioCrawler aka jQuery crawler
+
+This is the crawler that we used in our earlier example. Our simplest and also the fastest crawling solution. If you're familiar with `jQuery`, you'll
+understand [`CheerioCrawler`](../api/cheerio-crawler) in minutes. [Cheerio](https://www.npmjs.com/package/cheerio) is
+essentially `jQuery` for Node.js. It offers the same API, including the familiar `$` object. You can use it, as you would `jQuery`, for manipulating
+the DOM of a HTML page. In crawling, you'll mostly use it to select the right elements and extract their text values - the data you're interested in.
+But `jQuery` runs in a browser and attaches directly to the browser's DOM. Where does `cheerio` get its HTML? This is where the `Crawler` part of
+[`CheerioCrawler`](../api/cheerio-crawler) comes in.
+
+### Overview
+
+[`CheerioCrawler`](../api/cheerio-crawler) crawls by making plain HTTP requests to the provided URLs. As you remember from the previous section, the
+URLs are fed to the crawler using either the [`RequestList`](../api/cheerio-crawler) or the [`RequestQueue`](../api/cheerio-crawler). The HTTP responses
+it gets back are HTML pages, the same pages you would get in your browser when you first load a URL.
+
+> Note, however, that modern web pages often do not serve all of their content in the first HTML response, but rather the first HTML contains links to
+> other resources such as CSS and JavaScript that get downloaded afterwards and together they create the final page. See our
+> [`PuppeteerCrawler`](../api/puppeteer-crawler) to crawl those.
+
+Once the page's HTML is retrieved, the crawler will pass it to [Cheerio](https://www.npmjs.com/package/cheerio) for
+parsing. The result is the typical `$` function, which should be familiar to `jQuery` users. You can use this `$` to do all sorts of lookups and
+manipulations over the page's HTML, but in scraping, we will mostly use it to find specific HTML elements and extract their data.
+
+Example use of Cheerio and its `$` function in comparison to browser JavaScript:
+
+```js
+// Return the text content of the <title> element.
+document.querySelector('title').textContent; // plain JS
+$('title').text(); // Cheerio
+
+// Return an array of all 'href' links on the page.
+Array.from(document.querySelectorAll('[href]')).map(el => el.href); // plain JS
+$('[href]')
+ .map((i, el) => $(el).attr('href'))
+ .get(); // Cheerio
+```
+
+> This is not to show that Cheerio is better than plain browser JavaScript. Some might actually prefer the more expressive way plain JS provides.
+> Unfortunately, the browser JavaScript methods are not available in Node.js, so Cheerio is our best bet to do the parsing.
+
+### When to use [`CheerioCrawler`](../api/cheerio-crawler)
+
+Even though using `CheerioCrawler` is extremely easy, it probably will not be your first choice for most kinds of crawling or scraping in production
+environments. Since most websites nowadays use modern JavaScript to create rich, responsive and data driven user experiences, the plain HTTP requests
+the crawler uses may just fall short of your needs.
+
+But `CheerioCrawler` is far from useless! It really shines when you need to do extremely high workloads. With just 4 GBs of memory and a single CPU
+core, you can scrape 500 or more pages a minute! _(assuming each page contains approximately 400KB of HTML)_ To get this high with a full browser
+scraper, such as the [`PuppeteerCrawler`](../api/puppeteer-crawler), you'd need significantly more computing power.
+
+**Advantages:**
+
+- Extremely fast
+- Easy to set up
+- Familiar for jQuery users
+- Super cheap to run
+- Each request can go through a different proxy
+
+**Disadvantages:**
+
+- Does not work for all websites
+- May easily overload the target website with requests
+- Does not enable any manipulation of the website before scraping
+
+### Basic use of [`CheerioCrawler`](../api/cheerio-crawler)
+
+Now that we have an idea of the crawler's inner workings, let's build one. We'll use the example from the previous section and improve on it by
+letting it truly crawl the page, finding new links as it goes, enqueuing them into the `RequestQueue` and then scraping them.
+
+#### Refresher
+
+Just to refresh your memory, in the previous section we built a very simple crawler that downloads HTML of a single page, reads its title and prints
+it to the console. This is the original source code:
+
+```js
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://apify.com' });
+
+ const handlePageFunction = async ({ request, $ }) => {
+ const title = $('title').text();
+
+ console.log(`The title of "${request.url}" is: ${title}.`);
+ };
+
+ // Set up the crawler, passing a single options object as an argument.
+ const crawler = new Apify.CheerioCrawler({
+ requestQueue,
+ handlePageFunction,
+ });
+
+ await crawler.run();
+});
+```
+
+Earlier we said that we would let the crawler:
+
+1. Find new links on the page
+2. Filter only those pointing to `apify.com`
+3. Enqueue them to the `RequestQueue`
+4. Scrape the newly enqueued links
+
+So let's get to it!
+
+#### Finding new links
+
+There are numerous approaches to finding links to follow when crawling the web. For our purposes, we will be looking for `<a>` elements that contain
+the `href` attribute. For example `<a href="https://apify.com/store>This is a link to Apify Store</a>`. To do this, we need to update our Cheerio
+function.
+
+```js
+const links = $('a[href]')
+ .map((i, el) => $(el).attr('href'))
+ .get();
+```
+
+Our new function finds all the `<a>` elements that contain the `href` attribute and extracts the attributes into an array of strings. There is a
+problem though. There can be relative links in the list and those can't be used on their own. We need to resolve them using our domain as base URL and
+we will use one of Node.js' standard libraries to do this.
+
+```js
+// At the top of the file:
+const { URL } = require('url');
+
+// ...
+
+const ourDomain = 'https://apify.com';
+const absoluteUrls = links.map(link => new URL(link, ourDomain));
+```
+
+#### Filtering links to same domain
+
+Websites typically contain a lot of links that lead away from the original page. This is normal, but when crawling a website, we usually want to crawl
+this one site and do not let our crawler wander away to Google, Facebook and Twitter. Therefore, we need to filter out the off-domain links and only
+keep the ones that lead to the same domain.
+
+> Don't worry, we'll learn how to do this with a single function call using Apify in a few moments.
+
+```js
+// At the top of the file:
+const { URL } = require('url');
+
+// ...
+
+const links = $('a[href]')
+ .map((i, el) => $(el).attr('href'))
+ .get();
+
+const ourDomain = 'apify.com';
+const absoluteUrls = links.map(link => new URL(link, ourDomain));
+
+const sameDomainLinks = absoluteUrls.filter(url => url.href.startsWith(ourDomain));
+
+// ...
+```
+
+#### Enqueueing links to `RequestQueue`
+
+This should be easy, because we already did that [earlier](#putting-it-all-together), remember? Just call `requestQueue.addRequest()` for all the new
+links. This will add them to the end of the queue for processing.
+
+```js
+// At the top of the file:
+const { URL } = require('url');
+
+// ...
+
+const links = $('a[href]')
+ .map((i, el) => $(el).attr('href'))
+ .get();
+
+const ourDomain = 'https://apify.com';
+const absoluteUrls = links.map(link => new URL(link, ourDomain));
+
+const sameDomainLinks = absoluteUrls.filter(url => url.href.startsWith(ourDomain));
+
+// Add the requests in series. There's of course room for speed
+// improvement by parallelization. Try to implement it, if you wish.
+console.log(`Enqueueing ${sameDomainLinks.length} URLs.`);
+for (const url of sameDomainLinks) {
+ await requestQueue.addRequest({ url: url.href });
+}
+
+// ...
+```
+
+#### Scrape the newly enqueued links
+
+And we're approching the finishing line. All we need to do now is just integrate the new code into our original crawler. It will be easy, because
+almost everything needs to go into the `handlePageFunction`. But just before we do that, let me introduce the first crawler configuration option, that
+is not a `handlePageFunction` or `requestQueue`. It's called `maxRequestsPerCrawl`.
+
+##### The `maxRequestsPerCrawl` limit
+
+This configuration option is available in all crawler classes and you can use it to limit the number of `Requests` the crawler should process. It's
+very useful when you're just testing your code or when your crawler could potentially crawl millions of pages and you want to save resources. You can
+add it to the crawler options like this:
+
+```js
+const crawler = new Apify.CheerioCrawler({
+ maxRequestsPerCrawl: 20,
+ requestQueue,
+ handlePageFunction,
+});
+```
+
+This limits the number of successfully handled `Requests` to 20. Bear in mind that the actual number of processed requests might be a little higher
+and that's because usually there are multiple `Requests` processed at the same time and once the 20th `Request` finishes, the other running `Requests`
+will be allowed to finish too.
+
+#### Putting it all together
+
+```js
+const { URL } = require('url'); // <------ This is new.
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://apify.com' });
+
+ const handlePageFunction = async ({ request, $ }) => {
+ const title = $('title').text();
+ console.log(`The title of "${request.url}" is: ${title}.`);
+
+ // Here starts the new part of handlePageFunction.
+ const links = $('a[href]')
+ .map((i, el) => $(el).attr('href'))
+ .get();
+
+ const ourDomain = 'https://apify.com';
+ const absoluteUrls = links.map(link => new URL(link, ourDomain));
+
+ const sameDomainLinks = absoluteUrls.filter(url => url.href.startsWith(ourDomain));
+
+ console.log(`Enqueueing ${sameDomainLinks.length} URLs.`);
+ for (const url of sameDomainLinks) {
+ await requestQueue.addRequest({ url: url.href });
+ }
+ };
+
+ const crawler = new Apify.CheerioCrawler({
+ maxRequestsPerCrawl: 20, // <------ This is new too.
+ requestQueue,
+ handlePageFunction,
+ });
+
+ await crawler.run();
+});
+```
+
+No matter if you followed along with our coding or just copy pasted the resulting source, try running it now, perhaps even in both environments. You
+should see the crawler log the **title** of the first page, then the **enqueueing** message showing number of URLs, followed by the **title** of the
+first enqueued page and so on and so on.
+
+> If you need help with running the code, refer back to the chapters on environment setup: [Setting up locally](#setting-up-locally) and
+> [Setting up on the Apify Platform](#setting-up-on-the-apify-platform).
+
+## Using Apify SDK to enqueue links like a boss
+
+If you were paying attention carefully in the previous chapter, we said that we would show a way to enqueue new `Requests` with a single function
+call. You might be wondering why we had to go through the whole process of getting the individual links, filtering the same domain ones and then
+manually enqueuing them into the `RequestQueue`, when there is a simpler way.
+
+Well, the obvious reason is practice. This is a tutorial after all. The other reason is to make you think about all the bits and pieces that come
+together, so that in the end, a new page, not previously entered in by you, can be scraped. We think that by seeing the bigger picture, you will be
+able to get the most out of Apify SDK.
+
+### Meet `Apify.utils`
+
+We will talk at length about them later, but in short, `Apify.utils` is a namespace where you can find various helpful functions and constants that
+make your life easier. One of the available functions is `Apify.utils.enqueueLinks()` which encapsulates the whole enqueueing process and even adds
+some extra functionality.
+
+### Introduction to `Apify.utils.enqueueLinks()`
+
+Since enqueuing new links to crawl is such an integral part of web crawling, we created a function that attempts to simplify this process as much as
+possible. With a single function call, it allows you to find all the links on a page that match specified criteria and add them to a `RequestQueue`.
+It also allows you to modify the resulting `Requests` to match your crawling needs.
+
+`enqueueLinks` is quite a powerful function so, like crawlers, it gets its arguments from an options object. This is useful, because you don't have to
+remember their order! But also because we can easily extend its API and add new features. You can
+[find the full reference here](../api/utils#enqueuelinks).
+
+We suggest using ES6 destructuring to grab the `enqueueLinks()` function off of the `utils` object, so you don't have to type `Apify.utils` all the
+time.
+
+```js
+const Apify = require('apify');
+const {
+ utils: { enqueueLinks },
+} = Apify;
+
+// Now you can use enqueueLinks like this:
+await enqueueLinks({
+ /* options */
+});
+```
+
+### Basic use of `enqueueLinks()` with `CheerioCrawler`
+
+We already implemented logic that takes care of enqueueing new links to a `RequestQueue` in the previous chapter on `CheerioCrawler`. Let's look at
+that logic and implement the same functionality using `enqueueLinks()`.
+
+We found that the crawler needed to do these 4 things to crawl `apify.com`:
+
+1. Find new links on the page
+2. Filter only those pointing to `apify.com`
+3. Enqueue them to the `RequestQueue`
+4. Scrape the newly enqueued links
+
+Using `enqueueLinks()` we can squash the first 3 into a single function call, if we set the options correctly. For now, let's just stick to the
+basics. At the very least, we need a source where to find the links and the queue to enqueue them to. The `$` Cheerio object is one of the sources the
+function accepts and we already know how to work with it in the `handlePageFunction`. We also know how to get a `requestQueue` instance.
+
+```js
+// Assuming previous existence of the '$' and 'requestQueue' variables.
+await enqueueLinks({ $, requestQueue });
+```
+
+That's all we need to do to enqueue all `<a href="...">` links from the given page to the given queue. Easy, right? Scratch number 1 and 3 off the
+list. Only number 2 remains and to tackle this one, we need to talk about yet another new concept, the pseudo-URL.
+
+#### Introduction to pseudo-URLs
+
+Pseudo-URLs are represented by our `PseudoUrl` class and even though the name sounds discouraging, they're a pretty simple concept. They're just URLs
+with some parts replaced by wildcards (read <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions">regular
+expressions</a>). They are matched against URLs to find specific links, domains, patterns, file extensions and so on.
+
+In scraping, there usually are patterns to be found in the websites' URLs that can be leveraged to scrape only the pages we're interested in. Imagine
+a typical online store. It has different categories which list different items The URL for might looks something like this:
+
+```
+https://www.online-store.com/categories
+```
+
+A category would then have a different URL:
+
+```
+https://www.online-store.com/categories/computers
+```
+
+Going to this page would produce a list of offered computers. Then, clicking on one of the computers might take us to a detail URL:
+
+```
+https://www.online-store.com/items/613804
+```
+
+As you can see, there's a structure to the links. In the real world, the structure might not always be perfectly obvious, but it's very often there.
+Pseudo-URLs help to use this structure to select only the relevant links from a given page.
+
+#### Structure of a pseudo-URL
+
+Pseudo-URL is a URL with [regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)) enclosed
+in `[]` brackets. Since we're running Node.js, the regular expressions should follow the JavaScript style.
+
+For example, a pseudo-URL
+
+```
+https://www.online-store.com/categories/[(\w|-)+]
+```
+
+will match all of the following URLs:
+
+```
+https://www.online-store.com/categories/computers
+https://www.online-store.com/categories/mobile-phones
+https://www.online-store.com/categories/black-friday
+```
+
+but it will not match
+
+```
+https://www.online-store.com/categories
+https://www.online-store.com/items/613804
+```
+
+This way, you can easily find just the URLs that you're looking for while ignoring the rest.
+
+A pseudo-URL may include any number of bracketed regular expressions, so you can compose much more complex matching logic. The following Pseudo URL
+will match the items in the store even if the links use the non-secure `http` protocol, omit the `www` from the hostname or use different TLD.
+
+```
+http[s?]://[(www)?\.]online-store.[com|net|org]/items/[\d+]
+```
+
+will match any combination of:
+
+```
+http://www.online-store.org/items/12345
+https://online-store.com/items/633423
+http://online-store.net/items/7003
+```
+
+but it will not match:
+
+```
+http://shop.online-store.org/items/12345
+https://www.online-store.com/items/calculator
+www.online-store.org/items/7003
+```
+
+> Pssst! Don't tell anyone, but you can create `PseudoUrls` with plain old `RegExp` instances instead of this brackety madness as well.
+
+#### Using `enqueueLinks()` to filter links
+
+That's been quite a lot of theory and examples. We might as well put it to practice. Going back to our `CheerioCrawler` exercise, we still have number
+2 left to cross off the list - filter links pointing to `apify.com`. We've already shown that at the very least, the `enqueueLinks()` function needs
+two arguments. The source, in our case the `$` object, and the destination - the `requestQueue`. To filter links, we need to add a third argument:
+`pseudoUrls`.
+
+The `options.pseudoUrls` argument is always an `Array`, but its contents can take on many forms. [See the reference](../api/utils#enqueueLinks)
+for all of them. Since we just need to filter out same domain links, we'll keep it simple and use a pseudo-URL `string`.
+
+```js
+// Assuming previous existence of the '$' and 'requestQueue' variables.
+const options = {
+ $,
+ requestQueue,
+ pseudoUrls: ['http[s?]://apify.com[.*]'],
+};
+
+await enqueueLinks(options);
+```
+
+> To break the pseudo-URL string down, we're looking for both `http` and `https` protocols and the links may only lead to `apify.com` domain. The
+> final brackets `[.*]` allow everything, so `apify.com/contact` as well as `apify.com/store` will match. If this is complex to you, we suggest
+> [reading a tutorial](https://www.regular-expressions.info/tutorial.html) or two on regular expression syntax.
+
+#### Resolving relative URLs with `enqueueLinks()`
+
+**TLDR;** Just use `baseUrl: request.loadedUrl` when working with `CheerioCrawler`.
+
+This is probably the weirdest and most complicated addition to the list. This is not the place to talk at length about
+[absolute and relative paths](https://stackoverflow.com/questions/2005079/absolute-vs-relative-urls), but in short, the
+links we encounter in a page can either be absolute, such as:
+
+```
+https://apify.com/john-doe/my-actor
+```
+
+or relative:
+
+```
+./john-doe/my-actor
+```
+
+Browsers handle this automatically, but since we're only using plain HTTP requests, we need to tell the `enqueueLinks()` function how to resolve the
+relative links to the absolute ones, so we can use them for scraping. This is where the `request.loadedUrl` comes into play, because it returns the
+correct URL to use as `baseUrl`.
+
+```js
+// Assuming previous existence of the '$', 'requestQueue' and 'request' variables.
+const options = {
+ $,
+ requestQueue,
+ pseudoUrls: ['http[s?]://apify.com[.*]'],
+ baseUrl: request.loadedUrl,
+};
+
+await enqueueLinks(options);
+```
+
+> Even though it seems possible, we can't use the `request.url` of our `Request` instances, because the page could have been redirected and the final
+> URL would be different from the one we requested.
+
+#### Integrating `enqueueLinks()` into our crawler
+
+That was fairly easy, wasn't it. That ticks the number 2 off our list and we're done! Let's take a look at the original crawler code, where we
+enqueued all the links manually.
+
+```js
+const { URL } = require('url'); // <------ This is new.
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://apify.com' });
+
+ const handlePageFunction = async ({ request, $ }) => {
+ const title = $('title').text();
+ console.log(`The title of "${request.url}" is: ${title}.`);
+
+ // Here starts the new part of handlePageFunction.
+ const links = $('a[href]')
+ .map((i, el) => $(el).attr('href'))
+ .get();
+
+ const ourDomain = 'https://apify.com';
+ const absoluteUrls = links.map(link => new URL(link, ourDomain));
+
+ const sameDomainLinks = absoluteUrls.filter(url => url.href.startsWith(ourDomain));
+
+ console.log(`Enqueueing ${sameDomainLinks.length} URLs.`);
+ for (const url of sameDomainLinks) {
+ await requestQueue.addRequest({ url: url.href });
+ }
+ };
+
+ const crawler = new Apify.CheerioCrawler({
+ maxRequestsPerCrawl: 20, // <------ This is new too.
+ requestQueue,
+ handlePageFunction,
+ });
+
+ await crawler.run();
+});
+```
+
+Since we've already prepared the `enqueueLinks()` options, we can just replace all the above enqueuing logic with a single function call, as promised.
+
+```js
+const Apify = require('apify');
+const {
+ utils: { enqueueLinks },
+} = Apify;
+
+Apify.main(async () => {
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://apify.com' });
+
+ const handlePageFunction = async ({ request, $ }) => {
+ const title = $('title').text();
+ console.log(`The title of "${request.url}" is: ${title}.`);
+
+ // Enqueue links
+ const enqueued = await enqueueLinks({
+ $,
+ requestQueue,
+ pseudoUrls: ['http[s?]://apify.com[.*]'],
+ baseUrl: request.loadedUrl,
+ });
+ console.log(`Enqueued ${enqueued.length} URLs.`);
+ };
+
+ const crawler = new Apify.CheerioCrawler({
+ maxRequestsPerCrawl: 20,
+ requestQueue,
+ handlePageFunction,
+ });
+
+ await crawler.run();
+});
+```
+
+And that's it! No more parsing the links from HTML using Cheerio, filtering them and enqueueing them one by one It all gets done automatically!
+`enqueueLinks()` is just one example of Apify SDK's powerful helper functions. They're all designed to make your life easier so you can focus on
+getting your data, while leaving the mundane crawling management to your tools.
+
+`Apify.utils.enqueueLinks()` has a lot more tricks up its sleeve. Make sure to check out the
+[reference documentation](../api/utils#enqueueLinks) to see what else it can do for you. Namely the feature to prepopulate the `Request`
+instances it creates with `userData` of your choice is extremely useful!
+
+## Getting some real world data
+
+> Hey, guys, you know, it's cool that we can scrape the `<title>` elements of web pages, but that's not very useful. Can we finally scrape some real
+> data and save it somewhere in a machine readable format? Because that's why started reading this tutorial in the first place!
+
+We hear you young padawan! First, learn how to crawl, you must. Only then, walk through data, you can!
+
+### Making a store crawler
+
+Fortunately, we don't have to travel to a galaxy far far away to find a good candidate for learning how to scrape
+structured data. The [Apify Store](https://apify.com/store) is a store of public actors that anyone can grab and use. You
+can find ready-made solutions for crawling [Google Places](https://apify.com/drobnikj/crawler-google-places),
+[Amazon](https://apify.com/vaclavrut/amazon-crawler),
+[Google Search](https://apify.com/apify/google-search-scraper),
+[Booking](https://apify.com/dtrungtin/booking-scraper),
+[Instagram](https://apify.com/jaroslavhejlek/instagram-scraper),
+[Tripadvisor](https://apify.com/maxcopell/tripadvisor) and many other websites. Feel free to check them out! It
+also poses a great place to practice our jedi scraping skills since it has categories, lists and details. That's almost like our imaginary
+`online-store.com` from the previous chapter.
+
+### The importance of having a plan
+
+Sometimes scraping is really straightforward, but most of the times, it really pays out to do a little bit of research first. How is the website
+structured? Can I scrape it only with HTTP requests (read "with `CheerioCrawler`") or would I need a full browser solution? Are there any
+anti-scraping protections in place? Do I need to parse the HTML or can I get the data otherwise, such as directly from the website's API. Jakub,
+one of Apify's founders wrote a
+[great article about all the different techniques](https://blog.apify.com/web-scraping-in-2018-forget-html-use-xhrs-metadata-or-javascript-variables-8167f252439c)
+and tips and tricks so make sure to check that out!
+
+For the purposes of this tutorial, let's just go ahead with HTTP requests and HTML parsing using `CheerioCrawler`. The number one reason being: We
+already know how to use it and we want to build on that knowledge to learn specific crawling and scraping techniques.
+
+#### Choosing the data we need
+
+A good first step is always to figure out what it is we want to scrape and where to find it. For the time being, let's just agree that we want to
+scrape all actors (see the `Show` dropdown) in all categories (which can be found on the left side of the page) and for each actor we want to get its
+
+1. URL
+2. Owner
+3. Unique identifier (such as `apify/web-scraper`)
+4. Title
+5. Description
+6. Last run date
+7. Number of runs
+
+We can see that some of the information is available directly on the list page, but for details such as "Last run date" or "Number of runs" we'll need
+to open the actor detail pages too.
+
+![data to scrape](/img/getting-started/scraping-practice.jpg 'Overview of data to be scraped.')
+
+#### Analyzing the target
+
+Knowing that we will use plain HTTP requests, we immediately know that we won't be able to manipulate the website in any way. We will only be able to
+go through the HTML it gives us and parse our data from there. This might sound like a huge limitation, but you might be surprised in how effective it
+might be. Let's get on it!
+
+#### The start URL(s)
+
+This is where we start our crawl. It's convenient to start as close to our data as possible. For example, it wouldn't make much sense to start at
+`apify.com` and look for a `store` link there, when we already know that everything we want to extract can be found at the `apify.com/store` page.
+
+Once we look at the `apify.com/store` page more carefully though, we see that the categories themselves produce URLs that we can use to access those
+individual categories.
+
+```
+https://apify.com/store?category=ENTERTAINMENT
+```
+
+Should we write down all the category URLs down and use all of them as start URLs? It's definitely possible, but what if a new category appears on the
+page later? We would not learn about it unless we manually visit the page and inspect it again. So scraping the category links off the store page
+definitely makes sense. This way we always get an up to date list of categories.
+
+But is it really that straightforward? By digging further into the store page's HTML we find that it does not actually contain the category links. The
+menu on the left uses JavaScript to display the items from a given category and, as we've learned earlier, `CheerioCrawler` cannot execute JavaScript.
+
+> We've deliberately chosen this scenario to show an example of the number one weakness of `CheerioCrawler`. We will overcome this difficulty in our
+> `PuppeteerCrawler` tutorial, but at the cost of compute resources and speed. Always remember that no tool is best for everything!
+
+So we're back to the pre-selected list of URLs. Since we cannot scrape the list dynamically, we have to manually collect the links and then use them
+in our crawler. We lose the ability to scrape new categories, but we keep the low resource consumption and speed advantages of `CheerioCrawler`.
+
+Therefore, after careful consideration, we've determined that we should use multiple start URLs and that they should look as follows:
+
+```
+https://apify.com/store?category=TRAVEL
+https://apify.com/store?category=ECOMMERCE
+https://apify.com/store?category=ENTERTAINMENT
+```
+
+### The crawling strategy
+
+Now that we know where to start, we need to figure out where to go next. Since we've eliminated one level of crawling by selecting the categories
+manually, we only need to crawl the actor detail pages now. The algorithm therefore follows:
+
+1. Visit the category list page (one of our start URLs).
+2. Enqueue all links to actor details.
+3. Visit all actor details and extract data.
+4. Repeat 1 - 3 for all categories.
+
+> Technically, this is a depth first crawl and the crawler will perform a breadth first crawl by default, but that's an implementation detail. We've
+> chosen this notation since a breadth first crawl would be less readable.
+
+`CheerioCrawler` will make sure to visit the pages for us, if we provide the correct `Requests` and we already know how to enqueue pages, so this
+should be fairly easy. Nevertheless, there are two more tricks that we'd like to show you.
+
+#### Using a `RequestList`
+
+`RequestList` is a perfect tool for scraping a pre-existing list of URLs and if you think about our start URLs, this is exactly what we have! A list
+of links to the different categories of the store. Let's see how we'd get them into a `RequestList`.
+
+```js
+const sources = [
+ 'https://apify.com/store?category=TRAVEL',
+ 'https://apify.com/store?category=ECOMMERCE',
+ 'https://apify.com/store?category=ENTERTAINMENT',
+];
+
+const requestList = await Apify.openRequestList('categories', sources);
+```
+
+As you can see, similarly to the `Apify.openRequestQueue()` function, there is an `Apify.openRequestList()` function that will create a `RequestList`
+instance for you. The first argument is a name of the `RequestList`. It is used to persist the crawling state of the list. This is useful when you
+want to continue where you left off after an error or a process restart. The second argument is the `sources` array, which is nothing more than a list
+of URLs you wish to crawl.
+
+> `RequestQueue` is a persistent store by default, so no name is needed, while the `RequestList` only lives in memory and giving it a name enables it
+> to become persistent.
+
+You might now want to ask one of the below questions:
+
+- Can I enqueue into `RequestList` too?
+- How do I make `RequestList` work together with `RequestQueue` since I need the queue to enqueue new `Requests`.
+
+The answer to the first one is a definitive no. `RequestList` is immutable and once you create it, you cannot add or remove `Requests` from it. The
+answer to the second one is simple. `RequestList` and `RequestQueue` are made to work together out of the box in crawlers, so all you need to do is
+use them both and the crawlers will do the rest.
+
+```js
+const crawler = new Apify.CheerioCrawler({
+ requestList,
+ requestQueue,
+ handlePageFunction,
+});
+```
+
+> For those wondering how this works, the `RequestList` `Requests` are enqueued into the `RequestQueue` right before their execution and only
+> processed by the `RequestQueue` afterwards. You can, of course, enqueue the `Requests` to the queue manually, but that would take some boilerplate
+> code and perhaps quite a long time, if we were talking about tens of thousands or more `Requests`. The crawlers do it while running, so the time to
+> enqueue is spread out and you won't even notice it.
+
+#### Sanity check
+
+It's always useful to create some simple boilerplate code to see that we've got everything set up correctly before we start to write
+the scraping logic itself. We might realize that something in our previous analysis doesn't quite add up, or the website might not behave exactly the
+same as we expected.
+
+Let's use the newly acquired `RequestList` knowledge and everything we know from the previous chapters to create a new crawler that'll just visit all
+the category URLs we selected and print the text content of all the actors in the category. Try running the code below in your selected environment.
+You should see, albeit very badly formatted, the text of the individual actor cards that are displayed in the selected categories.
+
+```js
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const sources = [
+ 'https://apify.com/store?category=TRAVEL',
+ 'https://apify.com/store?category=ECOMMERCE',
+ 'https://apify.com/store?category=ENTERTAINMENT',
+ ];
+
+ const requestList = await Apify.openRequestList('categories', sources);
+
+ const crawler = new Apify.CheerioCrawler({
+ requestList,
+ handlePageFunction: async ({ $, request }) => {
+ // Select all the actor cards.
+ $('.item').each((i, el) => {
+ const text = $(el).text();
+ console.log(`ITEM: ${text}\n`);
+ });
+ },
+ });
+
+ await crawler.run();
+});
+```
+
+> If there's anything you don't understand, refer to the previous chapters on setting up your environment, building your first crawler and
+> `CheerioCrawler`.
+
+You might be wondering how we got that `.item` selector. After analyzing the category pages using a browser's DevTools, we've determined that it's a
+good selector to select all the currently displayed actor cards. DevTools and CSS selectors are quite a large topic, so we can't go into too much
+detail here, but here are a few general pointers.
+
+#### DevTools crash course
+
+> We'll use Chrome DevTools here, since it's the most common browser, but feel free to use any other, it's all very similar.
+
+We could pick any category, but let's just go with Travel because it includes some interesting actors. Go to
+
+```
+https://apify.com/store?category=TRAVEL
+```
+
+and open DevTools either by right clicking anywhere in the page and selecting `Inspect`, or by pressing `F12` or by any other means relevant to your
+system. Once you're there, you'll see a bunch of DevToolsy stuff and a view of the category page with the individual actor cards.
+
+Now, find the `Select an element` tool and use it to select one of the actor cards. Make sure to select the whole card, not some of its contents, such
+as its title or description.
+
+In the resulting HTML display, it will put your cursor somewhere. Inspect the HTML around it. You'll see that there are CSS classes attached to the
+different HTML elements.
+
+By hovering over the individual elements, you will see their placement in the page's view. It's easy to see the page's structure around the actor
+cards now. All the cards are displayed in a `<div>` with a classname that starts with `ItemsGrid__StyledDiv`, which holds another `<div>` with some
+computer generated class names and finally, inside this `<div>`, the individual cards are represented by other `<div>` elements with the class of
+`item`.
+
+> Yes, there are other HTML elements and other classes too. We can safely ignore them.
+
+It should now make sense how we got that `.item` selector. It's just a selector that finds all elements that are annotated with the `item` class and
+those just happen to be the actor cards only.
+
+It's always a good idea to double check that though, so go into the DevTools Console and run
+
+```js
+document.querySelectorAll('.item');
+```
+
+You will see that only the actor cards will be returned, and nothing else.
+
+#### Enqueueing the detail links using a custom selector
+
+In the previous chapter, we've used the `Apify.utils.enqueueLinks()` function like this:
+
+```js
+await enqueueLinks({
+ $,
+ requestQueue,
+ pseudoUrls: ['http[s?]://apify.com[.*]'],
+ baseUrl: request.loadedUrl,
+});
+```
+
+While very useful in that scenario, we need something different now. Instead of finding all the `<a href="..">` links that match the `pseudoUrl`, we
+need to find only the specific ones that will take us to the actor detail pages. Otherwise, we'd be visiting a lot of other pages that we're not
+interested in. Using the power of DevTools and yet another `enqueueLinks()` parameter, this becomes fairly easy.
+
+```js
+const handlePageFunction = async ({ $, request }) => {
+ console.log(`Processing ${request.url}`);
+
+ // Only enqueue new links from the category pages.
+ if (!request.userData.detailPage) {
+ await Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ selector: 'div.item > a',
+ baseUrl: request.loadedUrl,
+ transformRequestFunction: req => {
+ req.userData.detailPage = true;
+ return req;
+ },
+ });
+ }
+};
+```
+
+The code should look pretty familiar to you. It's a very simple `handlePageFunction` where we log the currently processed URL to the console and
+enqueue more links. But there are also a few new, interesting additions. Let's break it down.
+
+##### The `selector` parameter of `enqueueLinks()`
+
+When we previously used `enqueueLinks()`, we were not providing any `selector` parameter and it was fine, because we wanted to use the default
+setting, which is `a` - finds all `<a>` elements. But now, we need to be more specific. There are multiple `<a>` links on the given category page, but
+we're only interested in those that will take us to item (actor) details. Using the DevTools, we found out that we can select the links we wanted
+using the `div.item > a` selector, which selects all the `<a>` elements that have a `<div class="item ...">` parent. And those are exactly the ones
+we're interested in.
+
+##### The missing `pseudoUrls`
+
+Earlier we've learned that `pseudoUrls` are not required and if omitted, all links matching the given `selector` will be enqueued. This is exactly
+what we need, so we're skipping `pseudoUrls` this time. That does not mean that you can't use `pseudoUrls` together with a custom `selector` though,
+because you absolutely can!
+
+##### Finally, the `userData` of `enqueueLinks()`
+
+You will see `userData` used often throughout Apify SDK and it's nothing more than a place to store your own data on a `Request` instance. You can
+access it by `request.userData` and it's a plain `Object` that can be used to store anything that needs to survive the full life-cycle of the
+`Request`.
+
+We can use the `transformRequestFunction` option of `enqueueLinks()` to modify all the `Request` instances it creates and enqueues. In our case, we
+use it to set a `detailPage` property to the enqueued `Requests` to be able to easily differentiate between the category pages and the detail pages.
+
+#### Another sanity check
+
+It's always good to work step by step. We have this new enqueueing logic in place and since the previous [Sanity check](#sanity-check) worked only
+with a `RequestList`, because we were not enqueueing anything so don't forget to add back the `RequestQueue` and `maxRequestsPerCrawl` limit. Let's
+test it out!
+
+```js
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const sources = [
+ 'https://apify.com/store?category=TRAVEL',
+ 'https://apify.com/store?category=ECOMMERCE',
+ 'https://apify.com/store?category=ENTERTAINMENT',
+ ];
+
+ const requestList = await Apify.openRequestList('categories', sources);
+ const requestQueue = await Apify.openRequestQueue(); // <----------------
+
+ const crawler = new Apify.CheerioCrawler({
+ maxRequestsPerCrawl: 50, // <----------------------------------------
+ requestList,
+ requestQueue, // <---------------------------------------------------
+ handlePageFunction: async ({ $, request }) => {
+ console.log(`Processing ${request.url}`);
+
+ // Only enqueue new links from the category pages.
+ if (!request.userData.detailPage) {
+ await Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ selector: 'div.item > a',
+ baseUrl: request.loadedUrl,
+ transformRequestFunction: req => {
+ req.userData.detailPage = true;
+ return req;
+ },
+ });
+ }
+ },
+ });
+
+ await crawler.run();
+});
+```
+
+We've added the `handlePageFunction()` with the `enqueueLinks()` logic from the previous section to the code we've written earlier. As always, try
+running it in an environment of your choice. You should see the crawler output a number of links to the console, as it crawls the category pages first
+and then all the links to the actor detail pages it found.
+
+This concludes our Crawling strategy section, because we have taught the crawler to visit all the pages we need. Let's continue with scraping the
+tasty data.
+
+### Scraping data
+
+At the beginning of this chapter, we've created a list of information we wanted to collect about the actors in the store. Let's review that and figure
+out ways to access it.
+
+1. URL
+2. Owner
+3. Unique identifier (such as `apify/web-scraper`)
+4. Title
+5. Description
+6. Last run date
+7. Number of runs
+
+![data to scrape](/img/getting-started/scraping-practice.jpg 'Overview of data to be scraped.')
+
+#### Scraping the URL, Owner and Unique identifier
+
+Some information is lying right there in front of us without even having to touch the actor detail pages. The `URL` we already have - the
+`request.url`. And by looking at it carefully, we realize that it already includes the `owner` and the `unique identifier` too. We can just split the
+`string` and be on our way then!
+
+```js
+// request.url = https://apify.com/apify/web-scraper
+
+const urlArr = request.url.split('/').slice(-2); // ['apify', 'web-scraper']
+const uniqueIdentifier = urlArr.join('/'); // 'apify/web-scraper'
+const owner = urlArr[0]; // 'apify'
+```
+
+> It's always a matter of preference, whether to store this information separately in the resulting dataset, or not. Whoever uses the dataset can
+> easily parse the `owner` from the `URL`, so should we duplicate the data unnecessarily? Our opinion is that unless the increased data consumption
+> would be too large to bear, it's always better to make the dataset as readable as possible. Someone might want to filter by `owner` for example and
+> keeping only the `URL` in the dataset would make this complicated without using additional tools.
+
+#### Scraping Title, Description, Last run date and Number of runs
+
+Now it's time to add more data to the results. Let's open one of the actor detail pages in the Store, for example the
+[`apify/web-scraper`](https://apify.com/apify/web-scraper) page and use our DevTools-Fu to figure out how to get the title of the actor.
+
+##### Title
+
+![actor title](/img/getting-started/title-01.jpg 'Finding actor title in DevTools.')
+
+By using the element selector tool, we find out that the title is there under an `<h1>` tag, as titles should be.
+Maybe surprisingly, we find that there are actually two `<h1>` tags on the detail page. This should get us thinking.
+Is there any parent element that includes our `<h1>` tag, but not the other ones? Yes, there is! There is a `<header>`
+element that we can use to select only the heading we're interested in.
+
+> Remember that you can press CTRL+F (CMD+F) in the Elements tab of DevTools to open the search bar where you can quickly search for elements using
+> their selectors. And always make sure to use the DevTools to verify your scraping process and assumptions. It's faster than changing the crawler
+> code all the time.
+
+To get the title we just need to find it using `Cheerio` and a `header h1` selector, which selects all `<h1>` elements that have a `<header>` ancestor.
+And as we already know, there's only one.
+
+```js
+return {
+ title: $('header h1').text(),
+};
+```
+
+##### Description
+
+Getting the actor's description is a little more involved, but still pretty straightforward. We can't just simply search for a `<p>` tag, because
+there's a lot of them in the page. We need to narrow our search down a little. Using the DevTools we find that the actor description is nested within
+the `<header>` element too, same as the title. Sadly, we're still left with two `<p>` tags. To finally select only the
+description, we choose the `<p>` tag that has a `class` that starts with `Text__Paragraph`.
+
+![actor description selector](/img/getting-started/description.jpg 'Finding actor description in DevTools.')
+
+```js
+return {
+ title: $('header h1').text(),
+ description: $('header p[class^=Text__Paragraph]').text(),
+};
+```
+
+##### Last run date
+
+The DevTools tell us that the `lastRunDate` can be found in the second of the two `<time>` elements in the page.
+
+![actor last run date selector](/img/getting-started/last-run-date.jpg 'Finding actor last run date in DevTools.')
+
+```js
+return {
+ title: $('header h1').text(),
+ description: $('header p[class^=Text__Paragraph]').text(),
+ lastRunDate: new Date(
+ Number(
+ $('time')
+ .eq(1)
+ .attr('datetime'),
+ ),
+ ),
+};
+```
+
+It might look a little too complex at first glance, but let me walk you through it. We find all the `<time>` elements. There are two, so we grab the
+second one using the `.eq(1)` call (it's zero indexed) and then we read its `datetime` attribute, because that's where a unix timestamp is stored as a
+`string`.
+
+But we would much rather see a readable date in our results, not a unix timestamp, so we need to convert it. Unfortunately the `new Date()`
+constructor will not accept a `string`, so we cast the `string` to a `number` using the `Number()` function before actually calling `new Date()`.
+Phew!
+
+##### Run count
+
+And so we're finishing up with the `runCount`. There's no specific element like `<time>`, so we need to create a complex selector and then do a
+transformation on the result.
+
+```js
+return {
+ title: $('header h1').text(),
+ description: $('header p[class^=Text__Paragraph]').text(),
+ lastRunDate: new Date(
+ Number(
+ $('time')
+ .eq(1)
+ .attr('datetime'),
+ ),
+ ),
+ runCount: Number(
+ $('ul.stats li:nth-of-type(3)')
+ .text()
+ .match(/\d+/)[0],
+ ),
+};
+```
+
+The `ul.stats > li:nth-of-type(3)` looks complicated, but it only reads that we're looking for a `<ul class="stats ...">` element and within that
+element we're looking for the third `<li>` element. We grab its text, but we're only interested in the number of runs. So we parse the number out
+using a regular expression, but its type is still a `string`, so we finally convert the result to a `number` by wrapping it with a `Number()` call.
+
+And there we have it! All the data we needed in a single object. For the sake of completeness, let's add the properties we parsed from the URL earlier
+and we're good to go.
+
+```js
+const urlArr = request.url.split('/').slice(-2);
+
+const results = {
+ url: request.url,
+ uniqueIdentifier: urlArr.join('/'),
+ owner: urlArr[0],
+ title: $('header h1').text(),
+ description: $('header p[class^=Text__Paragraph]').text(),
+ lastRunDate: new Date(
+ Number(
+ $('time')
+ .eq(1)
+ .attr('datetime'),
+ ),
+ ),
+ runCount: Number(
+ $('ul.stats li:nth-of-type(3)')
+ .text()
+ .match(/\d+/)[0],
+ ),
+};
+
+console.log('RESULTS: ', results);
+```
+
+#### Trying it out (sanity check #3)
+
+We have everything we need so just grab our newly created scraping logic, dump it into our original `handlePageFunction()` and see the magic!
+
+```js
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const sources = [
+ 'https://apify.com/store?category=TRAVEL',
+ 'https://apify.com/store?category=ECOMMERCE',
+ 'https://apify.com/store?category=ENTERTAINMENT',
+ ];
+
+ const requestList = await Apify.openRequestList('categories', sources);
+ const requestQueue = await Apify.openRequestQueue();
+
+ const crawler = new Apify.CheerioCrawler({
+ maxRequestsPerCrawl: 50,
+ requestList,
+ requestQueue,
+ handlePageFunction: async ({ $, request }) => {
+ console.log(`Processing ${request.url}`);
+
+ // This is our new scraping logic.
+ if (request.userData.detailPage) {
+ const urlArr = request.url.split('/').slice(-2);
+
+ const results = {
+ url: request.url,
+ uniqueIdentifier: urlArr.join('/'),
+ owner: urlArr[0],
+ title: $('header h1').text(),
+ description: $('header p[class^=Text__Paragraph]').text(),
+ lastRunDate: new Date(
+ Number(
+ $('time')
+ .eq(1)
+ .attr('datetime'),
+ ),
+ ),
+ runCount: Number(
+ $('ul.stats li:nth-of-type(3)')
+ .text()
+ .match(/\d+/)[0],
+ ),
+ };
+ console.log('RESULTS', results);
+ }
+
+ // Only enqueue new links from the category pages.
+ if (!request.userData.detailPage) {
+ await Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ selector: 'div.item > a',
+ baseUrl: request.loadedUrl,
+ transformRequestFunction: req => {
+ req.userData.detailPage = true;
+ return req;
+ },
+ });
+ }
+ },
+ });
+
+ await crawler.run();
+});
+```
+
+> Notice again that we're scraping on the detail pages `request.userData.detailPage === true`, but we're only enqueueing on the category pages
+> `request.userData.detailPage === undefined`.
+
+When running the actor in an environment of your choice, you should see the crawled URLs and their scraped data printed to the console.
+
+### Saving the scraped data
+
+A data extraction job would not be complete without saving the data for later use and processing. We've come to the final and most difficult part of
+this chapter so make sure to pay attention very carefully!
+
+First, replace the `console.log('RESULTS', results)` call with
+
+```js
+await Apify.pushData(results);
+```
+
+and that's it. Unlike in the previous paragraph, I'm serious now. That's it, we're done. The final code therefore looks exactly like this:
+
+```js
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const sources = [
+ 'https://apify.com/store?category=TRAVEL',
+ 'https://apify.com/store?category=ECOMMERCE',
+ 'https://apify.com/store?category=ENTERTAINMENT',
+ ];
+
+ const requestList = await Apify.openRequestList('categories', sources);
+ const requestQueue = await Apify.openRequestQueue();
+
+ const crawler = new Apify.CheerioCrawler({
+ maxRequestsPerCrawl: 50,
+ requestList,
+ requestQueue,
+ handlePageFunction: async ({ $, request }) => {
+ console.log(`Processing ${request.url}`);
+
+ // This is our new scraping logic.
+ if (request.userData.detailPage) {
+ const urlArr = request.url.split('/').slice(-2);
+
+ const results = {
+ url: request.url,
+ uniqueIdentifier: urlArr.join('/'),
+ owner: urlArr[0],
+ title: $('header h1').text(),
+ description: $('header p[class^=Text__Paragraph]').text(),
+ lastRunDate: new Date(
+ Number(
+ $('time')
+ .eq(1)
+ .attr('datetime'),
+ ),
+ ),
+ runCount: Number(
+ $('ul.stats li:nth-of-type(3)')
+ .text()
+ .match(/\d+/)[0],
+ ),
+ };
+ await Apify.pushData(results);
+ }
+
+ // Only enqueue new links from the category pages.
+ if (!request.userData.detailPage) {
+ await Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ selector: 'div.item > a',
+ baseUrl: request.loadedUrl,
+ transformRequestFunction: req => {
+ req.userData.detailPage = true;
+ return req;
+ },
+ });
+ }
+ },
+ });
+
+ await crawler.run();
+});
+```
+
+#### What's `Apify.pushData()`
+
+[`Apify.pushData()`](../api/apify#pushdata) is a helper function that saves data to the default [`Dataset`](../api/dataset). `Dataset` is a
+storage designed to hold virtually unlimited amount of data in a format similar to a table. Each time you call `Apify.pushData()` a new row in the
+table is created, with the property names serving as column titles.
+
+> Each actor run has one default `Dataset` so no need to initialize it or create an instance first. It just gets done automatically for you. You can
+> also create named datasets at will.
+
+#### Finding my saved data
+
+It might not be perfectly obvious where the data we saved using the previous command went, so let's break it down by environment:
+
+##### Dataset on the Apify Platform
+
+Open any Run of your actor on the Platform and you will see a Dataset as one of the available tabs. Clicking on it will reveal basic information about
+the Dataset and a list of options that you can use to download your data. There are various formats such as JSON, XLSX or CSV available and there's
+also the possibility of downloading only Clean items, i.e. a filtered dataset with empty rows and hidden fields removed.
+
+##### Local Dataset
+
+Unless you changed the environment variables that Apify SDK uses locally, which would suggest that you knew what you were doing and you didn't need
+this tutorial anyway, you'll find your data in your local Apify Storage.
+
+```
+{PROJECT_FOLDER}/apify_storage/datasets/default/
+```
+
+The above folder will hold all your saved data in numbered files, as they were pushed into the dataset. Each file represents one invocation of
+`Apify.pushData()` or one table row.
+
+> Unfortunately, the local datasets don't yet support the export in various formats functionality that the Platform Dataset page offers, so for the
+> time being, we're stuck with JSON.
+
+### Final touch
+
+It may seem that the data are extracted and the actor is done, but honestly, this is just the beginning. For the sake of brevity, we've completely
+omitted error handling, proxies, debug logging, tests, documentation and other stuff that a reliable software should have. The good thing is, **error
+handling is mostly done by Apify SDK itself**, so no worries on that front, unless you need some custom magic.
+
+Anyway, to spark some ideas, let's look at two more things. First, passing an input to the actor, which will enable us to change the categories we
+want to scrape without changing the source code itself! And then some refactoring, to show you how we reckon is preferable to structure and annotate
+actor code.
+
+#### Meet the `INPUT`
+
+`INPUT` is just a convention on how we call the actor's input. Because there's no magic in actors, just features, the `INPUT` is actually nothing more
+than a key in the default [`KeyValueStore`](../api/key-value-store) that's, by convention, used as input on Apify Platform. Also by convention, the
+`INPUT` is mostly expected to be of `Content-Type: application/json`.
+
+We will not go into `KeyValueStore` details here, but for the sake of `INPUT` you need to remember that there is a function that helps you get it.
+
+```js
+const input = await Apify.getInput();
+```
+
+On the Apify Platform, the actor's input that you can set in the Console is automatically saved to the default `KeyValueStore` under the key `INPUT`
+and by calling [`Apify.getInput()`](../api/apify#getvalue) you retrieve the value from the `KeyValueStore`.
+
+Running locally, you need to place an `INPUT.json` file in your default key value store for this to work.
+
+```
+{PROJECT_FOLDER}/apify_storage/key_value_stores/default/INPUT.json
+```
+
+#### Use `INPUT` to seed our actor with categories
+
+Currently we're using the full URLs of categories as sources, but it's quite obvious that we only need the final parameters, the rest of the URL is
+always the same. Knowing that, we can pass an array of those parameters on `INPUT` and build the URLs dynamically, which would allow us to scrape
+different categories without changing the source code. Let's get to it!
+
+First, we set up our `INPUT`, either in the `INPUT` form of the actor on Apify Platform, or by creating an `INPUT.json` in our default key value store
+locally.
+
+```json
+["TRAVEL", "ECOMMERCE", "ENTERTAINMENT"]
+```
+
+Once we have that, we can load it in the actor and populate the crawler's sources with it. In the following example, we're using the categories in the
+input to construct the category URLs and we're also passing custom `userData` to the sources. This means that the `Requests` that get created will
+automatically contain this `userData`.
+
+```js
+// ...
+const input = await Apify.getInput();
+
+const sources = input.map(category => ({
+ url: `https://apify.com/store?category=${category}`,
+ userData: {
+ label: 'CATEGORY',
+ },
+}));
+
+const requestList = await Apify.openRequestList('categories', sources);
+// ...
+```
+
+The `userData.label` is also a convention that we've been using for quite some time to label different `Requests`. We know that this is a category URL
+so we `label` it `CATEGORY`. This way, we can easily make decisions in the `handlePageFunction` without having to inspect the URL itself.
+
+We can then refactor the `if` clauses in the `handlePageFunction` to use the `label` for decision making. This does not make much sense for a crawler
+with only two different pages, because a simple `boolean` would suffice, but for pages with multiple different views, it becomes very useful.
+
+#### Structuring the code better
+
+But perhaps we should not stop at refactoring the `if` clauses. There are several ways we can make the actor look more elegant and - most
+importantly - easier to reason about and make changes to.
+
+In the following code we've made several changes.
+
+- Split the code into multiple files.
+- Added the `Apify.utils.log` and replaced `console.log` with it.
+- Added a `getSources()` function to encapsulate `INPUT` consumption.
+- Added a `createRouter()` function to make our routing cleaner, without nested `if` clauses.
+- Removed the `maxRequestsPerCrawl` limit.
+
+> To create a multi-file actor on the Apify Platform, select **Multiple source files** in the **Type** dropdown on the **Source** screen.
+
+In our `main.js` file, we place the general structure of the crawler:
+
+```js
+// main.js
+const Apify = require('apify');
+const tools = require('./tools');
+const {
+ utils: { log },
+} = Apify;
+
+Apify.main(async () => {
+ log.info('Starting actor.');
+ const requestList = await Apify.openRequestList('categories', await tools.getSources());
+ const requestQueue = await Apify.openRequestQueue();
+ const router = tools.createRouter({ requestQueue });
+
+ log.debug('Setting up crawler.');
+ const crawler = new Apify.CheerioCrawler({
+ requestList,
+ requestQueue,
+ handlePageFunction: async context => {
+ const { request } = context;
+ log.info(`Processing ${request.url}`);
+ await router(request.userData.label, context);
+ },
+ });
+
+ log.info('Starting the crawl.');
+ await crawler.run();
+ log.info('Actor finished.');
+});
+```
+
+Then in a separate `tools.js`, we add our helper functions:
+
+```js
+// tools.js
+const Apify = require('apify');
+const routes = require('./routes');
+const {
+ utils: { log },
+} = Apify;
+
+exports.getSources = async () => {
+ log.debug('Getting sources.');
+ const input = await Apify.getInput();
+ return input.map(category => ({
+ url: `https://apify.com/store?category=${category}`,
+ userData: {
+ label: 'CATEGORY',
+ },
+ }));
+};
+
+exports.createRouter = globalContext => {
+ return async function(routeName, requestContext) {
+ const route = routes[routeName];
+ if (!route) throw new Error(`No route for name: ${routeName}`);
+ log.debug(`Invoking route: ${routeName}`);
+ return route(requestContext, globalContext);
+ };
+};
+```
+
+And finally our routes in a separate `routes.js` file:
+
+```js
+// routes.js
+const Apify = require('apify');
+const {
+ utils: { log },
+} = Apify;
+
+exports.CATEGORY = async ({ $, request }, { requestQueue }) => {
+ return Apify.utils.enqueueLinks({
+ $,
+ requestQueue,
+ selector: 'div.item > a',
+ baseUrl: request.loadedUrl,
+ transformRequestFunction: req => {
+ req.userData.label = 'DETAIL';
+ return req;
+ },
+ });
+};
+
+exports.DETAIL = async ({ $, request }) => {
+ const urlArr = request.url.split('/').slice(-2);
+
+ log.debug('Scraping results.');
+ const results = {
+ url: request.url,
+ uniqueIdentifier: urlArr.join('/'),
+ owner: urlArr[0],
+ title: $('header h1').text(),
+ description: $('header p[class^=Text__Paragraph]').text(),
+ lastRunDate: new Date(
+ Number(
+ $('time')
+ .eq(1)
+ .attr('datetime'),
+ ),
+ ),
+ runCount: Number(
+ $('ul.stats li:nth-of-type(3)')
+ .text()
+ .match(/\d+/)[0],
+ ),
+ };
+
+ log.debug('Pushing data to dataset.');
+ await Apify.pushData(results);
+};
+```
+
+Let us tell you a little bit more about the changes. We're hopeful that in the end, you'll agree that this structure makes the actor more readable and
+manageable.
+
+#### Splitting your code into multiple files
+
+It was not always the case, but now that Apify Platform has a multifile editor, there's no reason not to split your code into multiple files and keep
+your logic separate. Less code in a single file means less code you need to think about at any time, and that's a great thing!
+
+#### Using `Apify.utils.log` instead of `console.log`
+
+We wont go into great lengths here to talk about `utils.log` here, because you can read [it all in the documentation](../api/log), but there's just
+one thing that we need to stress: **log levels**.
+
+`utils.log` enables you to use different log levels, such as `log.debug`, `log.info` or `log.warning`. It not only makes your log more readable, but
+it also allows selective turning off of some levels by either calling the `utils.log.setLevel()` function or by setting an `APIFY_LOG_LEVEL` variable.
+This is huge! Because you can now add a lot of debug logs in your actor, which will help you when something goes wrong and turn them on or off with a
+simple `INPUT` change, or by setting an environment variable.
+
+The punch line? Use `Apify.utils.log` instead of `console.log` now and thank us later when something goes wrong!
+
+#### Using a router to structure your crawling
+
+At first, it might seem more readable using just a simple `if / else` statement to select different logic based on the crawled pages, but trust me, it
+becomes far less impressive when working with more than 2 different pages and it definitely starts to fall apart when the logic to handle each page
+spans tens or hundreds of lines of code.
+
+It's a good practice in any programming to split your logic into bite sized chunks that are easy to read and reason about. Scrolling through a
+thousand line long `handlePageFunction()` where everything interacts with everything and variables can be used everywhere is not a beautiful thing to
+do and a pain to debug. That's why we prefer the separation of routes into a special file and with large routes, we would even suggest having one file
+per route.
+
+> TO BE CONTINUED with details on `PuppeteerCrawler` and other features...
diff --git a/website/versioned_docs/version-0.22.4/guides/motivation.md b/website/versioned_docs/version-0.22.4/guides/motivation.md
new file mode 100644
index 000000000..adaada9d1
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/motivation.md
@@ -0,0 +1,22 @@
+---
+id: version-0.22.4-motivation
+title: Motivation
+original_id: motivation
+---
+
+Thanks to tools like [Puppeteer](https://github.com/puppeteer/puppeteer) or
+[Cheerio](https://www.npmjs.com/package/cheerio), it is easy to write Node.js code to extract data from web pages. But
+eventually things will get complicated. For example, when you try to:
+
+- Perform a deep crawl of an entire website using a persistent queue of URLs.
+- Run your scraping code on a list of 100k URLs in a CSV file, without losing any data when your code crashes.
+- Rotate proxies to hide your browser origin and keep user-like sessions.
+- Disable browser fingerprinting protections used by websites.
+
+Python has [Scrapy](https://scrapy.org/) for these tasks, but there was no such library for **JavaScript, the language of
+the web**. The use of JavaScript is natural, since the same language is used to write the scripts as well as the data extraction code running in a
+browser.
+
+The goal of the Apify SDK is to fill this gap and provide a toolbox for generic web scraping, crawling and automation tasks in JavaScript. So don't
+reinvent the wheel every time you need data from the web, and focus on writing code specific to the target website, rather than developing
+commonalities.
diff --git a/website/versioned_docs/version-0.22.4/guides/proxy_management.md b/website/versioned_docs/version-0.22.4/guides/proxy_management.md
new file mode 100644
index 000000000..bc238ae92
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/proxy_management.md
@@ -0,0 +1,150 @@
+---
+id: version-0.22.4-proxy-management
+title: Proxy Management
+original_id: proxy-management
+---
+
+[IP address blocking](https://en.wikipedia.org/wiki/IP_address_blocking) is one of the oldest
+and most effective ways of preventing access to a website. It is therefore paramount for
+a good web scraping library to provide easy to use but powerful tools which can work around
+IP blocking. The most powerful weapon in your anti IP blocking arsenal is a
+[proxy server](https://en.wikipedia.org/wiki/Proxy_server).
+
+With Apify SDK you can use your own proxy servers, proxy servers acquired from
+third-party providers, or you can rely on [Apify Proxy](https://apify.com/proxy)
+for your scraping needs.
+
+## Quick start
+If you already subscribed to Apify Proxy or have proxy URLs of your own, you can start using
+them immediately in only a few lines of code.
+
+> If you want to use Apify Proxy, make sure that your [scraper is logged in](../guides/apify-platform).
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- Apify Proxy -->
+
+```javascript
+const proxyConfiguration = await Apify.createProxyConfiguration();
+const proxyUrl = proxyConfiguration.newUrl();
+```
+
+<!-- Your own proxies -->
+```javascript
+const proxyConfiguration = await Apify.createProxyConfiguration({
+ proxyUrls: [
+ 'http://proxy-1.com',
+ 'http://proxy-2.com',
+ ]
+});
+const proxyUrl = proxyConfiguration.newUrl();
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
+
+## Proxy Configuration
+All your proxy needs are managed by the [`ProxyConfiguration`](../api/proxy-configuration) class.
+You create an instance using the [`Apify.createProxyConfiguration()`](../api/apify#createproxyconfiguration)
+function. See the [`ProxyConfigurationOptions`](../typedefs/proxy-configuration-options) for all
+the possible constructor options.
+
+### Crawler integration
+`ProxyConfiguration` integrates seamlessly into [`CheerioCrawler`](../api/cheerio-crawler)
+and [`PuppeteerCrawler`](../api/puppeteer-crawler).
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- CheerioCrawler -->
+
+```javascript
+const proxyConfiguration = await Apify.createProxyConfiguration({ /* your proxy opts */ });
+const crawler = new Apify.CheerioCrawler({
+ proxyConfiguration,
+ // ...
+});
+```
+
+<!-- PuppeteerCrawler -->
+```javascript
+const proxyConfiguration = await Apify.createProxyConfiguration({ /* your proxy opts */ });
+const crawler = new Apify.PuppeteerCrawler({
+ proxyConfiguration,
+ // ...
+});
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
+
+Your crawlers will now use the selected proxies for all connections.
+
+### IP Rotation and session management
+[`proxyConfiguration.newUrl()`](../api/proxy-configuration#newurl) allows you to pass
+a `sessionId` parameter. It will then be used to create a `sessionId`-`proxyUrl` pair,
+and subsequent `newUrl()` calls with the same `sessionId` will always return the same
+`proxyUrl`. This is extremely useful in scraping, because you want to create the impression
+of a real user. See the [session management guide](../guides/session-management) and
+[`SessionPool`](../api/session-pool) class for more information on how keeping
+a real session helps you avoid blocking.
+
+When no `sessionId` is provided, your proxy URLs are rotated round-robin, whereas
+Apify Proxy manages their rotation using black magic to get the best performance.
+
+<!--DOCUSAURUS_CODE_TABS-->
+
+<!-- Standalone -->
+
+```javascript
+const proxyConfiguration = await Apify.createProxyConfiguration({ /* opts */ });
+const sessionPool = await Apify.openSessionPool({ /* opts */ });
+const session = await sessionPool.getSession();
+const proxyUrl = proxyConfiguration.newUrl(session.id);
+```
+
+<!-- Crawlers -->
+```javascript
+const proxyConfiguration = await Apify.createProxyConfiguration({ /* opts */ });
+const crawler = new Apify.PuppeteerCrawler({
+ useSessionPool: true,
+ persistCookiesPerSession: true,
+ proxyConfiguration,
+ // ...
+});
+```
+
+<!--END_DOCUSAURUS_CODE_TABS-->
+
+## Apify Proxy vs. Your own proxies
+The `ProxyConfiguration` class covers both Apify Proxy and custom proxy URLs so that
+you can easily switch between proxy providers, however, some features of the class
+are available only to Apify Proxy users, mainly because Apify Proxy is what
+one would call a super-proxy. It's not a single proxy server, but an API endpoint
+that allows connection through millions of different IP addresses. So the class
+essentially has two modes: Apify Proxy or Your proxy.
+
+The difference is easy to remember.
+[`ProxyConfigurationOptions.proxyUrls`](../typedefs/proxy-configuration-options#proxyurls) and
+[`ProxyConfigurationOptions.newUrlFunction`](../typedefs/proxy-configuration-options#newurlfunction)
+enable use of your custom proxy URLs, whereas all the other options are there to configure Apify Proxy.
+Visit the [Apify Proxy docs](https://docs.apify.com/proxy) for more info on how these parameters work.
+
+## Apify Proxy Configuration
+With Apify Proxy, you can select specific proxy groups to use, or countries to connect from.
+This allows you to get better proxy performance after some initial research.
+
+```javascript
+const proxyConfiguration = await Apify.createProxyConfiguration({
+ groups: ['RESIDENTIAL'],
+ countryCode: 'US',
+});
+const proxyUrl = proxyConfiguration.newUrl();
+```
+
+Now your crawlers will use only Residential proxies from the US. Note that you must first get access
+to a proxy group before you are able to use it. You can find your available proxy groups
+in the [proxy dashboard](https://my.apify.com/proxy).
+
+## Inspecting current proxy in Crawlers
+`CheerioCrawler` and `PuppeteerCrawler` grant access to information about the currently used proxy
+in their `handlePageFunction` using a [`proxyInfo`](../typedefs/proxy-info) object.
+With the object, you can easily access the proxy URL. If you're using Apify Proxy, the other
+configuration parameters will also be available in the `proxyInfo` object.
diff --git a/website/versioned_docs/version-0.22.4/guides/quick_start.md b/website/versioned_docs/version-0.22.4/guides/quick_start.md
new file mode 100644
index 000000000..d66fd0faf
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/quick_start.md
@@ -0,0 +1,107 @@
+---
+id: version-0.22.4-quick-start
+title: Quick Start
+original_id: quick-start
+---
+
+This short tutorial will set you up to start using Apify SDK in a minute or two.
+If you want to learn more, proceed to the [Getting Started](../guides/getting-started)
+tutorial that will take you step by step through creating your first scraper.
+
+## Local stand-alone usage
+Apify SDK requires [Node.js](https://nodejs.org/en/) 10.17 or later, with the exception of Node.js 11.
+Add Apify SDK to any Node.js project by running:
+
+```bash
+npm install apify --save
+```
+
+Run the following example to perform a recursive crawl of a website using Puppeteer. For more examples showcasing various features of the Apify SDK,
+[see the Examples section of the documentation](../examples/basic-crawler).
+
+```javascript
+const Apify = require('apify');
+
+Apify.main(async () => {
+ const requestQueue = await Apify.openRequestQueue();
+ await requestQueue.addRequest({ url: 'https://www.iana.org/' });
+ const pseudoUrls = [new Apify.PseudoUrl('https://www.iana.org/[.*]')];
+
+ const crawler = new Apify.PuppeteerCrawler({
+ requestQueue,
+ handlePageFunction: async ({ request, page }) => {
+ const title = await page.title();
+ console.log(`Title of ${request.url}: ${title}`);
+ await Apify.utils.enqueueLinks({
+ page,
+ selector: 'a',
+ pseudoUrls,
+ requestQueue,
+ });
+ },
+ maxRequestsPerCrawl: 100,
+ maxConcurrency: 10,
+ });
+
+ await crawler.run();
+});
+```
+
+When you run the example, you should see Apify SDK automating a Chrome browser.
+
+![Chrome Scrape](/img/chrome_scrape.gif)
+
+By default, Apify SDK stores data to `./apify_storage` in the current working directory. You can override this behavior by setting either the
+`APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variable. For details, see [Environment variables](../guides/environment-variables) and
+[Data storage](../guides/data-storage).
+
+## Local usage with Apify command-line interface (CLI)
+
+To avoid the need to set the environment variables manually, to create a boilerplate of your project, and to enable pushing and running your code on
+the [Apify platform](../guides/apify-platform), you can use the [Apify command-line interface (CLI)](https://github.com/apify/apify-cli) tool.
+
+Install the CLI by running:
+
+```bash
+npm -g install apify-cli
+```
+
+You might need to run the above command with `sudo`, depending on how crazy your configuration is.
+
+Now create a boilerplate of your new web crawling project by running:
+
+```bash
+apify create my-hello-world
+```
+
+The CLI will prompt you to select a project boilerplate template - just pick "Hello world". The tool will create a directory called `my-hello-world`
+with a Node.js project files. You can run the project as follows:
+
+```bash
+cd my-hello-world
+apify run
+```
+
+By default, the crawling data will be stored in a local directory at `./apify_storage`. For example, the input JSON file for the actor is expected to
+be in the default key-value store in `./apify_storage/key_value_stores/default/INPUT.json`.
+
+Now you can easily deploy your code to the Apify platform by running:
+
+```bash
+apify login
+```
+
+```bash
+apify push
+```
+
+Your script will be uploaded to the Apify platform and built there so that it can be run. For more information, view the
+[Apify Actor](https://docs.apify.com/cli) documentation.
+
+## Usage on the Apify platform
+
+You can also develop your web scraping project in an online code editor directly on the [Apify platform](../guides/apify-platform).
+You'll need to have an Apify Account. Go to [Actors](https://my.apify.com/actors), page in the app, click <i>Create new</i>
+and then go to the <i>Source</i> tab and start writing your code or paste one of the examples from the Examples section.
+
+For more information, view the [Apify actors quick start guide](https://docs.apify.com/actor/quick-start).
diff --git a/website/versioned_docs/version-0.22.4/guides/session_management.md b/website/versioned_docs/version-0.22.4/guides/session_management.md
new file mode 100644
index 000000000..c7d5882ec
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/session_management.md
@@ -0,0 +1,169 @@
+---
+id: version-0.22.4-session-management
+title: Session Management
+original_id: session-management
+---
+[`SessionPool`](../api/session-pool) is a class that allows you to handle the rotation of proxy IP addresses along with cookies and other custom settings in Apify SDK.
+
+The main benefit of a Session pool is that you can filter out blocked or non-working proxies,
+so your actor does not retry requests over known blocked/non-working proxies.
+Another benefit of using SessionPool is that you can store information tied tightly to an IP address,
+such as cookies, auth tokens, and particular headers. Having your cookies and other identificators used only with a specific IP will reduce the chance of being blocked.
+Last but not least, another benefit is the even rotation of IP addresses - SessionPool picks the session randomly,
+which should prevent burning out a small pool of available IPs.
+
+Now let's take a look at how to use a Session pool.
+
+**Example usage in [`PuppeteerCrawler`](../api/puppeteer-crawler)**
+
+```javascript
+
+const proxyConfiguration = await Apify.createProxyConfiguration();
+
+const crawler = new Apify.PuppeteerCrawler({
+ requestQueue,
+ // To use the proxy IP session rotation logic, you must turn the proxy usage on.
+ proxyConfiguration,
+ // Activates the Session pool.
+ useSessionPool: true,
+ // Overrides default Session pool configuration
+ sessionPoolOptions: {
+ maxPoolSize: 100
+ },
+ // Set to true if you want the crawler to save cookies per session,
+ // and set the cookies to page before navigation automatically.
+ persistCookiesPerSession: true,
+ handlePageFunction: async ({ request, page, session }) => {
+ const title = await page.title();
+
+ if (title === "Blocked") {
+ session.retire()
+ } else if (title === "Not sure if blocked, might also be a connection error") {
+ session.markBad();
+ } else {
+ // session.markGood() - this step is done automatically in puppeteer pool.
+ }
+
+ }
+});
+```
+
+**Example usage in [`CheerioCrawler`](../api/cheerio-crawler)**
+
+```javascript
+ const proxyConfiguration = await Apify.createProxyConfiguration();
+
+ const crawler = new Apify.CheerioCrawler({
+ requestQueue,
+ // To use the proxy IP session rotation logic, you must turn the proxy usage on.
+ proxyConfiguration,
+ // Activates the Session pool.
+ useSessionPool: true,
+ // Overrides default Session pool configuration.
+ sessionPoolOptions: {
+ maxPoolSize: 100
+ },
+ // Set to true if you want the crawler to save cookies per session,
+ // and set the cookie header to request automatically...
+ persistCookiesPerSession: true,
+ handlePageFunction: async ({request, $, session}) => {
+ const title = $("title");
+
+ if (title === "Blocked") {
+ session.retire()
+ } else if (title === "Not sure if blocked, might also be a connection error") {
+ session.markBad();
+ } else {
+ // session.markGood() - this step is done automatically in BasicCrawler.
+ }
+
+ }
+ });
+```
+
+**Example usage in [`BasicCrawler`](../api/basic-crawler)**
+
+```javascript
+ const proxyConfiguration = await Apify.createProxyConfiguration();
+
+ const crawler = new Apify.BasicCrawler({
+ requestQueue,
+ // Allows access to proxyInfo object in handleRequestFunction
+ proxyConfiguration,
+ useSessionPool: true,
+ sessionPoolOptions: {
+ maxPoolSize: 100
+ },
+ handleRequestFunction: async ({request, session, proxyInfo }) => {
+ // To use the proxy IP session rotation logic, you must turn the proxy usage on.
+ const proxyUrl = proxyInfo.url;
+ const requestOptions = {
+ url: request.url,
+ proxyUrl,
+ throwHttpErrors: false,
+ headers: {
+ // If you want to use the cookieJar.
+ // This way you get the Cookie headers string from session.
+ Cookie: session.getCookieString(),
+ }
+ };
+ let response;
+
+ try {
+ response = await Apify.utils.requestAsBrowser(requestOptions);
+ } catch (e) {
+ if (e === "SomeNetworkError") {
+ // If a network error happens, such as timeout, socket hangup etc...
+ // There is usually a chance that it was just bad luck and the proxy works.
+ // No need to throw it away.
+ session.markBad();
+ }
+ throw e;
+ }
+
+ // Automatically retires the session based on response HTTP status code.
+ session.retireOnBlockedStatusCodes(response.statusCode);
+
+ if (response.body.blocked) {
+ // You are sure it is blocked.
+ // This will throw away the session.
+ session.retire();
+
+ }
+
+ // Everything is ok, you can get the data.
+ // No need to call session.markGood -> BasicCrawler calls it for you.
+
+ // If you want to use the CookieJar in session you need.
+ session.setCookiesFromResponse(response);
+
+ }
+ });
+```
+
+**Example solo usage**
+
+```javascript
+Apify.main(async () => {
+
+ const sessionPoolOptions = {
+ maxPoolSize: 100
+ };
+ const sessionPool = await Apify.openSessionPool(sessionPoolOptions);
+
+ // Get session
+ const session = sessionPool.getSession();
+
+ // Increase the errorScore.
+ session.markBad();
+
+ // Throw away the session
+ session.retire();
+
+ // Lower the errorScore and marks the session good.
+ session.markGood();
+});
+```
+These are the basics of configuring SessionPool.
+Please, bear in mind that a Session pool needs time to find working IPs and build up the pool,
+so you will probably see a lot of errors until it becomes stabilized.
diff --git a/website/versioned_docs/version-0.22.4/guides/typescript_actor.md b/website/versioned_docs/version-0.22.4/guides/typescript_actor.md
new file mode 100644
index 000000000..00abd6ff3
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/guides/typescript_actor.md
@@ -0,0 +1,141 @@
+---
+id: version-0.22.4-type-script-actor
+title: TypeScript Actors
+original_id: type-script-actor
+---
+
+Apify SDK supports TypeScript by covering public APIs with type declarations. This
+allows writing code with auto-completion for TypeScript and JavaScript code alike.
+Besides that, actors written in TypeScript can take advantage of compile-time
+type-checking and avoid many coding mistakes, while providing documentation for
+functions, parameters and return values.
+
+Setting up a TypeScript project
+=============================
+
+To use TypeScript in your actors, you'll need the following prerequisites.
+
+1. TypeScript compiler `tsc` installed somewhere:
+
+ ```shell script
+ npm install --dev typescript
+ ```
+
+ TypeScript can be a development dependency in your project, as shown above. There's no
+ need to pollute your production environment or your system's global repository
+ with TypeScript.
+
+2. A build script invoking `tsc` and a correctly specified `main` entry point defined
+ in your `package.json`:
+
+ ```json
+ {
+ "scripts": {
+ "build": "tsc -p tsconfig.json"
+ },
+ "main": "build/main.js"
+ }
+ ```
+
+3. Type declarations for NodeJS, so you can take advantage of type-checking in all the features you'll use:
+
+ ```shell script
+ npm install --dev @types/node
+ ```
+
+4. TypeScript configuration file allowing `tsc` to understand your project layout and
+ the features used in your project:
+
+ ```json
+ {
+ "compilerOptions": {
+ "target": "es2018",
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "strict": true,
+ "noImplicityAny": false,
+ "strictNullChecks": false,
+ "lib": [
+ "es2018",
+ "es2018.asynciterable",
+ "dom",
+ "dom.iterable"
+ ],
+ "rootDir": "src/",
+ "outDir": "build/"
+ },
+ "include": [
+ "src/"
+ ]
+ }
+ ```
+
+ Place the content above inside a `tsconfig.json` in your root folder.
+
+ Also, if you are a VSCode user that is using JavaScript, create a `jsconfig.json` with the same content, adding `"checkJs": true` to `"compilerOptions"`, so you can enjoy using the types in your `.js` source files.
+
+Auto-completion
+==============
+
+IDE auto-completion should work in most places. That's true even if you are writting
+actors in pure JavaScript. For time constraints, we left out the amendment of an
+internal API for the time being, and these need to be added as the SDK developers write
+new and enhance old code.
+
+SDK Documentation
+=================
+
+SDK documentation has grown a lot. There is a new API Reference section **Type definitions**
+that holds documentation for all constructible types, function parameters and
+return types, in the Apify SDK.
+
+Caveats
+========
+
+As of version 0.20, the generated typings, due to JSDoc limitations, have some properties
+and parameters annotated with `any` type, therefore the settings `noImplicitAny` and `strictNullChecks`, set to `true`, may not be advised. You may try enabling them, but it might hinder development because of the need for typecasts to be able to compile, your mileage may vary.
+
+Besides the _implicit any_ errors that might occur in the code when writing in TypeScript, the
+current typings doesn't offer generics that make outputs type-safe, so you need to declare your
+types, as such:
+
+```typescript
+interface MySchema {
+ expectedParam1?: string;
+ expectedParam2?: number;
+}
+
+const input: MySchema = await Apify.getInput(); // getInput returns Promise<any> here
+
+if (!input?.expectedParam1) { // input is MySchema now and you can check in a type-safe way
+ throw new Error('Missing expectedParam1');
+}
+```
+
+There are also other places where you need to explicitly provide your interface / type, like in Dataset iterators (`map`, `reduce`, `forEach`):
+
+```typescript
+interface ExpectedShape {
+ id: string;
+ someFields: Fields[];
+}
+
+const dataset = await Apify.openDataset();
+await dataset.forEach((item: ExpectedShape) => {
+ // deal with item.id / item.someFields
+ // otherwise item is "any"
+})
+```
+
+When using `launchPuppeteer()`, puppeteer's `LaunchOptions` needs to be
+provided as an intersection using `&`, with the `LaunchPuppeteerOptions`,
+so you can have all the options available:
+
+```typescript
+// manually import the types from puppeteer
+import { PuppeteerOptions } from 'puppeteer'
+import { LaunchPuppeteerOptions } from 'apify'
+
+Apify.launchPuppeteer({ } as PuppeteerOptions & LaunchPuppeteerOptions)
+// should show all available options intersected
+```
diff --git a/website/versioned_docs/version-0.22.4/typedefs/AbortFunction.md b/website/versioned_docs/version-0.22.4/typedefs/AbortFunction.md
new file mode 100644
index 000000000..1dfcc0673
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/AbortFunction.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-abort-function
+title: AbortFunction
+original_id: abort-function
+---
+
+<a name="abortfunction"></a>
+
+**Parameters**:
+
+- **`response`**: `IncomingMessage`
+
+**Returns**:
+
+`boolean`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/ActorRun.md b/website/versioned_docs/version-0.22.4/typedefs/ActorRun.md
new file mode 100644
index 000000000..09461da58
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/ActorRun.md
@@ -0,0 +1,182 @@
+---
+id: version-0.22.4-actor-run
+title: ActorRun
+original_id: actor-run
+---
+
+<a name="actorrun"></a>
+
+Represents information about an actor run, as returned by the [`Apify.call()`](../api/apify#call) or [`Apify.callTask()`](../api/apify#calltask)
+function. The object is almost equivalent to the JSON response of the
+[Actor run](https://apify.com/docs/api/v2#/reference/actors/run-collection/run-actor) Apify API endpoint and extended with certain fields. For more
+details, see [Runs.](https://docs.apify.com/actor/run)
+
+## Properties
+
+### `id`
+
+**Type**: `string`
+
+Actor run ID
+
+---
+
+### `actId`
+
+**Type**: `string`
+
+Actor ID
+
+---
+
+### `startedAt`
+
+**Type**: `Date`
+
+Time when the actor run started
+
+---
+
+### `finishedAt`
+
+**Type**: `Date`
+
+Time when the actor run finished. Contains `null` for running actors.
+
+---
+
+### `status`
+
+**Type**: `string`
+
+Status of the run. For possible values, see [Run lifecycle](https://docs.apify.com/actor/run#lifecycle) in Apify actor documentation.
+
+---
+
+### `meta`
+
+**Type**: `object`
+
+Actor run meta-data. For example:
+
+```
+{
+ "origin": "API",
+ "clientIp": "1.2.3.4",
+ "userAgent": "ApifyClient/0.2.13 (Linux; Node/v8.11.3)"
+}
+```
+
+---
+
+### `stats`
+
+**Type**: `object`
+
+An object containing various actor run statistics. For example:
+
+```
+{
+ "inputBodyLen": 22,
+ "restartCount": 0,
+ "workersUsed": 1,
+}
+```
+
+Beware that object fields might change in future releases.
+
+---
+
+### `options`
+
+**Type**: `object`
+
+Actor run options. For example:
+
+```
+{
+ "build": "latest",
+ "waitSecs": 0,
+ "memoryMbytes": 256,
+ "diskMbytes": 512
+}
+```
+
+---
+
+### `buildId`
+
+**Type**: `string`
+
+ID of the actor build used for the run. For details, see [Builds](https://docs.apify.com/actor/build) in Apify actor documentation.
+
+---
+
+### `buildNumber`
+
+**Type**: `string`
+
+Number of the actor build used for the run. For example, `0.0.10`.
+
+---
+
+### `exitCode`
+
+**Type**: `number`
+
+Exit code of the actor run process. It's `null` if actor is still running.
+
+---
+
+### `defaultKeyValueStoreId`
+
+**Type**: `string`
+
+ID of the default key-value store associated with the actor run. See [`KeyValueStore`](../api/key-value-store) for details.
+
+---
+
+### `defaultDatasetId`
+
+**Type**: `string`
+
+ID of the default dataset associated with the actor run. See [`Dataset`](../api/dataset) for details.
+
+---
+
+### `defaultRequestQueueId`
+
+**Type**: `string`
+
+ID of the default request queue associated with the actor run. See [`RequestQueue`](../api/request-queue) for details.
+
+---
+
+### `containerUrl`
+
+**Type**: `string`
+
+URL on which the web server running inside actor run's Docker container can be accessed. For more details, see
+[Container web server](https://docs.apify.com/actor/run#container-web-server) in Apify actor documentation.
+
+---
+
+### `output`
+
+**Type**: `object` | `null` | `undefined`
+
+Contains output of the actor run. The value is `null` or `undefined` in case the actor is still running, or if you pass `false` to the `fetchOutput`
+option of [`Apify.call()`](../api/apify#call).
+
+For example:
+
+```
+{
+ "contentType": "application/json; charset=utf-8",
+ "body": {
+ "message": "Hello world!"
+ }
+}
+```
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/ApifyEnv.md b/website/versioned_docs/version-0.22.4/typedefs/ApifyEnv.md
new file mode 100644
index 000000000..cf364d732
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/ApifyEnv.md
@@ -0,0 +1,91 @@
+---
+id: version-0.22.4-apify-env
+title: ApifyEnv
+original_id: apify-env
+---
+
+<a name="apifyenv"></a>
+
+Parsed representation of the `APIFY_XXX` environmental variables. This object is returned by the [`Apify.getEnv()`](../api/apify#getenv) function.
+
+## Properties
+
+### `actorId`
+
+**Type**: `string` | `null`
+
+ID of the actor (APIFY_ACTOR_ID)
+
+---
+
+### `actorRunId`
+
+**Type**: `string` | `null`
+
+ID of the actor run (APIFY_ACTOR_RUN_ID)
+
+---
+
+### `actorTaskId`
+
+**Type**: `string` | `null`
+
+ID of the actor task (APIFY_ACTOR_TASK_ID)
+
+---
+
+### `userId`
+
+**Type**: `string` | `null`
+
+ID of the user who started the actor - note that it might be different than the owner ofthe actor (APIFY_USER_ID)
+
+---
+
+### `token`
+
+**Type**: `string` | `null`
+
+Authentication token representing privileges given to the actor run, it can be passed to various Apify APIs (APIFY_TOKEN)
+
+---
+
+### `startedAt`
+
+**Type**: `Date` | `null`
+
+Date when the actor was started (APIFY_STARTED_AT)
+
+---
+
+### `timeoutAt`
+
+**Type**: `Date` | `null`
+
+Date when the actor will time out (APIFY_TIMEOUT_AT)
+
+---
+
+### `defaultKeyValueStoreId`
+
+**Type**: `string` | `null`
+
+ID of the key-value store where input and output data of this actor is stored (APIFY_DEFAULT_KEY_VALUE_STORE_ID)
+
+---
+
+### `defaultDatasetId`
+
+**Type**: `string` | `null`
+
+ID of the dataset where input and output data of this actor is stored (APIFY_DEFAULT_DATASET_ID)
+
+---
+
+### `memoryMbytes`
+
+**Type**: `number` | `null`
+
+Amount of memory allocated for the actor, in megabytes (APIFY_MEMORY_MBYTES)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/AutoscaledPoolOptions.md b/website/versioned_docs/version-0.22.4/typedefs/AutoscaledPoolOptions.md
new file mode 100644
index 000000000..c55df114f
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/AutoscaledPoolOptions.md
@@ -0,0 +1,132 @@
+---
+id: version-0.22.4-autoscaled-pool-options
+title: AutoscaledPoolOptions
+original_id: autoscaled-pool-options
+---
+
+<a name="autoscaledpooloptions"></a>
+
+## Properties
+
+### `runTaskFunction`
+
+**Type**: `function`
+
+A function that performs an asynchronous resource-intensive task. The function must either be labeled `async` or return a promise.
+
+---
+
+### `isTaskReadyFunction`
+
+**Type**: `function`
+
+A function that indicates whether `runTaskFunction` should be called. This function is called every time there is free capacity for a new task and it
+should indicate whether it should start a new task or not by resolving to either `true` or `false`. Besides its obvious use, it is also useful for
+task throttling to save resources.
+
+---
+
+### `isFinishedFunction`
+
+**Type**: `function`
+
+A function that is called only when there are no tasks to be processed. If it resolves to `true` then the pool's run finishes. Being called only when
+there are no tasks being processed means that as long as `isTaskReadyFunction()` keeps resolving to `true`, `isFinishedFunction()` will never be
+called. To abort a run, use the [`AutoscaledPool.abort()`](../api/autoscaled-pool#abort) method.
+
+---
+
+### `minConcurrency`
+
+**Type**: `number` <code> = 1</code>
+
+The minimum number of tasks running in parallel.
+
+_WARNING:_ If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash. If you're
+not sure, just keep the default value and the concurrency will scale up automatically.
+
+---
+
+### `maxConcurrency`
+
+**Type**: `number` <code> = 1000</code>
+
+The maximum number of tasks running in parallel.
+
+---
+
+### `desiredConcurrency`
+
+**Type**: `number`
+
+The desired number of tasks that should be running parallel on the start of the pool, if there is a large enough supply of them. By default, it is
+`minConcurrency`.
+
+---
+
+### `desiredConcurrencyRatio`
+
+**Type**: `number` <code> = 0.95</code>
+
+Minimum level of desired concurrency to reach before more scaling up is allowed.
+
+---
+
+### `scaleUpStepRatio`
+
+**Type**: `number` <code> = 0.05</code>
+
+Defines the fractional amount of desired concurrency to be added with each scaling up. The minimum scaling step is one.
+
+---
+
+### `scaleDownStepRatio`
+
+**Type**: `number` <code> = 0.05</code>
+
+Defines the amount of desired concurrency to be subtracted with each scaling down. The minimum scaling step is one.
+
+---
+
+### `maybeRunIntervalSecs`
+
+**Type**: `number` <code> = 0.5</code>
+
+Indicates how often the pool should call the `runTaskFunction()` to start a new task, in seconds. This has no effect on starting new tasks immediately
+after a task completes.
+
+---
+
+### `loggingIntervalSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Specifies a period in which the instance logs its state, in seconds. Set to `null` to disable periodic logging.
+
+---
+
+### `autoscaleIntervalSecs`
+
+**Type**: `number` <code> = 10</code>
+
+Defines in seconds how often the pool should attempt to adjust the desired concurrency based on the latest system status. Setting it lower than 1
+might have a severe impact on performance. We suggest using a value from 5 to 20.
+
+---
+
+### `snapshotterOptions`
+
+**Type**: [`SnapshotterOptions`](../typedefs/snapshotter-options)
+
+Options to be passed down to the [`Snapshotter`](../api/snapshotter) constructor. This is useful for fine-tuning the snapshot intervals and history.
+
+---
+
+### `systemStatusOptions`
+
+**Type**: [`SystemStatusOptions`](../typedefs/system-status-options)
+
+Options to be passed down to the [`SystemStatus`](../api/system-status) constructor. This is useful for fine-tuning the system status reports. If a
+custom snapshotter is set in the options, it will be used by the pool.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/BasicCrawlerOptions.md b/website/versioned_docs/version-0.22.4/typedefs/BasicCrawlerOptions.md
new file mode 100644
index 000000000..a1b521c34
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/BasicCrawlerOptions.md
@@ -0,0 +1,147 @@
+---
+id: version-0.22.4-basic-crawler-options
+title: BasicCrawlerOptions
+original_id: basic-crawler-options
+---
+
+<a name="basiccrawleroptions"></a>
+
+## Properties
+
+### `handleRequestFunction`
+
+**Type**: [`HandleRequest`](../typedefs/handle-request)
+
+User-provided function that performs the logic of the crawler. It is called for each URL to crawl.
+
+The function receives the following object as an argument:
+
+```
+{
+ request: Request,
+ autoscaledPool: AutoscaledPool,
+ session: Session,
+}
+```
+
+where the [`Request`](../api/request) instance represents the URL to crawl.
+
+The function must return a promise, which is then awaited by the crawler.
+
+If the function throws an exception, the crawler will try to re-crawl the request later, up to `option.maxRequestRetries` times. If all the retries
+fail, the crawler calls the function provided to the `handleFailedRequestFunction` parameter. To make this work, you should **always** let your
+function throw exceptions rather than catch them. The exceptions are logged to the request using the
+[`Request.pushErrorMessage()`](../api/request#pusherrormessage) function.
+
+---
+
+### `requestList`
+
+**Type**: [`RequestList`](../api/request-list)
+
+Static list of URLs to be processed. Either `requestList` or `requestQueue` option must be provided (or both).
+
+---
+
+### `requestQueue`
+
+**Type**: [`RequestQueue`](../api/request-queue)
+
+Dynamic queue of URLs to be processed. This is useful for recursive crawling of websites. Either `requestList` or `requestQueue` option must be
+provided (or both).
+
+---
+
+### `handleRequestTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which the function passed as `handleRequestFunction` needs to finish, in seconds.
+
+---
+
+### `handleFailedRequestFunction`
+
+**Type**: [`HandleFailedRequest`](../typedefs/handle-failed-request)
+
+A function to handle requests that failed more than `option.maxRequestRetries` times.
+
+The function receives the following object as an argument:
+
+```
+{
+ request: Request,
+ error: Error,
+}
+```
+
+where the [`Request`](../api/request) instance corresponds to the failed request, and the `Error` instance represents the last error thrown during
+processing of the request.
+
+See [source code](https://github.com/apify/apify-js/blob/master/src/crawlers/basic_crawler.js#L11) for the default implementation of this function.
+
+---
+
+### `maxRequestRetries`
+
+**Type**: `number` <code> = 3</code>
+
+Indicates how many times the request is retried if
+[`BasicCrawlerOptions.handleRequestFunction`](../typedefs/basic-crawler-options#handlerequestfunction) fails.
+
+---
+
+### `maxRequestsPerCrawl`
+
+**Type**: `number`
+
+Maximum number of pages that the crawler will open. The crawl will stop when this limit is reached. Always set this value in order to prevent infinite
+loops in misconfigured crawlers. Note that in cases of parallel crawling, the actual number of pages visited might be slightly higher than this value.
+
+---
+
+### `autoscaledPoolOptions`
+
+**Type**: [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options)
+
+Custom options passed to the underlying [`AutoscaledPool`](../api/autoscaled-pool) constructor. Note that the `runTaskFunction` and
+`isTaskReadyFunction` options are provided by `BasicCrawler` and cannot be overridden. However, you can provide a custom implementation of
+`isFinishedFunction`.
+
+---
+
+### `minConcurrency`
+
+**Type**: `number` <code> = 1</code>
+
+Sets the minimum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+_WARNING:_ If you set this value too high with respect to the available system memory and CPU, your crawler will run extremely slow or crash. If
+you're not sure, just keep the default value and the concurrency will scale up automatically.
+
+---
+
+### `maxConcurrency`
+
+**Type**: `number` <code> = 1000</code>
+
+Sets the maximum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+---
+
+### `useSessionPool`
+
+**Type**: `boolean` <code> = false</code>
+
+If set to true. Basic crawler will initialize the [`SessionPool`](../api/session-pool) with the corresponding `sessionPoolOptions`. The session
+instance will be than available in the `handleRequestFunction`.
+
+---
+
+### `sessionPoolOptions`
+
+**Type**: [`SessionPoolOptions`](../typedefs/session-pool-options)
+
+The configuration options for {SessionPool} to use.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/BrowserCrawlerOptions.md b/website/versioned_docs/version-0.22.4/typedefs/BrowserCrawlerOptions.md
new file mode 100644
index 000000000..a3164e0c6
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/BrowserCrawlerOptions.md
@@ -0,0 +1,261 @@
+---
+id: version-0.22.4-browser-crawler-options
+title: BrowserCrawlerOptions
+original_id: browser-crawler-options
+---
+
+<a name="browsercrawleroptions"></a>
+
+## Properties
+
+### `handlePageFunction`
+
+**Type**: `function`
+
+Function that is called to process each request. It is passed an object with the following fields:
+
+```
+{
+ request: Request,
+ response: Response,
+ page: Page,
+ session: Session,
+ browserController: BrowserController,
+ proxyInfo: ProxyInfo,
+ crawler: BrowserCrawler,
+}
+```
+
+`request` is an instance of the [`Request`](../api/request) object with details about the URL to open, HTTP method etc. `page` is an instance of the
+`Puppeteer` [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) or `Playwright` [`Page`](https://playwright.dev/docs/api/class-page)
+`browserPool` is an instance of the [`BrowserPool`](https://github.com/apify/browser-pool#BrowserPool), `browserController` is an instance of the
+[`BrowserController`](https://github.com/apify/browser-pool#browsercontroller), `response` is an instance of the `Puppeteer`
+[`Response`](https://pptr.dev/#?product=Puppeteer&show=api-class-response) or `Playwright`
+[`Response`](https://playwright.dev/docs/api/class-response), which is the main resource response as returned by `page.goto(request.url)`. The
+function must return a promise, which is then awaited by the crawler.
+
+If the function throws an exception, the crawler will try to re-crawl the request later, up to `option.maxRequestRetries` times. If all the retries
+fail, the crawler calls the function provided to the `handleFailedRequestFunction` parameter. To make this work, you should **always** let your
+function throw exceptions rather than catch them. The exceptions are logged to the request using the
+[`Request.pushErrorMessage()`](../api/request#pusherrormessage) function.
+
+---
+
+### `handlePageTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which the function passed as `handlePageFunction` needs to finish, in seconds.
+
+---
+
+### `gotoFunction`
+
+**Type**: `function`
+
+Navigation function for corresponding library. `page.goto(url)` is supported by both `playwright` and `puppeteer`.
+
+---
+
+### `handleFailedRequestFunction`
+
+**Type**: [`HandleFailedRequest`](../typedefs/handle-failed-request)
+
+A function to handle requests that failed more than `option.maxRequestRetries` times.
+
+The function receives the following object as an argument:
+
+```
+{
+ request: Request,
+ response: Response,
+ page: Page,
+ browserPool: BrowserPool,
+ autoscaledPool: AutoscaledPool,
+ session: Session,
+ browserController: BrowserController,
+ proxyInfo: ProxyInfo,
+}
+```
+
+Where the [`Request`](../api/request) instance corresponds to the failed request, and the `Error` instance represents the last error thrown during
+processing of the request.
+
+---
+
+### `browserPoolOptions`
+
+**Type**: `BrowserPoolOptions`
+
+Custom options passed to the underlying [`BrowserPool`](https://github.com/apify/browser-pool#BrowserPool) constructor. You can tweak those to
+fine-tune browser management.
+
+---
+
+### `persistCookiesPerSession`
+
+**Type**: `boolean` <code> = false</code>
+
+Automatically saves cookies to Session. Works only if Session Pool is used.
+
+---
+
+### `proxyConfiguration`
+
+**Type**: [`ProxyConfiguration`](../api/proxy-configuration)
+
+If set, `PuppeteerCrawler` will be configured for all connections to use [Apify Proxy](https://my.apify.com/proxy) or your own Proxy URLs provided and
+rotated according to the configuration. For more information, see the [documentation](https://docs.apify.com/proxy).
+
+---
+
+### `preNavigationHooks`
+
+**Type**: `Array<function()>`
+
+Async functions that are sequentially evaluated before the navigation. Good for setting additional cookies or browser properties before navigation.
+The function accepts two parameters, `crawlingContext` and `gotoOptions`, which are passed to the `gotoFunction` the crawler calls to navigate.
+Example:
+
+```
+preNavigationHooks: [
+ async (crawlingContext, gotoOptions) => {
+ await page.evaluate((attr) => { window.foo = attr; }, 'bar');
+ }
+]
+```
+
+---
+
+### `postNavigationHooks`
+
+**Type**: `Array<function()>`
+
+Async functions that are sequentially evaluated after the navigation. Good for checking if the navigation was successful. The function accepts
+`crawlingContext` as an only parameter. Example:
+
+```
+postNavigationHooks: [
+ async (crawlingContext) => {
+ const { page } = crawlingContext;
+ if (hasCaptcha(page)) {
+ await solveCaptcha (page);
+ }
+ };
+]
+```
+
+---
+
+### `requestList`
+
+**Type**: [`RequestList`](../api/request-list)
+
+Static list of URLs to be processed. Either `requestList` or `requestQueue` option must be provided (or both).
+
+---
+
+### `requestQueue`
+
+**Type**: [`RequestQueue`](../api/request-queue)
+
+Dynamic queue of URLs to be processed. This is useful for recursive crawling of websites. Either `requestList` or `requestQueue` option must be
+provided (or both).
+
+---
+
+### `handleRequestTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which the function passed as `handleRequestFunction` needs to finish, in seconds.
+
+---
+
+### `handleFailedRequestFunction`
+
+**Type**: [`HandleFailedRequest`](../typedefs/handle-failed-request)
+
+A function to handle requests that failed more than `option.maxRequestRetries` times.
+
+The function receives the following object as an argument:
+
+```
+{
+ request: Request,
+ error: Error,
+ session: Session,
+ crawler: BrowserCrawler,
+}
+```
+
+where the [`Request`](../api/request) instance corresponds to the failed request, and the `Error` instance represents the last error thrown during
+processing of the request.
+
+See [source code](https://github.com/apify/apify-js/blob/master/src/crawlers/basic_crawler.js#L11) for the default implementation of this function.
+
+---
+
+### `maxRequestRetries`
+
+**Type**: `number` <code> = 3</code>
+
+Indicates how many times the request is retried if
+[`BasicCrawlerOptions.handleRequestFunction`](../typedefs/basic-crawler-options#handlerequestfunction) fails.
+
+---
+
+### `maxRequestsPerCrawl`
+
+**Type**: `number`
+
+Maximum number of pages that the crawler will open. The crawl will stop when this limit is reached. Always set this value in order to prevent infinite
+loops in misconfigured crawlers. Note that in cases of parallel crawling, the actual number of pages visited might be slightly higher than this value.
+
+---
+
+### `autoscaledPoolOptions`
+
+**Type**: [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options)
+
+Custom options passed to the underlying [`AutoscaledPool`](../api/autoscaled-pool) constructor. Note that the `runTaskFunction` and
+`isTaskReadyFunction` options are provided by `BasicCrawler` and cannot be overridden. However, you can provide a custom implementation of
+`isFinishedFunction`.
+
+---
+
+### `minConcurrency`
+
+**Type**: `number` <code> = 1</code>
+
+Sets the minimum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+_WARNING:_ If you set this value too high with respect to the available system memory and CPU, your crawler will run extremely slow or crash. If
+you're not sure, just keep the default value and the concurrency will scale up automatically.
+
+---
+
+### `maxConcurrency`
+
+**Type**: `number` <code> = 1000</code>
+
+Sets the maximum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+---
+
+### `useSessionPool`
+
+**Type**: `boolean` <code> = false</code>
+
+If set to true. Basic crawler will initialize the [`SessionPool`](../api/session-pool) with the corresponding `sessionPoolOptions`. The session
+instance will be than available in the `handleRequestFunction`.
+
+---
+
+### `sessionPoolOptions`
+
+**Type**: [`SessionPoolOptions`](../typedefs/session-pool-options)
+
+The configuration options for [`SessionPool`](../api/session-pool) to use.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/CheerioCrawlerOptions.md b/website/versioned_docs/version-0.22.4/typedefs/CheerioCrawlerOptions.md
new file mode 100644
index 000000000..2b9094ff0
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/CheerioCrawlerOptions.md
@@ -0,0 +1,329 @@
+---
+id: version-0.22.4-cheerio-crawler-options
+title: CheerioCrawlerOptions
+original_id: cheerio-crawler-options
+---
+
+<a name="cheeriocrawleroptions"></a>
+
+## Properties
+
+### `handlePageFunction`
+
+**Type**: [`CheerioHandlePage`](../typedefs/cheerio-handle-page)
+
+User-provided function that performs the logic of the crawler. It is called for each page loaded and parsed by the crawler.
+
+The function receives the following object as an argument:
+
+```
+{
+ // The Cheerio object's function with the parsed HTML.
+ $: Cheerio,
+
+ // The request body of the web page, whose type depends on the content type.
+ body: String|Buffer,
+
+ // The parsed object from JSON for responses with the "application/json" content types.
+ // For other content types it's null.
+ json: Object,
+
+ // Apify.Request object with details of the requested web page
+ request: Request,
+
+ // Parsed Content-Type HTTP header: { type, encoding }
+ contentType: Object,
+
+ // An instance of Node's http.IncomingMessage object,
+ response: Object,
+
+ // Underlying AutoscaledPool instance used to manage the concurrency of crawler
+ autoscaledPool: AutoscaledPool,
+
+ // Session object, useful to work around anti-scraping protections
+ session: Session
+
+ // ProxyInfo object with information about currently used proxy
+ proxyInfo: ProxyInfo
+}
+```
+
+Type of `body` depends on the `Content-Type` header of the web page:
+
+- String for `text/html`, `application/xhtml+xml`, `application/xml` MIME content types
+- Buffer for others MIME content types
+
+Parsed `Content-Type` header using [content-type package](https://www.npmjs.com/package/content-type) is stored in `contentType`.
+
+Cheerio is available only for HTML and XML content types.
+
+With the [`Request`](../api/request) object representing the URL to crawl.
+
+If the function returns, the returned promise is awaited by the crawler.
+
+If the function throws an exception, the crawler will try to re-crawl the request later, up to `option.maxRequestRetries` times. If all the retries
+fail, the crawler calls the function provided to the `handleFailedRequestFunction` parameter. To make this work, you should **always** let your
+function throw exceptions rather than catch them. The exceptions are logged to the request using the
+[`Request.pushErrorMessage()`](../api/request#pusherrormessage) function.
+
+---
+
+### `requestList`
+
+**Type**: [`RequestList`](../api/request-list)
+
+Static list of URLs to be processed. Either `requestList` or `requestQueue` option must be provided (or both).
+
+---
+
+### `requestQueue`
+
+**Type**: [`RequestQueue`](../api/request-queue)
+
+Dynamic queue of URLs to be processed. This is useful for recursive crawling of websites. Either `requestList` or `requestQueue` option must be
+provided (or both).
+
+---
+
+### `prepareRequestFunction`
+
+**Type**: [`PrepareRequest`](../typedefs/prepare-request)
+
+A function that executes before the HTTP request is made to the target resource. This function is suitable for setting dynamic properties such as
+cookies to the [`Request`](../api/request).
+
+The function receives the following object as an argument:
+
+```
+{
+ request: Request,
+ autoscaledPool: AutoscaledPool,
+ session: Session,
+ proxyInfo: ProxyInfo,
+}
+```
+
+where the [`Request`](../api/request) instance corresponds to the initialized request and the [`Session`](../api/session) instance corresponds to used
+session.
+
+The function should modify the properties of the passed [`Request`](../api/request) instance in place because there are already earlier references to
+it. Making a copy and returning it from this function is therefore not supported, because it would create inconsistencies where different parts of SDK
+would have access to a different [`Request`](../api/request) instance.
+
+---
+
+### `postResponseFunction`
+
+**Type**: [`PostResponse`](../typedefs/post-response)
+
+A function that executes right after the HTTP request is made to the target resource and response is returned. This function is suitable for
+overriding custom properties of response e.g. setting headers because of response parsing.
+
+**Example usage:**
+
+```javascript
+const cheerioCrawlerOptions = {
+ // ...
+ postResponseFunction: ({ request, response }) => {
+ if (request.userData.parseAsJSON) {
+ response.headers['content-type'] = 'application/json; charset=utf-8';
+ }
+ },
+};
+```
+
+The function receives the following object as an argument:
+
+```
+{
+ response: Object,
+ request: Request,
+ autoscaledPool: AutoscaledPool,
+ session: Session,
+ proxyInfo: ProxyInfo,
+}
+```
+
+The response is an instance of Node's http.IncomingMessage object.
+
+---
+
+### `handlePageTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which the function passed as `handlePageFunction` needs to finish, given in seconds.
+
+---
+
+### `requestTimeoutSecs`
+
+**Type**: `number` <code> = 30</code>
+
+Timeout in which the HTTP request to the resource needs to finish, given in seconds.
+
+---
+
+### `ignoreSslErrors`
+
+**Type**: `boolean` <code> = true</code>
+
+If set to true, SSL certificate errors will be ignored.
+
+---
+
+### `proxyConfiguration`
+
+**Type**: [`ProxyConfiguration`](../api/proxy-configuration)
+
+If set, `CheerioCrawler` will be configured for all connections to use [Apify Proxy](https://my.apify.com/proxy) or your own Proxy URLs provided and
+rotated according to the configuration. For more information, see the [documentation](https://docs.apify.com/proxy).
+
+---
+
+### `handleFailedRequestFunction`
+
+**Type**: [`HandleFailedRequest`](../typedefs/handle-failed-request)
+
+A function to handle requests that failed more than `option.maxRequestRetries` times.
+
+The function receives the following object as an argument:
+
+```
+{
+ error: Error,
+ request: Request,
+ autoscaledPool: AutoscaledPool,
+ session: Session,
+ $: Cheerio,
+ body: String|Buffer,
+ json: Object,
+ request: Request,
+ contentType: Object,
+ response: Object,
+ proxyInfo: ProxyInfo
+}
+```
+
+where the [`Request`](../api/request) instance corresponds to the failed request, and the `Error` instance represents the last error thrown during
+processing of the request.
+
+See [source code](https://github.com/apify/apify-js/blob/master/src/crawlers/cheerio_crawler.js#L13) for the default implementation of this function.
+
+---
+
+### `additionalMimeTypes`
+
+**Type**: `Array<string>`
+
+An array of <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types"
+ target="_blank">MIME types</a> you want the crawler to load and process. By default, only `text/html` and `application/xhtml+xml` MIME types are
+supported.
+
+---
+
+### `suggestResponseEncoding`
+
+**Type**: `string`
+
+By default `CheerioCrawler` will extract correct encoding from the HTTP response headers. Sadly, there are some websites which use invalid headers.
+Those are encoded using the UTF-8 encoding. If those sites actually use a different encoding, the response will be corrupted. You can use
+`suggestResponseEncoding` to fall back to a certain encoding, if you know that your target website uses it. To force a certain encoding, disregarding
+the response headers, use [`CheerioCrawlerOptions.forceResponseEncoding`](../typedefs/cheerio-crawler-options#forceresponseencoding)
+
+```
+// Will fall back to windows-1250 encoding if none found
+suggestResponseEncoding: 'windows-1250'
+```
+
+---
+
+### `forceResponseEncoding`
+
+**Type**: `string`
+
+By default `CheerioCrawler` will extract correct encoding from the HTTP response headers. Use `forceResponseEncoding` to force a certain encoding,
+disregarding the response headers. To only provide a default for missing encodings, use
+[`CheerioCrawlerOptions.suggestResponseEncoding`](../typedefs/cheerio-crawler-options#suggestresponseencoding)
+
+```
+// Will force windows-1250 encoding even if headers say otherwise
+forceResponseEncoding: 'windows-1250'
+```
+
+---
+
+### `maxRequestRetries`
+
+**Type**: `number` <code> = 3</code>
+
+Indicates how many times the request is retried if either `requestFunction` or `handlePageFunction` fails.
+
+---
+
+### `maxRequestsPerCrawl`
+
+**Type**: `number`
+
+Maximum number of pages that the crawler will open. The crawl will stop when this limit is reached. Always set this value in order to prevent infinite
+loops in misconfigured crawlers. Note that in cases of parallel crawling, the actual number of pages visited might be slightly higher than this value.
+
+---
+
+### `autoscaledPoolOptions`
+
+**Type**: [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options)
+
+Custom options passed to the underlying [`AutoscaledPool`](../api/autoscaled-pool) constructor. Note that the `runTaskFunction`, `isTaskReadyFunction`
+and `isFinishedFunction` options are provided by `CheerioCrawler` and cannot be overridden. Reasonable [`Snapshotter`](../api/snapshotter) and
+[`SystemStatus`](../api/system-status) defaults are provided to account for the fact that `cheerio` parses HTML synchronously and therefore blocks the
+event loop.
+
+---
+
+### `minConcurrency`
+
+**Type**: `number` <code> = 1</code>
+
+Sets the minimum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+_WARNING:_ If you set this value too high with respect to the available system memory and CPU, your crawler will run extremely slow or crash. If
+you're not sure, just keep the default value and the concurrency will scale up automatically.
+
+---
+
+### `maxConcurrency`
+
+**Type**: `number` <code> = 1000</code>
+
+Sets the maximum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+---
+
+### `useSessionPool`
+
+**Type**: `boolean` <code> = false</code>
+
+If set to true Crawler will automatically use Session Pool. It will automatically retire sessions on 403, 401 and 429 status codes. It also marks
+Session as bad after a request timeout.
+
+---
+
+### `sessionPoolOptions`
+
+**Type**: [`SessionPoolOptions`](../typedefs/session-pool-options)
+
+Custom options passed to the underlying [`SessionPool`](../api/session-pool) constructor.
+
+---
+
+### `persistCookiesPerSession`
+
+**Type**: `boolean`
+
+Automatically saves cookies to Session. Works only if Session Pool is used.
+
+It parses cookie from response "set-cookie" header saves or updates cookies for session and once the session is used for next request. It passes the
+"Cookie" header to the request with the session cookies.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/CheerioHandlePage.md b/website/versioned_docs/version-0.22.4/typedefs/CheerioHandlePage.md
new file mode 100644
index 000000000..59b9e65c8
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/CheerioHandlePage.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-cheerio-handle-page
+title: CheerioHandlePage
+original_id: cheerio-handle-page
+---
+
+<a name="cheeriohandlepage"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`CheerioHandlePageInputs`](../typedefs/cheerio-handle-page-inputs) - Arguments passed to this callback.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/CheerioHandlePageInputs.md b/website/versioned_docs/version-0.22.4/typedefs/CheerioHandlePageInputs.md
new file mode 100644
index 000000000..e14a7d6fc
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/CheerioHandlePageInputs.md
@@ -0,0 +1,82 @@
+---
+id: version-0.22.4-cheerio-handle-page-inputs
+title: CheerioHandlePageInputs
+original_id: cheerio-handle-page-inputs
+---
+
+<a name="cheeriohandlepageinputs"></a>
+
+## Properties
+
+### `$`
+
+**Type**: `cheerio.Selector`
+
+The [Cheerio](https://cheerio.js.org/) object with parsed HTML.
+
+---
+
+### `body`
+
+**Type**: `string` | `Buffer`
+
+The request body of the web page.
+
+---
+
+### `json`
+
+**Type**: `*`
+
+The parsed object from JSON string if the response contains the content type application/json.
+
+---
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+The original [`Request`](../api/request) object.
+
+---
+
+### `contentType`
+
+**Type**: `Object`
+
+Parsed `Content-Type header: { type, encoding }`.
+
+---
+
+### `response`
+
+**Type**: `IncomingMessage`
+
+An instance of Node's http.IncomingMessage object,
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler. Note that this property is
+only initialized after calling the [`CheerioCrawler.run()`](../api/cheerio-crawler#run) function. You can use it to change the concurrency settings on
+the fly, to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause) or to abort it by calling
+[`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+---
+
+### `session`
+
+**Type**: [`Session`](../api/session)
+
+---
+
+### `proxyInfo`
+
+**Type**: [`ProxyInfo`](../typedefs/proxy-info)
+
+An object with information about currently used proxy by the crawler and configured by the [`ProxyConfiguration`](../api/proxy-configuration) class.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/CreateSession.md b/website/versioned_docs/version-0.22.4/typedefs/CreateSession.md
new file mode 100644
index 000000000..345e579e3
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/CreateSession.md
@@ -0,0 +1,19 @@
+---
+id: version-0.22.4-create-session
+title: CreateSession
+original_id: create-session
+---
+
+<a name="createsession"></a>
+
+Factory user-function which creates customized [`Session`](../api/session) instances.
+
+**Parameters**:
+
+- **`sessionPool`**: [`SessionPool`](../api/session-pool) - Pool requesting the new session.
+
+**Returns**:
+
+[`Session`](../api/session)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/DatasetConsumer.md b/website/versioned_docs/version-0.22.4/typedefs/DatasetConsumer.md
new file mode 100644
index 000000000..5e420bcbb
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/DatasetConsumer.md
@@ -0,0 +1,20 @@
+---
+id: version-0.22.4-dataset-consumer
+title: DatasetConsumer
+original_id: dataset-consumer
+---
+
+<a name="datasetconsumer"></a>
+
+User-function used in the `Dataset.forEach()` API.
+
+**Parameters**:
+
+- **`item`**: `object` - Current [`Dataset`](../api/dataset) entry being processed.
+- **`index`**: `number` - Position of current {Dataset} entry.
+
+**Returns**:
+
+`object`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/DatasetContent.md b/website/versioned_docs/version-0.22.4/typedefs/DatasetContent.md
new file mode 100644
index 000000000..26d8983f4
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/DatasetContent.md
@@ -0,0 +1,49 @@
+---
+id: version-0.22.4-dataset-content
+title: DatasetContent
+original_id: dataset-content
+---
+
+<a name="datasetcontent"></a>
+
+## Properties
+
+### `items`
+
+**Type**: `Array<object>`
+
+Dataset entries based on chosen format parameter.
+
+---
+
+### `total`
+
+**Type**: `number`
+
+Total count of entries in the dataset.
+
+---
+
+### `offset`
+
+**Type**: `number`
+
+Position of the first returned entry in the dataset.
+
+---
+
+### `count`
+
+**Type**: `number`
+
+Count of dataset entries returned in this set.
+
+---
+
+### `limit`
+
+**Type**: `number`
+
+Maximum number of dataset entries requested.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/DatasetMapper.md b/website/versioned_docs/version-0.22.4/typedefs/DatasetMapper.md
new file mode 100644
index 000000000..5804d74b7
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/DatasetMapper.md
@@ -0,0 +1,20 @@
+---
+id: version-0.22.4-dataset-mapper
+title: DatasetMapper
+original_id: dataset-mapper
+---
+
+<a name="datasetmapper"></a>
+
+User-function used in the `Dataset.map()` API.
+
+**Parameters**:
+
+- **`item`**: `object` - Currect [`Dataset`](../api/dataset) entry being processed.
+- **`index`**: `number` - Position of current {Dataset} entry.
+
+**Returns**:
+
+`object`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/DatasetReducer.md b/website/versioned_docs/version-0.22.4/typedefs/DatasetReducer.md
new file mode 100644
index 000000000..29d114e55
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/DatasetReducer.md
@@ -0,0 +1,21 @@
+---
+id: version-0.22.4-dataset-reducer
+title: DatasetReducer
+original_id: dataset-reducer
+---
+
+<a name="datasetreducer"></a>
+
+User-function used in the `Dataset.reduce()` API.
+
+**Parameters**:
+
+- **`memo`**: `object` - Previous state of the reduction.
+- **`item`**: `object` - Currect [`Dataset`](../api/dataset) entry being processed.
+- **`index`**: `number` - Position of current {Dataset} entry.
+
+**Returns**:
+
+`object`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/HandleFailedRequest.md b/website/versioned_docs/version-0.22.4/typedefs/HandleFailedRequest.md
new file mode 100644
index 000000000..5f46f3e50
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/HandleFailedRequest.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-handle-failed-request
+title: HandleFailedRequest
+original_id: handle-failed-request
+---
+
+<a name="handlefailedrequest"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`HandleFailedRequestInput`](../typedefs/handle-failed-request-input) - Arguments passed to this callback.
+
+**Returns**:
+
+`void` \| `Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/HandleFailedRequestInput.md b/website/versioned_docs/version-0.22.4/typedefs/HandleFailedRequestInput.md
new file mode 100644
index 000000000..578f2fddd
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/HandleFailedRequestInput.md
@@ -0,0 +1,43 @@
+---
+id: version-0.22.4-handle-failed-request-input
+title: HandleFailedRequestInput
+original_id: handle-failed-request-input
+---
+
+<a name="handlefailedrequestinput"></a>
+
+## Properties
+
+### `error`
+
+**Type**: `Error`
+
+The Error thrown by `handleRequestFunction`.
+
+---
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+The original {Request} object.
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+---
+
+### `session`
+
+**Type**: [`Session`](../api/session)
+
+---
+
+### `proxyInfo`
+
+**Type**: [`ProxyInfo`](../typedefs/proxy-info)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/HandleRequest.md b/website/versioned_docs/version-0.22.4/typedefs/HandleRequest.md
new file mode 100644
index 000000000..65acad8da
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/HandleRequest.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-handle-request
+title: HandleRequest
+original_id: handle-request
+---
+
+<a name="handlerequest"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`HandleRequestInputs`](../typedefs/handle-request-inputs) - Arguments passed to this callback.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/HandleRequestInputs.md b/website/versioned_docs/version-0.22.4/typedefs/HandleRequestInputs.md
new file mode 100644
index 000000000..63a966b31
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/HandleRequestInputs.md
@@ -0,0 +1,34 @@
+---
+id: version-0.22.4-handle-request-inputs
+title: HandleRequestInputs
+original_id: handle-request-inputs
+---
+
+<a name="handlerequestinputs"></a>
+
+## Properties
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+The original {Request} object.
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler. Note that this property is
+only initialized after calling the [`BasicCrawler.run()`](../api/basic-crawler#run) function. You can use it to change the concurrency settings on the
+fly, to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause) or to abort it by calling
+[`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+---
+
+### `session`
+
+**Type**: [`Session`](../api/session)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/InterceptHandler.md b/website/versioned_docs/version-0.22.4/typedefs/InterceptHandler.md
new file mode 100644
index 000000000..e48c92580
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/InterceptHandler.md
@@ -0,0 +1,13 @@
+---
+id: version-0.22.4-intercept-handler
+title: InterceptHandler
+original_id: intercept-handler
+---
+
+<a name="intercepthandler"></a>
+
+**Parameters**:
+
+- **`request`**: [`PuppeteerRequest`](../api/request)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/KeyConsumer.md b/website/versioned_docs/version-0.22.4/typedefs/KeyConsumer.md
new file mode 100644
index 000000000..0cab256a2
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/KeyConsumer.md
@@ -0,0 +1,18 @@
+---
+id: version-0.22.4-key-consumer
+title: KeyConsumer
+original_id: key-consumer
+---
+
+<a name="keyconsumer"></a>
+
+User-function used in the [`KeyValueStore.forEachKey()`](../api/key-value-store#foreachkey) method.
+
+**Parameters**:
+
+- **`key`**: `string` - Current {KeyValue} key being processed.
+- **`index`**: `number` - Position of the current key in [`KeyValueStore`](../api/key-value-store).
+- **`info`**: `object` - Information about the current [`KeyValueStore`](../api/key-value-store) entry.
+ - **`size`**: `number` - Size of the value associated with the current key in bytes.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteer.md b/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteer.md
new file mode 100644
index 000000000..e3c440b54
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteer.md
@@ -0,0 +1,19 @@
+---
+id: version-0.22.4-launch-puppeteer
+title: LaunchPuppeteer
+original_id: launch-puppeteer
+---
+
+<a name="launchpuppeteer"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`LaunchPuppeteerOptions`](../typedefs/launch-puppeteer-options) - Arguments passed to this callback.
+
+**Returns**:
+
+`Promise<Browser>` - Promise that resolves to Puppeteer's `Browser` instance. This might be obtained by calling
+[puppeteer.launch()](https://pptr.dev/#?product=Puppeteer&version=v2.0.0&show=api-puppeteerlaunchoptions) directly, or by delegating to
+[`Apify.launchPuppeteer()`](../api/apify#launchpuppeteer).
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteerFunction.md b/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteerFunction.md
new file mode 100644
index 000000000..82af412b4
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteerFunction.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-launch-puppeteer-function
+title: LaunchPuppeteerFunction
+original_id: launch-puppeteer-function
+---
+
+<a name="launchpuppeteerfunction"></a>
+
+**Parameters**:
+
+- **`options`**: [`LaunchPuppeteerOptions`](../typedefs/launch-puppeteer-options)
+
+**Returns**:
+
+`Promise<Browser>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteerOptions.md b/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteerOptions.md
new file mode 100644
index 000000000..c9800390d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/LaunchPuppeteerOptions.md
@@ -0,0 +1,71 @@
+---
+id: version-0.22.4-launch-puppeteer-options
+title: LaunchPuppeteerOptions
+original_id: launch-puppeteer-options
+---
+
+<a name="launchpuppeteeroptions"></a>
+
+Apify extends the launch options of Puppeteer. You can use any of the Puppeteer compatible
+[`LaunchOptions`](https://pptr.dev/#?product=Puppeteer&show=api-puppeteerlaunchoptions) options in the
+[`Apify.launchPuppeteer()`](../api/apify#launchpuppeteer) function and in addition, all the options available below.
+
+## Properties
+
+### `proxyUrl`
+
+**Type**: `string`
+
+URL to a HTTP proxy server. It must define the port number, and it may also contain proxy username and password.
+
+Example: `http://bob:[email protected]:1234`.
+
+---
+
+### `userAgent`
+
+**Type**: `string`
+
+The `User-Agent` HTTP header used by the browser. If not provided, the function sets `User-Agent` to a reasonable default to reduce the chance of
+detection of the crawler.
+
+---
+
+### `useChrome`
+
+**Type**: `boolean` <code> = false</code>
+
+If `true` and `executablePath` is not set, Puppeteer will launch full Google Chrome browser available on the machine rather than the bundled Chromium.
+The path to Chrome executable is taken from the `APIFY_CHROME_EXECUTABLE_PATH` environment variable if provided, or defaults to the typical Google
+Chrome executable location specific for the operating system. By default, this option is `false`.
+
+---
+
+### `puppeteerModule`
+
+**Type**: `string` | `Object`
+
+Either a require path (`string`) to a package to be used instead of default `puppeteer`, or an already required module (`Object`). This enables usage
+of various Puppeteer wrappers such as `puppeteer-extra`.
+
+Take caution, because it can cause all kinds of unexpected errors and weird behavior. Apify SDK is not tested with any other library besides
+`puppeteer` itself.
+
+---
+
+### `stealth`
+
+**Type**: `boolean`
+
+This setting hides most of the known properties that identify headless Chrome and makes it nearly undetectable. It is recommended to use it together
+with the `useChrome` set to `true`.
+
+---
+
+### `stealthOptions`
+
+**Type**: [`StealthOptions`](../typedefs/stealth-options)
+
+Using this configuration, you can disable some of the hiding tricks. For these settings to take effect `stealth` must be set to true
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/LoggerOptions.md b/website/versioned_docs/version-0.22.4/typedefs/LoggerOptions.md
new file mode 100644
index 000000000..4fbe45ea0
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/LoggerOptions.md
@@ -0,0 +1,67 @@
+---
+id: version-0.22.4-logger-options
+title: LoggerOptions
+original_id: logger-options
+---
+
+<a name="loggeroptions"></a>
+
+## Properties
+
+### `level`
+
+**Type**: `number` <code> = 4</code>
+
+Sets the log level to the given value, preventing messages from less important log levels from being printed to the console. Use in conjunction with
+the `log.LEVELS` constants.
+
+---
+
+### `maxDepth`
+
+**Type**: `number` <code> = 4</code>
+
+Max depth of data object that will be logged. Anything deeper than the limit will be stripped off.
+
+---
+
+### `maxStringLength`
+
+**Type**: `number` <code> = 2000</code>
+
+Max length of the string to be logged. Longer strings will be truncated.
+
+---
+
+### `prefix`
+
+**Type**: `string`
+
+Prefix to be prepended the each logged line.
+
+---
+
+### `suffix`
+
+**Type**: `string`
+
+Suffix that will be appended the each logged line.
+
+---
+
+### `logger`
+
+**Type**: `Object`
+
+Logger implementation to be used. Default one is log.LoggerText to log messages as easily readable strings. Optionally you can use `log.LoggerJson`
+that formats each log line as a JSON.
+
+---
+
+### `data`
+
+**Type**: `Object`
+
+Additional data to be added to each log line.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/MemoryInfo.md b/website/versioned_docs/version-0.22.4/typedefs/MemoryInfo.md
new file mode 100644
index 000000000..a52c23056
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/MemoryInfo.md
@@ -0,0 +1,51 @@
+---
+id: version-0.22.4-memory-info
+title: MemoryInfo
+original_id: memory-info
+---
+
+<a name="memoryinfo"></a>
+
+Describes memory usage of an Actor.
+
+## Properties
+
+### `totalBytes`
+
+**Type**: `number`
+
+Total memory available in the system or container
+
+---
+
+### `freeBytes`
+
+**Type**: `number`
+
+Amount of free memory in the system or container
+
+---
+
+### `usedBytes`
+
+**Type**: `number`
+
+Amount of memory used (= totalBytes - freeBytes)
+
+---
+
+### `mainProcessBytes`
+
+**Type**: `number`
+
+Amount of memory used the current Node.js process
+
+---
+
+### `childProcessesBytes`
+
+**Type**: `number`
+
+Amount of memory used by child processes of the current Node.js process
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PlaywrightCrawlerOptions.md b/website/versioned_docs/version-0.22.4/typedefs/PlaywrightCrawlerOptions.md
new file mode 100644
index 000000000..d4765b710
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PlaywrightCrawlerOptions.md
@@ -0,0 +1,253 @@
+---
+id: version-0.22.4-playwright-crawler-options
+title: PlaywrightCrawlerOptions
+original_id: playwright-crawler-options
+---
+
+<a name="playwrightcrawleroptions"></a>
+
+## Properties
+
+### `launcher`
+
+**Type**: `object`
+
+Playwright launcher used for launching new browsers. For example: `require("playwright").chromium`
+[Playwright list of available modules](https://playwright.dev/docs/api/class-playwright)
+
+---
+
+### `handlePageFunction`
+
+**Type**: `function`
+
+Function that is called to process each request. It is passed an object with the following fields:
+
+```
+{
+ request: Request,
+ response: Response,
+ page: Page,
+ session: Session,
+ browserController: BrowserController,
+ proxyInfo: ProxyInfo,
+ crawler: PlaywrightCrawler,
+}
+```
+
+`request` is an instance of the [`Request`](../api/request) object with details about the URL to open, HTTP method etc. `page` is an instance of the
+`Playwright` [`Page`](https://playwright.dev/docs/api/class-page) `browserPool` is an instance of the
+[`BrowserPool`](https://github.com/apify/browser-pool#BrowserPool), `browserController` is an instance of the
+[`BrowserController`](https://github.com/apify/browser-pool#browsercontroller), `response` is an instance of the `Playwright`
+[`Response`](https://playwright.dev/docs/api/class-response), which is the main resource response as returned by `page.goto(request.url)`. The
+function must return a promise, which is then awaited by the crawler.
+
+If the function throws an exception, the crawler will try to re-crawl the request later, up to `option.maxRequestRetries` times. If all the retries
+fail, the crawler calls the function provided to the `handleFailedRequestFunction` parameter. To make this work, you should **always** let your
+function throw exceptions rather than catch them. The exceptions are logged to the request using the
+[`Request.pushErrorMessage()`](../api/request#pusherrormessage) function.
+
+---
+
+### `navigationTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which page navigation needs to finish, in seconds. When `gotoFunction()` is used and thus the default function is overridden, this timeout
+will not be used and needs to be configured in the new `gotoFunction()`.
+
+---
+
+### `handleFailedRequestFunction`
+
+**Type**: [`HandleFailedRequest`](../typedefs/handle-failed-request)
+
+A function to handle requests that failed more than `option.maxRequestRetries` times.
+
+The function receives the following object as an argument:
+
+```
+{
+ request: Request,
+ response: Response,
+ page: Page,
+ session: Session,
+ browserController: BrowserController,
+ proxyInfo: ProxyInfo,
+ crawler: PlaywrightCrawler,
+}
+```
+
+Where the [`Request`](../api/request) instance corresponds to the failed request, and the `Error` instance represents the last error thrown during
+processing of the request.
+
+---
+
+### `preNavigationHooks`
+
+**Type**: `Array<function()>`
+
+Async functions that are sequentially evaluated before the navigation. Good for setting additional cookies or browser properties before navigation.
+The function accepts two parameters, `crawlingContext` and `gotoOptions`, which are passed to the `gotoFunction` the crawler calls to navigate.
+Example:
+
+```
+preNavigationHooks: [
+ async (crawlingContext, gotoOptions) => {
+ await page.evaluate((attr) => { window.foo = attr; }, 'bar');
+ }
+]
+```
+
+---
+
+### `postNavigationHooks`
+
+**Type**: `Array<function()>`
+
+Async functions that are sequentially evaluated after the navigation. Good for checking if the navigation was successful. The function accepts
+`crawlingContext` as an only parameter. Example:
+
+```
+postNavigationHooks: [
+ async (crawlingContext) => {
+ const { page } = crawlingContext;
+ if (hasCaptcha(page)) {
+ await solveCaptcha (page);
+ }
+ };
+]
+```
+
+---
+
+### `launchContext`
+
+**Type**: [`PlaywrightLaunchContext`](../typedefs/playwright-launch-context)
+
+The same options as used by [`Apify.launchPlaywright()`](../api/apify#launchplaywright).
+
+---
+
+### `handlePageTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which the function passed as `handlePageFunction` needs to finish, in seconds.
+
+---
+
+### `browserPoolOptions`
+
+**Type**: `BrowserPoolOptions`
+
+Custom options passed to the underlying [`BrowserPool`](https://github.com/apify/browser-pool#BrowserPool) constructor. You can tweak those to
+fine-tune browser management.
+
+---
+
+### `persistCookiesPerSession`
+
+**Type**: `boolean` <code> = false</code>
+
+Automatically saves cookies to Session. Works only if Session Pool is used.
+
+---
+
+### `proxyConfiguration`
+
+**Type**: [`ProxyConfiguration`](../api/proxy-configuration)
+
+If set, `PlaywrightCrawler` will be configured for all connections to use [Apify Proxy](https://my.apify.com/proxy) or your own Proxy URLs provided
+and rotated according to the configuration. For more information, see the [documentation](https://docs.apify.com/proxy).
+
+---
+
+### `requestList`
+
+**Type**: [`RequestList`](../api/request-list)
+
+Static list of URLs to be processed. Either `requestList` or `requestQueue` option must be provided (or both).
+
+---
+
+### `requestQueue`
+
+**Type**: [`RequestQueue`](../api/request-queue)
+
+Dynamic queue of URLs to be processed. This is useful for recursive crawling of websites. Either `requestList` or `requestQueue` option must be
+provided (or both).
+
+---
+
+### `handleRequestTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which the function passed as `handleRequestFunction` needs to finish, in seconds.
+
+---
+
+### `maxRequestRetries`
+
+**Type**: `number` <code> = 3</code>
+
+Indicates how many times the request is retried if
+[`PuppeteerCrawlerOptions.handlePageFunction`](../typedefs/puppeteer-crawler-options#handlepagefunction) fails.
+
+---
+
+### `maxRequestsPerCrawl`
+
+**Type**: `number`
+
+Maximum number of pages that the crawler will open. The crawl will stop when this limit is reached. Always set this value in order to prevent infinite
+loops in misconfigured crawlers. Note that in cases of parallel crawling, the actual number of pages visited might be slightly higher than this value.
+
+---
+
+### `autoscaledPoolOptions`
+
+**Type**: [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options)
+
+Custom options passed to the underlying [`AutoscaledPool`](../api/autoscaled-pool) constructor. Note that the `runTaskFunction` and
+`isTaskReadyFunction` options are provided by `BasicCrawler` and cannot be overridden. However, you can provide a custom implementation of
+`isFinishedFunction`.
+
+---
+
+### `minConcurrency`
+
+**Type**: `number` <code> = 1</code>
+
+Sets the minimum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+_WARNING:_ If you set this value too high with respect to the available system memory and CPU, your crawler will run extremely slow or crash. If
+you're not sure, just keep the default value and the concurrency will scale up automatically.
+
+---
+
+### `maxConcurrency`
+
+**Type**: `number` <code> = 1000</code>
+
+Sets the maximum concurrency (parallelism) for the crawl. Shortcut to the corresponding [`AutoscaledPool`](../api/autoscaled-pool) option.
+
+---
+
+### `useSessionPool`
+
+**Type**: `boolean` <code> = false</code>
+
+If set to true. Basic crawler will initialize the [`SessionPool`](../api/session-pool) with the corresponding `sessionPoolOptions`. The session
+instance will be than available in the `handleRequestFunction`.
+
+---
+
+### `sessionPoolOptions`
+
+**Type**: [`SessionPoolOptions`](../typedefs/session-pool-options)
+
+The configuration options for [`SessionPool`](../api/session-pool) to use.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PlaywrightLaunchContext.md b/website/versioned_docs/version-0.22.4/typedefs/PlaywrightLaunchContext.md
new file mode 100644
index 000000000..df5fd461a
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PlaywrightLaunchContext.md
@@ -0,0 +1,49 @@
+---
+id: version-0.22.4-playwright-launch-context
+title: PlaywrightLaunchContext
+original_id: playwright-launch-context
+---
+
+<a name="playwrightlaunchcontext"></a>
+
+Apify extends the launch options of Playwright. You can use any of the Playwright compatible
+[`LaunchOptions`](https://playwright.dev/docs/api/class-browsertype#browsertypelaunchoptions) options by providing the `launchOptions` property.
+
+## Properties
+
+### `launchOptions`
+
+**Type**: `object`
+
+`browserType.launch` [options](https://playwright.dev/docs/api/class-browsertype?_highlight=launch#browsertypelaunchoptions)
+
+---
+
+### `proxyUrl`
+
+**Type**: `string`
+
+URL to a HTTP proxy server. It must define the port number, and it may also contain proxy username and password.
+
+Example: `http://bob:[email protected]:1234`.
+
+---
+
+### `useChrome`
+
+**Type**: `boolean` <code> = false</code>
+
+If `true` and `executablePath` is not set, Puppeteer will launch full Google Chrome browser available on the machine rather than the bundled Chromium.
+The path to Chrome executable is taken from the `APIFY_CHROME_EXECUTABLE_PATH` environment variable if provided, or defaults to the typical Google
+Chrome executable location specific for the operating system. By default, this option is `false`.
+
+---
+
+### `launcher`
+
+**Type**: `string` | `Object`
+
+By default this function uses
+require("playwright").chromium`. If you want to use a different browser you can pass it by this property as`require("playwright").firefox
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PostResponse.md b/website/versioned_docs/version-0.22.4/typedefs/PostResponse.md
new file mode 100644
index 000000000..d48524069
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PostResponse.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-post-response
+title: PostResponse
+original_id: post-response
+---
+
+<a name="postresponse"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`PostResponseInputs`](../typedefs/post-response-inputs) - Arguments passed to this callback.
+
+**Returns**:
+
+`void` \| `Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PostResponseInputs.md b/website/versioned_docs/version-0.22.4/typedefs/PostResponseInputs.md
new file mode 100644
index 000000000..298eaa7bb
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PostResponseInputs.md
@@ -0,0 +1,47 @@
+---
+id: version-0.22.4-post-response-inputs
+title: PostResponseInputs
+original_id: post-response-inputs
+---
+
+<a name="postresponseinputs"></a>
+
+## Properties
+
+### `response`
+
+**Type**: `IncomingMessage` | `Readable`
+
+stream
+
+---
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+Original instance fo the {Request} object. Must be modified in-place.
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+---
+
+### `session`
+
+**Type**: [`Session`](../api/session)
+
+The current session
+
+---
+
+### `proxyInfo`
+
+**Type**: [`ProxyInfo`](../typedefs/proxy-info)
+
+An object with information about currently used proxy by the crawler and configured by the [`ProxyConfiguration`](../api/proxy-configuration) class.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PrepareRequest.md b/website/versioned_docs/version-0.22.4/typedefs/PrepareRequest.md
new file mode 100644
index 000000000..91cccaf74
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PrepareRequest.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-prepare-request
+title: PrepareRequest
+original_id: prepare-request
+---
+
+<a name="preparerequest"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`PrepareRequestInputs`](../typedefs/prepare-request-inputs) - Arguments passed to this callback.
+
+**Returns**:
+
+`void` \| `Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PrepareRequestInputs.md b/website/versioned_docs/version-0.22.4/typedefs/PrepareRequestInputs.md
new file mode 100644
index 000000000..4854c9755
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PrepareRequestInputs.md
@@ -0,0 +1,39 @@
+---
+id: version-0.22.4-prepare-request-inputs
+title: PrepareRequestInputs
+original_id: prepare-request-inputs
+---
+
+<a name="preparerequestinputs"></a>
+
+## Properties
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+Original instance fo the {Request} object. Must be modified in-place.
+
+---
+
+### `session`
+
+**Type**: [`Session`](../api/session)
+
+The current session
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+---
+
+### `proxyInfo`
+
+**Type**: [`ProxyInfo`](../typedefs/proxy-info)
+
+An object with information about currently used proxy by the crawler and configured by the [`ProxyConfiguration`](../api/proxy-configuration) class.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/ProxyConfigurationOptions.md b/website/versioned_docs/version-0.22.4/typedefs/ProxyConfigurationOptions.md
new file mode 100644
index 000000000..d66af0b63
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/ProxyConfigurationOptions.md
@@ -0,0 +1,77 @@
+---
+id: version-0.22.4-proxy-configuration-options
+title: ProxyConfigurationOptions
+original_id: proxy-configuration-options
+---
+
+<a name="proxyconfigurationoptions"></a>
+
+## Properties
+
+### `password`
+
+**Type**: `string`
+
+User's password for the proxy. By default, it is taken from the `APIFY_PROXY_PASSWORD` environment variable, which is automatically set by the system
+when running the actors.
+
+---
+
+### `groups`
+
+**Type**: `Array<string>`
+
+An array of proxy groups to be used by the [Apify Proxy](https://docs.apify.com/proxy). If not provided, the proxy will select the groups
+automatically.
+
+---
+
+### `countryCode`
+
+**Type**: `string`
+
+If set and relevant proxies are available in your Apify account, all proxied requests will use IP addresses that are geolocated to the specified
+country. For example `GB` for IPs from Great Britain. Note that online services often have their own rules for handling geolocation and thus the
+country selection is a best attempt at geolocation, rather than a guaranteed hit. This parameter is optional, by default, each proxied request is
+assigned an IP address from a random country. The country code needs to be a two letter ISO country code. See the
+[full list of available country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). This parameter is
+optional, by default, the proxy uses all available proxy servers from all countries. on the Apify cloud, or when using the
+[Apify CLI](https://github.com/apify/apify-cli).
+
+---
+
+### `apifyProxyGroups`
+
+**Type**: `Array<string>`
+
+Same option as `groups` which can be used to configurate the proxy by UI input schema. You should use the `groups` option in your crawler code.
+
+---
+
+### `apifyProxyCountry`
+
+**Type**: `string`
+
+Same option as `countryCode` which can be used to configurate the proxy by UI input schema. You should use the `countryCode` option in your crawler
+code.
+
+---
+
+### `proxyUrls`
+
+**Type**: `Array<string>`
+
+An array of custom proxy URLs to be rotated. Custom proxies are not compatible with Apify Proxy and an attempt to use both configuration options will
+cause an error to be thrown on initialize.
+
+---
+
+### `newUrlFunction`
+
+**Type**: `function`
+
+Custom function that allows you to generate the new proxy URL dynamically. It gets the `sessionId` as a parameter and should always return stringified
+proxy URL. This function is used to generate the URL when [`ProxyConfiguration.newUrl`](../api/proxy-configuration#newurl) or
+[`ProxyConfiguration.newProxyInfo`](../api/proxy-configuration#newproxyinfo) is called.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/ProxyInfo.md b/website/versioned_docs/version-0.22.4/typedefs/ProxyInfo.md
new file mode 100644
index 000000000..88fc80d6f
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/ProxyInfo.md
@@ -0,0 +1,102 @@
+---
+id: version-0.22.4-proxy-info
+title: ProxyInfo
+original_id: proxy-info
+---
+
+<a name="proxyinfo"></a>
+
+The main purpose of the ProxyInfo object is to provide information about the current proxy connection used by the crawler for the request. Outside of
+crawlers, you can get this object by calling [`ProxyConfiguration.newProxyInfo`](../api/proxy-configuration#newproxyinfo).
+
+**Example usage:**
+
+```javascript
+
+const proxyConfiguration = await Apify.createProxyConfiguration({
+ groups: ['GROUP1', 'GROUP2'] // List of Apify Proxy groups
+ countryCode: 'US',
+});
+
+// Getting proxyInfo object by calling class method directly
+const proxyInfo = proxyConfiguration.newProxyInfo();
+
+// In crawler
+const crawler = new Apify.CheerioCrawler({
+ // ...
+ proxyConfiguration,
+ handlePageFunction: ({ proxyInfo }) => {
+ // Getting used proxy URL
+ const proxyUrl = proxyInfo.url;
+
+ // Getting ID of used Session
+ const sessionIdentifier = proxyInfo.sessionId;
+ }
+})
+
+```
+
+## Properties
+
+### `sessionId`
+
+**Type**: `string`
+
+The identifier of used [`Session`](../api/session), if used.
+
+---
+
+### `url`
+
+**Type**: `string`
+
+The URL of the proxy.
+
+---
+
+### `groups`
+
+**Type**: `Array<string>`
+
+An array of proxy groups to be used by the [Apify Proxy](https://docs.apify.com/proxy). If not provided, the proxy will select the groups
+automatically.
+
+---
+
+### `countryCode`
+
+**Type**: `string`
+
+If set and relevant proxies are available in your Apify account, all proxied requests will use IP addresses that are geolocated to the specified
+country. For example `GB` for IPs from Great Britain. Note that online services often have their own rules for handling geolocation and thus the
+country selection is a best attempt at geolocation, rather than a guaranteed hit. This parameter is optional, by default, each proxied request is
+assigned an IP address from a random country. The country code needs to be a two letter ISO country code. See the
+[full list of available country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). This parameter is
+optional, by default, the proxy uses all available proxy servers from all countries.
+
+---
+
+### `password`
+
+**Type**: `string`
+
+User's password for the proxy. By default, it is taken from the `APIFY_PROXY_PASSWORD` environment variable, which is automatically set by the system
+when running the actors on the Apify cloud, or when using the [Apify CLI](https://github.com/apify/apify-cli).
+
+---
+
+### `hostname`
+
+**Type**: `string`
+
+Hostname of your proxy.
+
+---
+
+### `port`
+
+**Type**: `string`
+
+Proxy port.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PuppeteerCrawlerOptions.md b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerCrawlerOptions.md
new file mode 100644
index 000000000..ac6d76082
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerCrawlerOptions.md
@@ -0,0 +1,225 @@
+---
+id: version-0.22.4-puppeteer-crawler-options
+title: PuppeteerCrawlerOptions
+original_id: puppeteer-crawler-options
+---
+
+<a name="puppeteercrawleroptions"></a>
+
+## Properties
+
+### `handlePageFunction`
+
+**Type**: [`PuppeteerHandlePage`](../typedefs/puppeteer-handle-page)
+
+Function that is called to process each request. It is passed an object with the following fields:
+
+```
+{
+ request: Request,
+ response: Response,
+ page: Page,
+ puppeteerPool: PuppeteerPool,
+ autoscaledPool: AutoscaledPool,
+ session: Session,
+ proxyInfo: ProxyInfo,
+}
+```
+
+`request` is an instance of the [`Request`](../api/request) object with details about the URL to open, HTTP method etc. `page` is an instance of the
+`Puppeteer` [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page) `response` is an instance of the `Puppeteer`
+[`Response`](https://pptr.dev/#?product=Puppeteer&show=api-class-response), which is the main resource response as returned by
+`page.goto(request.url)`. `puppeteerPool` is an instance of the [`PuppeteerPool`](../api/puppeteer-pool) used by this `PuppeteerCrawler`.
+
+The function must return a promise, which is then awaited by the crawler.
+
+If the function throws an exception, the crawler will try to re-crawl the request later, up to `option.maxRequestRetries` times. If all the retries
+fail, the crawler calls the function provided to the `handleFailedRequestFunction` parameter. To make this work, you should **always** let your
+function throw exceptions rather than catch them. The exceptions are logged to the request using the
+[`Request.pushErrorMessage()`](../api/request#pusherrormessage) function.
+
+---
+
+### `requestList`
+
+**Type**: [`RequestList`](../api/request-list)
+
+Static list of URLs to be processed. Either `requestList` or `requestQueue` option must be provided (or both).
+
+---
+
+### `requestQueue`
+
+**Type**: [`RequestQueue`](../api/request-queue)
+
+Dynamic queue of URLs to be processed. This is useful for recursive crawling of websites. Either `requestList` or `requestQueue` option must be
+provided (or both).
+
+---
+
+### `handlePageTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which the function passed as `handlePageFunction` needs to finish, in seconds.
+
+---
+
+### `gotoFunction`
+
+**Type**: [`PuppeteerGoto`](../typedefs/puppeteer-goto)
+
+Overrides the function that opens the page in Puppeteer. The function should return the result of Puppeteer's
+[page.goto()](https://pptr.dev/#?product=Puppeteer&show=api-pagegotourl-options) function, i.e. a `Promise` resolving to the
+[Response](https://pptr.dev/#?product=Puppeteer&show=api-class-httpresponse) object.
+
+This is useful if you need to select different criteria to determine navigation success and also to do any pre or post processing such as injecting
+cookies into the page.
+
+Note that a single page object is only used to process a single request and it is closed afterwards.
+
+By default, the function invokes [`puppeteer.gotoExtended()`](../api/puppeteer#gotoextended) with a timeout of 60 seconds.
+
+---
+
+### `gotoTimeoutSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Timeout in which page navigation needs to finish, in seconds. When `gotoFunction()` is used and thus the default function is overridden, this timeout
+will not be used and needs to be configured in the new `gotoFunction()`.
+
+---
+
+### `handleFailedRequestFunction`
+
+**Type**: [`HandleFailedRequest`](../typedefs/handle-failed-request)
+
+A function to handle requests that failed more than `option.maxRequestRetries` times.
+
+The function receives the following object as an argument:
+
+```
+{
+ error: Error,
+ request: Request,
+ response: Response,
+ page: Page,
+ puppeteerPool: PuppeteerPool,
+ autoscaledPool: AutoscaledPool,
+ session: Session,
+ proxyInfo: ProxyInfo,
+}
+```
+
+Where the [`Request`](../api/request) instance corresponds to the failed request, and the `Error` instance represents the last error thrown during
+processing of the request.
+
+---
+
+### `maxRequestRetries`
+
+**Type**: `number` <code> = 3</code>
+
+Indicates how many times the request is retried if either `handlePageFunction()` or `gotoFunction()` fails.
+
+---
+
+### `maxRequestsPerCrawl`
+
+**Type**: `number`
+
+Maximum number of pages that the crawler will open. The crawl will stop when this limit is reached. Always set this value in order to prevent infinite
+loops in misconfigured crawlers. Note that in cases of parallel crawling, the actual number of pages visited might be slightly higher than this value.
+
+---
+
+### `puppeteerPoolOptions`
+
+**Type**: [`PuppeteerPoolOptions`](../typedefs/puppeteer-pool-options)
+
+Custom options passed to the underlying [`PuppeteerPool`](../api/puppeteer-pool) constructor. You can tweak those to fine-tune browser management.
+
+---
+
+### `launchPuppeteerFunction`
+
+**Type**: [`LaunchPuppeteerFunction`](../typedefs/launch-puppeteer-function)
+
+Overrides the default function to launch a new Puppeteer instance. Shortcut to the corresponding [`PuppeteerPool`](../api/puppeteer-pool) option. See
+source code on [GitHub](https://github.com/apify/apify-js/blob/master/src/puppeteer_pool.js#L28) for default behavior.
+
+---
+
+### `launchPuppeteerOptions`
+
+**Type**: [`LaunchPuppeteerOptions`](../typedefs/launch-puppeteer-options)
+
+Options used by [`Apify.launchPuppeteer()`](../api/apify#launchpuppeteer) to start new Puppeteer instances. Shortcut to the corresponding
+[`PuppeteerPool`](../api/puppeteer-pool) option.
+
+---
+
+### `autoscaledPoolOptions`
+
+**Type**: [`AutoscaledPoolOptions`](../typedefs/autoscaled-pool-options)
+
+Custom options passed to the underlying [`AutoscaledPool`](../api/autoscaled-pool) instance constructor. Note that the `runTaskFunction`,
+`isTaskReadyFunction` and `isFinishedFunction` options are provided by `PuppeteerCrawler` and should not be overridden.
+
+---
+
+### `minConcurrency`
+
+**Type**: `number` <code> = 1</code>
+
+Sets the minimum concurrency (parallelism) for the crawl. Shortcut to the corresponding
+[`AutoscaledPoolOptions.minConcurrency`](../typedefs/autoscaled-pool-options#minconcurrency) option.
+
+_WARNING:_ If you set this value too high with respect to the available system memory and CPU, your crawler will run extremely slow or crash. If
+you're not sure, just keep the default value and the concurrency will scale up automatically.
+
+---
+
+### `maxConcurrency`
+
+**Type**: `number` <code> = 1000</code>
+
+Sets the maximum concurrency (parallelism) for the crawl. Shortcut to the corresponding
+[`AutoscaledPoolOptions.maxConcurrency`](../typedefs/autoscaled-pool-options#maxconcurrency) option.
+
+---
+
+### `useSessionPool`
+
+**Type**: `boolean` <code> = false</code>
+
+If set to true Crawler will automatically use Session Pool. It will automatically retire sessions on 403, 401 and 429 status codes. It also marks
+Session as bad after a request timeout.
+
+---
+
+### `sessionPoolOptions`
+
+**Type**: [`SessionPoolOptions`](../typedefs/session-pool-options)
+
+Custom options passed to the underlying [`SessionPool`](../api/session-pool) constructor.
+
+---
+
+### `persistCookiesPerSession`
+
+**Type**: `boolean` <code> = false</code>
+
+Automatically saves cookies to Session. Works only if Session Pool is used.
+
+---
+
+### `proxyConfiguration`
+
+**Type**: [`ProxyConfiguration`](../api/proxy-configuration)
+
+If set, `PuppeteerCrawler` will be configured for all connections to use [Apify Proxy](https://my.apify.com/proxy) or your own Proxy URLs provided and
+rotated according to the configuration. For more information, see the [documentation](https://docs.apify.com/proxy).
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PuppeteerGoto.md b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerGoto.md
new file mode 100644
index 000000000..81fb3af03
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerGoto.md
@@ -0,0 +1,18 @@
+---
+id: version-0.22.4-puppeteer-goto
+title: PuppeteerGoto
+original_id: puppeteer-goto
+---
+
+<a name="puppeteergoto"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`PuppeteerGotoInputs`](../typedefs/puppeteer-goto-inputs) - Arguments passed to this callback.
+
+**Returns**:
+
+`Promise<(PuppeteerResponse|null)>` - An instance of the Puppeteer [`Response`](https://pptr.dev/#?product=Puppeteer&show=api-class-response), which
+is the main resource response as returned by `page.goto(request.url)`.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PuppeteerGotoInputs.md b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerGotoInputs.md
new file mode 100644
index 000000000..9d54e8791
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerGotoInputs.md
@@ -0,0 +1,57 @@
+---
+id: version-0.22.4-puppeteer-goto-inputs
+title: PuppeteerGotoInputs
+original_id: puppeteer-goto-inputs
+---
+
+<a name="puppeteergotoinputs"></a>
+
+## Properties
+
+### `page`
+
+**Type**: `PuppeteerPage`
+
+is an instance of the Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page)
+
+---
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+An instance of the [`Request`](../api/request) object with details about the URL to open, HTTP method etc.
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+An instance of the `AutoscaledPool`.
+
+---
+
+### `puppeteerPool`
+
+**Type**: [`PuppeteerPool`](../api/puppeteer-pool)
+
+An instance of the [`PuppeteerPool`](../api/puppeteer-pool) used by this `PuppeteerCrawler`.
+
+---
+
+### `session`
+
+**Type**: [`Session`](../api/session)
+
+`Session` object for this request.
+
+---
+
+### `proxyInfo`
+
+**Type**: [`ProxyInfo`](../typedefs/proxy-info)
+
+Proxy info object
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PuppeteerHandlePage.md b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerHandlePage.md
new file mode 100644
index 000000000..7b8d238a9
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerHandlePage.md
@@ -0,0 +1,17 @@
+---
+id: version-0.22.4-puppeteer-handle-page
+title: PuppeteerHandlePage
+original_id: puppeteer-handle-page
+---
+
+<a name="puppeteerhandlepage"></a>
+
+**Parameters**:
+
+- **`inputs`**: [`PuppeteerHandlePageInputs`](../typedefs/puppeteer-handle-page-inputs) - Arguments passed to this callback.
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PuppeteerHandlePageInputs.md b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerHandlePageInputs.md
new file mode 100644
index 000000000..ab09001fe
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerHandlePageInputs.md
@@ -0,0 +1,65 @@
+---
+id: version-0.22.4-puppeteer-handle-page-inputs
+title: PuppeteerHandlePageInputs
+original_id: puppeteer-handle-page-inputs
+---
+
+<a name="puppeteerhandlepageinputs"></a>
+
+## Properties
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+An instance of the [`Request`](../api/request) object with details about the URL to open, HTTP method etc.
+
+---
+
+### `response`
+
+**Type**: `PuppeteerResponse`
+
+An instance of the Puppeteer [`Response`](https://pptr.dev/#?product=Puppeteer&show=api-class-response), which is the main resource response as
+returned by `page.goto(request.url)`.
+
+---
+
+### `page`
+
+**Type**: `PuppeteerPage`
+
+is an instance of the Puppeteer [`Page`](https://pptr.dev/#?product=Puppeteer&show=api-class-page)
+
+---
+
+### `puppeteerPool`
+
+**Type**: [`PuppeteerPool`](../api/puppeteer-pool)
+
+An instance of the [`PuppeteerPool`](../api/puppeteer-pool) used by this `PuppeteerCrawler`.
+
+---
+
+### `autoscaledPool`
+
+**Type**: [`AutoscaledPool`](../api/autoscaled-pool)
+
+A reference to the underlying [`AutoscaledPool`](../api/autoscaled-pool) class that manages the concurrency of the crawler. Note that this property is
+only initialized after calling the [`PuppeteerCrawler.run()`](../api/puppeteer-crawler#run) function. You can use it to change the concurrency
+settings on the fly, to pause the crawler by calling [`AutoscaledPool.pause()`](../api/autoscaled-pool#pause) or to abort it by calling
+[`AutoscaledPool.abort()`](../api/autoscaled-pool#abort).
+
+---
+
+### `session`
+
+**Type**: [`Session`](../api/session)
+
+---
+
+### `proxyInfo`
+
+**Type**: [`ProxyInfo`](../typedefs/proxy-info)
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PuppeteerLaunchContext.md b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerLaunchContext.md
new file mode 100644
index 000000000..83ad6f298
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerLaunchContext.md
@@ -0,0 +1,78 @@
+---
+id: version-0.22.4-puppeteer-launch-context
+title: PuppeteerLaunchContext
+original_id: puppeteer-launch-context
+---
+
+<a name="puppeteerlaunchcontext"></a>
+
+Apify extends the launch options of Puppeteer. You can use any of the Puppeteer compatible
+[`LaunchOptions`](https://pptr.dev/#?product=Puppeteer&show=api-puppeteerlaunchoptions) options by providing the `launchOptions` property.
+
+## Properties
+
+### `launchOptions`
+
+**Type**: `object`
+
+`puppeteer.launch` [options](https://pptr.dev/#?product=Puppeteer&version=v5.5.0&show=api-puppeteerlaunchoptions)
+
+---
+
+### `proxyUrl`
+
+**Type**: `string`
+
+URL to a HTTP proxy server. It must define the port number, and it may also contain proxy username and password.
+
+Example: `http://bob:[email protected]:1234`.
+
+---
+
+### `userAgent`
+
+**Type**: `string`
+
+The `User-Agent` HTTP header used by the browser. If not provided, the function sets `User-Agent` to a reasonable default to reduce the chance of
+detection of the crawler.
+
+---
+
+### `useChrome`
+
+**Type**: `boolean` <code> = false</code>
+
+If `true` and `executablePath` is not set, Puppeteer will launch full Google Chrome browser available on the machine rather than the bundled Chromium.
+The path to Chrome executable is taken from the `APIFY_CHROME_EXECUTABLE_PATH` environment variable if provided, or defaults to the typical Google
+Chrome executable location specific for the operating system. By default, this option is `false`.
+
+---
+
+### `launcher`
+
+**Type**: `string` | `Object`
+
+Either a require path (`string`) to a package to be used instead of default `puppeteer`, or an already required module (`Object`). This enables usage
+of various Puppeteer wrappers such as `puppeteer-extra`.
+
+Take caution, because it can cause all kinds of unexpected errors and weird behavior. Apify SDK is not tested with any other library besides
+`puppeteer` itself.
+
+---
+
+### `stealth`
+
+**Type**: `boolean`
+
+This setting hides most of the known properties that identify headless Chrome and makes it nearly undetectable. It is recommended to use it together
+with the `useChrome` set to `true`.
+
+---
+
+### `stealthOptions`
+
+**Type**: [`StealthOptions`](../typedefs/stealth-options)
+
+Using this configuration, you can disable some of the hiding tricks. For these settings to take effect `stealth` must be set to true
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/PuppeteerPoolOptions.md b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerPoolOptions.md
new file mode 100644
index 000000000..4ea8b1d81
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/PuppeteerPoolOptions.md
@@ -0,0 +1,143 @@
+---
+id: version-0.22.4-puppeteer-pool-options
+title: PuppeteerPoolOptions
+original_id: puppeteer-pool-options
+---
+
+<a name="puppeteerpooloptions"></a>
+
+## Properties
+
+### `maxOpenPagesPerInstance`
+
+**Type**: `number` <code> = 50</code>
+
+Maximum number of open pages (i.e. tabs) per browser. When this limit is reached, new pages are loaded in a new browser instance.
+
+---
+
+### `retireInstanceAfterRequestCount`
+
+**Type**: `number` <code> = 100</code>
+
+Maximum number of requests that can be processed by a single browser instance. After the limit is reached, the browser is retired and new requests are
+handled by a new browser instance.
+
+---
+
+### `puppeteerOperationTimeoutSecs`
+
+**Type**: `number` <code> = 15</code>
+
+All browser management operations such as launching a new browser, opening a new page or closing a page will timeout after the set number of seconds
+and the connected browser will be retired.
+
+---
+
+### `instanceKillerIntervalSecs`
+
+**Type**: `number` <code> = 60</code>
+
+Indicates how often are the open Puppeteer instances checked whether they can be closed.
+
+---
+
+### `killInstanceAfterSecs`
+
+**Type**: `number` <code> = 300</code>
+
+When Puppeteer instance reaches the `retireInstanceAfterRequestCount` limit then it is considered retired and no more tabs will be opened. After the
+last tab is closed the whole browser is closed too. This parameter defines a time limit between the last tab was opened and before the browser is
+closed even if there are pending open tabs.
+
+---
+
+### `launchPuppeteerFunction`
+
+**Type**: [`LaunchPuppeteerFunction`](../typedefs/launch-puppeteer-function)
+
+Overrides the default function to launch a new Puppeteer instance. It must return a promise resolving to
+[`Browser`](https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#class-browser) instance.
+
+The function receives one parameter that includes launch options, such as `proxyUrl` and other options generated by the `PuppeteerPool` instance. You
+can extend or update this options object, but you must not ignore it.
+
+**Correct:**
+
+```javascript
+async function launchPuppeteerFunction(options) {
+ const newOpts = {
+ ...options,
+ foo: 'bar',
+ };
+
+ // do some other things
+
+ return Apify.launchPuppeteer(newOpts);
+}
+```
+
+**Incorrect:**
+
+```javascript
+async function launchPuppeteerFunction() {
+ const opts = {
+ foo: 'bar',
+ };
+ // Because we ignored the options, correct parameters
+ // will not make it to the browser. Eg. this prevents
+ // proxyConfiguration from working correctly.
+ return Apify.launchPuppeteer(opts);
+}
+```
+
+---
+
+### `launchPuppeteerOptions`
+
+**Type**: [`LaunchPuppeteerOptions`](../typedefs/launch-puppeteer-options)
+
+Options used by [`Apify.launchPuppeteer()`](../api/apify#launchpuppeteer) to start new Puppeteer instances.
+
+---
+
+### `recycleDiskCache`
+
+**Type**: `boolean` <code> = false</code>
+
+Enables recycling of disk cache directories by Chrome instances. When a browser instance is closed, its disk cache directory is not deleted but it's
+used by a newly opened browser instance. This is useful to reduce amount of data that needs to be downloaded to speed up crawling and reduce proxy
+usage. Note that the new browser starts with empty cookies, local storage etc. so this setting doesn't affect anonymity of your crawler.
+
+Beware that the disk cache directories can consume a lot of disk space. To limit the space consumed, you can pass the `--disk-cache-size=X` argument
+to `launchPuppeteer` `args`, where `X` is the approximate maximum number of bytes for disk cache.
+
+Do not use the `recycleDiskCache` setting together with `--disk-cache-dir` argument in `launchPuppeteer` `args`, the behavior is undefined.
+
+---
+
+### `useIncognitoPages`
+
+**Type**: `boolean`
+
+With this option selected, all pages will be opened in a new incognito browser context, which means that they will not share cookies or cache and
+their resources will not be throttled by one another.
+
+---
+
+### `sessionPool`
+
+**Type**: [`SessionPool`](../api/session-pool)
+
+A pool of Session instances.
+
+---
+
+### `proxyConfiguration`
+
+**Type**: [`ProxyConfiguration`](../api/proxy-configuration)
+
+If set, `PuppeteerPool` will be configured for all connections to use [Apify Proxy](https://my.apify.com/proxy) or your own Proxy URLs provided and
+rotated according to the configuration. For more information, see the [documentation](https://docs.apify.com/proxy).
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/QueueOperationInfo.md b/website/versioned_docs/version-0.22.4/typedefs/QueueOperationInfo.md
new file mode 100644
index 000000000..e9af91137
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/QueueOperationInfo.md
@@ -0,0 +1,44 @@
+---
+id: version-0.22.4-queue-operation-info
+title: QueueOperationInfo
+original_id: queue-operation-info
+---
+
+<a name="queueoperationinfo"></a>
+
+A helper class that is used to report results from various [`RequestQueue`](../api/request-queue) functions as well as
+[`utils.enqueueLinks()`](../api/utils#enqueuelinks).
+
+## Properties
+
+### `wasAlreadyPresent`
+
+**Type**: `boolean`
+
+Indicates if request was already present in the queue.
+
+---
+
+### `wasAlreadyHandled`
+
+**Type**: `boolean`
+
+Indicates if request was already marked as handled.
+
+---
+
+### `requestId`
+
+**Type**: `string`
+
+The ID of the added request
+
+---
+
+### `request`
+
+**Type**: [`Request`](../api/request)
+
+The original [`Request`](../api/request) object passed to the `RequestQueue` function.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/RequestAsBrowserOptions.md b/website/versioned_docs/version-0.22.4/typedefs/RequestAsBrowserOptions.md
new file mode 100644
index 000000000..246ac75df
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/RequestAsBrowserOptions.md
@@ -0,0 +1,103 @@
+---
+id: version-0.22.4-request-as-browser-options
+title: RequestAsBrowserOptions
+original_id: request-as-browser-options
+---
+
+<a name="requestasbrowseroptions"></a>
+
+## Properties
+
+### `url`
+
+**Type**: `string`
+
+URL of the target endpoint. Supports both HTTP and HTTPS schemes.
+
+---
+
+### `method`
+
+**Type**: `string` <code> = &quot;GET&quot;</code>
+
+HTTP method.
+
+---
+
+### `headers`
+
+**Type**: `Object`
+
+Additional HTTP headers to add. It's only recommended to use this option, with headers that are typically added by websites, such as cookies.
+Overriding default browser headers will remove the masking this function provides.
+
+---
+
+### `proxyUrl`
+
+**Type**: `string`
+
+An HTTP proxy to be passed down to the HTTP request. Supports proxy authentication with Basic Auth.
+
+---
+
+### `languageCode`
+
+**Type**: `string` <code> = &quot;en&quot;</code>
+
+Two-letter ISO 639 language code.
+
+---
+
+### `countryCode`
+
+**Type**: `string` <code> = &quot;US&quot;</code>
+
+Two-letter ISO 3166 country code.
+
+---
+
+### `useMobileVersion`
+
+**Type**: `boolean`
+
+If `true`, the function uses User-Agent of a mobile browser.
+
+---
+
+### `ignoreSslErrors`
+
+**Type**: `boolean` <code> = true</code>
+
+If set to true, SSL/TLS certificate errors will be ignored.
+
+---
+
+### `useInsecureHttpParser`
+
+**Type**: `boolean` <code> = true</code>
+
+Node.js' HTTP parser is stricter than parsers used by web browsers, which prevents scraping of websites whose servers do not comply with HTTP specs,
+either by accident or due to some anti-scraping protections, causing e.g. the `invalid header value char` error. The `useInsecureHttpParser` option
+forces the HTTP parser to ignore certain errors which lets you scrape such websites. However, it will also open your application to some security
+vulnerabilities, although the risk should be negligible as these vulnerabilities mainly relate to server applications, not clients. Learn more in this
+[blog post](https://snyk.io/blog/node-js-release-fixes-a-critical-http-security-vulnerability/).
+
+---
+
+### `abortFunction`
+
+**Type**: [`AbortFunction`](../typedefs/abort-function)
+
+Function accepts `response` object as a single parameter and should return true or false. If function returns true request gets aborted. This function
+is passed to the [@apify/http-request](https://www.npmjs.com/package/@apify/http-request) NPM package.
+
+---
+
+### `useHttp2`
+
+**Type**: `boolean` <code> = false</code>
+
+If set to true, it will additionally accept HTTP2 requests. It will choose either HTTP/1.1 or HTTP/2 depending on the ALPN protocol.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/RequestListOptions.md b/website/versioned_docs/version-0.22.4/typedefs/RequestListOptions.md
new file mode 100644
index 000000000..13e19ed18
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/RequestListOptions.md
@@ -0,0 +1,152 @@
+---
+id: version-0.22.4-request-list-options
+title: RequestListOptions
+original_id: request-list-options
+---
+
+<a name="requestlistoptions"></a>
+
+## Properties
+
+### `sources`
+
+**Type**: [`Array<(RequestOptions|Request|string)>`](../typedefs/request-options)
+
+An array of sources of URLs for the [`RequestList`](../api/request-list). It can be either an array of strings, plain objects that define at least the
+`url` property, or an array of [`Request`](../api/request) instances.
+
+**IMPORTANT:** The `sources` array will be consumed (left empty) after `RequestList` initializes. This is a measure to prevent memory leaks in
+situations when millions of sources are added.
+
+Additionally, the `requestsFromUrl` property may be used instead of `url`, which will instruct `RequestList` to download the source URLs from a given
+remote location. The URLs will be parsed from the received response.
+
+```
+[
+ // A single URL
+ 'http://example.com/a/b',
+
+ // Modify Request options
+ { method: PUT, 'https://example.com/put, payload: { foo: 'bar' }}
+
+ // Batch import of URLs from a file hosted on the web,
+ // where the URLs should be requested using the HTTP POST request
+ { method: 'POST', requestsFromUrl: 'http://example.com/urls.txt' },
+
+ // Batch import from remote file, using a specific regular expression to extract the URLs.
+ { requestsFromUrl: 'http://example.com/urls.txt', regex: /https:\/\/example.com\/.+/ },
+
+ // Get list of URLs from a Google Sheets document. Just add "/gviz/tq?tqx=out:csv" to the Google Sheet URL.
+ // For details, see https://help.apify.com/en/articles/2906022-scraping-a-list-of-urls-from-a-google-sheets-document
+ { requestsFromUrl: 'https://docs.google.com/spreadsheets/d/1GA5sSQhQjB_REes8I5IKg31S-TuRcznWOPjcpNqtxmU/gviz/tq?tqx=out:csv' }
+]
+```
+
+---
+
+### `sourcesFunction`
+
+**Type**: `function`
+
+A function that will be called to get the sources for the `RequestList`, but only if `RequestList` was not able to fetch their persisted version (see
+[`RequestListOptions.persistRequestsKey`](../typedefs/request-list-options#persistrequestskey)). It must return an `Array` of
+[`Request`](../api/request) or [`RequestOptions`](../typedefs/request-options).
+
+This is very useful in a scenario when getting the sources is a resource intensive or time consuming task, such as fetching URLs from multiple
+sitemaps or parsing URLs from large datasets. Using the `sourcesFunction` in combination with `persistStateKey` and `persistRequestsKey` will allow
+you to fetch and parse those URLs only once, saving valuable time when your actor migrates or restarts.
+
+If both [`RequestListOptions.sources`](../typedefs/request-list-options#sources) and
+[`RequestListOptions.sourcesFunction`](../typedefs/request-list-options#sourcesfunction) are provided, the sources returned by the function will be
+added after the `sources`.
+
+**Example:**
+
+```javascript
+// Let's say we want to scrape URLs extracted from sitemaps.
+
+const sourcesFunction = async () => {
+ // With super large sitemaps, this operation could take very long
+ // and big websites typically have multiple sitemaps.
+ const sitemaps = await downloadHugeSitemaps();
+ return parseUrlsFromSitemaps(sitemaps);
+};
+
+// Sitemaps can change in real-time, so it's important to persist
+// the URLs we collected. Otherwise we might lose our scraping
+// state in case of an actor migration / failure / time-out.
+const requestList = new RequestList({
+ sourcesFunction,
+ persistStateKey: 'state-key',
+ persistRequestsKey: 'requests-key',
+});
+
+// The sourcesFunction is called now and the Requests are persisted.
+// If something goes wrong and we need to start again, RequestList
+// will load the persisted Requests from storage and will NOT
+// call the sourcesFunction again, saving time and resources.
+await requestList.initialize();
+```
+
+---
+
+### `persistStateKey`
+
+**Type**: `string`
+
+Identifies the key in the default key-value store under which `RequestList` periodically stores its state (i.e. which URLs were crawled and which
+not). If the actor is restarted, `RequestList` will read the state and continue where it left off.
+
+If `persistStateKey` is not set, `RequestList` will always start from the beginning, and all the source URLs will be crawled again.
+
+---
+
+### `persistRequestsKey`
+
+**Type**: `string`
+
+Identifies the key in the default key-value store under which the `RequestList` persists its Requests during the
+[`RequestList.initialize()`](../api/request-list#initialize) call. This is necessary if `persistStateKey` is set and the source URLs might potentially
+change, to ensure consistency of the source URLs and state object. However, it comes with some storage and performance overheads.
+
+If `persistRequestsKey` is not set, [`RequestList.initialize()`](../api/request-list#initialize) will always fetch the sources from their origin,
+check that they are consistent with the restored state (if any) and throw an error if they are not.
+
+---
+
+### `state`
+
+**Type**: [`RequestListState`](../typedefs/request-list-state)
+
+The state object that the `RequestList` will be initialized from. It is in the form as returned by `RequestList.getState()`, such as follows:
+
+```
+{
+ nextIndex: 5,
+ nextUniqueKey: 'unique-key-5'
+ inProgress: {
+ 'unique-key-1': true,
+ 'unique-key-4': true,
+ },
+}
+```
+
+Note that the preferred (and simpler) way to persist the state of crawling of the `RequestList` is to use the `stateKeyPrefix` parameter instead.
+
+---
+
+### `keepDuplicateUrls`
+
+**Type**: `boolean` <code> = false</code>
+
+By default, `RequestList` will deduplicate the provided URLs. Default deduplication is based on the `uniqueKey` property of passed source
+[`Request`](../api/request) objects.
+
+If the property is not present, it is generated by normalizing the URL. If present, it is kept intact. In any case, only one request per `uniqueKey`
+is added to the `RequestList` resulting in removal of duplicate URLs / unique keys.
+
+Setting `keepDuplicateUrls` to `true` will append an additional identifier to the `uniqueKey` of each request that does not already include a
+`uniqueKey`. Therefore, duplicate URLs will be kept in the list. It does not protect the user from having duplicates in user set `uniqueKey`s however.
+It is the user's responsibility to ensure uniqueness of their unique keys if they wish to keep more than just a single copy in the `RequestList`.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/RequestListState.md b/website/versioned_docs/version-0.22.4/typedefs/RequestListState.md
new file mode 100644
index 000000000..a732014b9
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/RequestListState.md
@@ -0,0 +1,48 @@
+---
+id: version-0.22.4-request-list-state
+title: RequestListState
+original_id: request-list-state
+---
+
+<a name="requestliststate"></a>
+
+Represents state of a [`RequestList`](../api/request-list). It can be used to resume a [`RequestList`](../api/request-list) which has been previously
+processed. You can obtain the state by calling [`RequestList.getState()`](../api/request-list#getstate) and receive an object with the following
+structure:
+
+```
+{
+ nextIndex: 5,
+ nextUniqueKey: 'unique-key-5'
+ inProgress: {
+ 'unique-key-1': true,
+ 'unique-key-4': true
+ },
+}
+```
+
+## Properties
+
+### `nextIndex`
+
+**Type**: `number`
+
+Position of the next request to be processed.
+
+---
+
+### `nextUniqueKey`
+
+**Type**: `string`
+
+Key of the next request to be processed.
+
+---
+
+### `inProgress`
+
+**Type**: `Object<string, boolean>`
+
+An object mapping request keys to a boolean value respresenting whether they are being processed at the moment.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/RequestOptions.md b/website/versioned_docs/version-0.22.4/typedefs/RequestOptions.md
new file mode 100644
index 000000000..38f840da7
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/RequestOptions.md
@@ -0,0 +1,95 @@
+---
+id: version-0.22.4-request-options
+title: RequestOptions
+original_id: request-options
+---
+
+<a name="requestoptions"></a>
+
+Specifies required and optional fields for constructing a [`Request`](../api/request).
+
+## Properties
+
+### `url`
+
+**Type**: `string`
+
+URL of the web page to crawl. It must be a non-empty string.
+
+---
+
+### `uniqueKey`
+
+**Type**: `string`
+
+A unique key identifying the request. Two requests with the same `uniqueKey` are considered as pointing to the same URL.
+
+If `uniqueKey` is not provided, then it is automatically generated by normalizing the URL. For example, the URL of `HTTP://www.EXAMPLE.com/something/`
+will produce the `uniqueKey` of `http://www.example.com/something`.
+
+The `keepUrlFragment` option determines whether URL hash fragment is included in the `uniqueKey` or not.
+
+The `useExtendedUniqueKey` options determines whether method and payload are included in the `uniqueKey`, producing a `uniqueKey` in the following
+format: `METHOD(payloadHash):normalizedUrl`. This is useful when requests point to the same URL, but with different methods and payloads. For example:
+form submits.
+
+Pass an arbitrary non-empty text value to the `uniqueKey` property to override the default behavior and specify which URLs shall be considered equal.
+
+---
+
+### `method`
+
+**Type**: `string` <code> = &quot;&#x27;GET&#x27;&quot;</code>
+
+---
+
+### `payload`
+
+**Type**: `string` | `Buffer`
+
+HTTP request payload, e.g. for POST requests.
+
+---
+
+### `headers`
+
+**Type**: `Object` <code> = {}</code>
+
+HTTP headers in the following format:
+
+```
+{
+ Accept: 'text/html',
+ 'Content-Type': 'application/json'
+}
+```
+
+---
+
+### `userData`
+
+**Type**: `object` <code> = {}</code>
+
+Custom user data assigned to the request. Use this to save any request related data to the request's scope, keeping them accessible on retries,
+failures etc.
+
+---
+
+### `keepUrlFragment`
+
+**Type**: `boolean` <code> = false</code>
+
+If `false` then the hash part of a URL is removed when computing the `uniqueKey` property. For example, this causes the `http://www.example.com#foo`
+and `http://www.example.com#bar` URLs to have the same `uniqueKey` of `http://www.example.com` and thus the URLs are considered equal. Note that this
+option only has an effect if `uniqueKey` is not set.
+
+---
+
+### `useExtendedUniqueKey`
+
+**Type**: `boolean` <code> = false</code>
+
+If `true` then the `uniqueKey` is computed not only from the URL, but also from the method and payload properties. This is useful when making requests
+to the same URL that are differentiated by method or payload, such as form submit navigations in browsers.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/RequestQueueInfo.md b/website/versioned_docs/version-0.22.4/typedefs/RequestQueueInfo.md
new file mode 100644
index 000000000..63e4ca3f7
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/RequestQueueInfo.md
@@ -0,0 +1,63 @@
+---
+id: version-0.22.4-request-queue-info
+title: RequestQueueInfo
+original_id: request-queue-info
+---
+
+<a name="requestqueueinfo"></a>
+
+## Properties
+
+### `id`
+
+**Type**: `string`
+
+---
+
+### `name`
+
+**Type**: `string`
+
+---
+
+### `userId`
+
+**Type**: `string`
+
+---
+
+### `createdAt`
+
+**Type**: `Date`
+
+---
+
+### `modifiedAt`
+
+**Type**: `Date`
+
+---
+
+### `accessedAt`
+
+**Type**: `Date`
+
+---
+
+### `totalRequestCount`
+
+**Type**: `number`
+
+---
+
+### `handledRequestCount`
+
+**Type**: `number`
+
+---
+
+### `pendingRequestCount`
+
+**Type**: `number`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/RequestTransform.md b/website/versioned_docs/version-0.22.4/typedefs/RequestTransform.md
new file mode 100644
index 000000000..548a463c5
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/RequestTransform.md
@@ -0,0 +1,20 @@
+---
+id: version-0.22.4-request-transform
+title: RequestTransform
+original_id: request-transform
+---
+
+<a name="requesttransform"></a>
+
+Takes an Apify {RequestOptions} object and changes it's attributes in a desired way. This user-function is used
+[`utils.enqueueLinks()`](../api/utils#enqueuelinks) to modify requests before enqueuing them.
+
+**Parameters**:
+
+- **`original`**: [`RequestOptions`](../typedefs/request-options) - Request options to be modified.
+
+**Returns**:
+
+[`RequestOptions`](../typedefs/request-options) - The modified request options to enqueue.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/SessionOptions.md b/website/versioned_docs/version-0.22.4/typedefs/SessionOptions.md
new file mode 100644
index 000000000..d721ddb0d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/SessionOptions.md
@@ -0,0 +1,100 @@
+---
+id: version-0.22.4-session-options
+title: SessionOptions
+original_id: session-options
+---
+
+<a name="sessionoptions"></a>
+
+## Properties
+
+### `id`
+
+**Type**: `string`
+
+Id of session used for generating fingerprints. It is used as proxy session name.
+
+---
+
+### `maxAgeSecs`
+
+**Type**: `number` <code> = 3000</code>
+
+Number of seconds after which the session is considered as expired.
+
+---
+
+### `userData`
+
+**Type**: `object`
+
+Object where custom user data can be stored. For example custom headers.
+
+---
+
+### `maxErrorScore`
+
+**Type**: `number` <code> = 3</code>
+
+Maximum number of marking session as blocked usage. If the `errorScore` reaches the `maxErrorScore` session is marked as block and it is thrown away.
+It starts at 0. Calling the `markBad` function increases the `errorScore` by 1. Calling the `markGood` will decrease the `errorScore` by
+`errorScoreDecrement`
+
+---
+
+### `errorScoreDecrement`
+
+**Type**: `number` <code> = 0.5</code>
+
+It is used for healing the session. For example: if your session is marked bad two times, but it is successful on the third attempt it's errorScore is
+decremented by this number.
+
+---
+
+### `createdAt`
+
+**Type**: `Date`
+
+Date of creation.
+
+---
+
+### `expiresAt`
+
+**Type**: `Date`
+
+Date of expiration.
+
+---
+
+### `usageCount`
+
+**Type**: `number` <code> = 0</code>
+
+Indicates how many times the session has been used.
+
+---
+
+### `errorCount`
+
+**Type**: `number` <code> = 0</code>
+
+Indicates how many times the session is marked bad.
+
+---
+
+### `maxUsageCount`
+
+**Type**: `number` <code> = 50</code>
+
+Session should be used only a limited amount of times. This number indicates how many times the session is going to be used, before it is thrown away.
+
+---
+
+### `sessionPool`
+
+**Type**: [`SessionPool`](../api/session-pool)
+
+SessionPool instance. Session will emit the `sessionRetired` event on this instance.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/SessionPoolOptions.md b/website/versioned_docs/version-0.22.4/typedefs/SessionPoolOptions.md
new file mode 100644
index 000000000..08015f97f
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/SessionPoolOptions.md
@@ -0,0 +1,50 @@
+---
+id: version-0.22.4-session-pool-options
+title: SessionPoolOptions
+original_id: session-pool-options
+---
+
+<a name="sessionpooloptions"></a>
+
+## Properties
+
+### `maxPoolSize`
+
+**Type**: `number` <code> = 1000</code>
+
+Maximum size of the pool. Indicates how many sessions are rotated.
+
+---
+
+### `sessionOptions`
+
+**Type**: [`SessionOptions`](../typedefs/session-options)
+
+The configuration options for {Session} instances.
+
+---
+
+### `persistStateKeyValueStoreId`
+
+**Type**: `string`
+
+Name or Id of `KeyValueStore` where is the `SessionPool` state stored.
+
+---
+
+### `persistStateKey`
+
+**Type**: `string` <code> = &quot;\&quot;SESSION_POOL_STATE\&quot;&quot;</code>
+
+Session pool persists it's state under this key in Key value store.
+
+---
+
+### `createSessionFunction`
+
+**Type**: [`CreateSession`](../typedefs/create-session)
+
+Custom function that should return `Session` instance. Any error thrown from this function will terminate the process. Function receives `SessionPool`
+instance as a parameter
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/SessionState.md b/website/versioned_docs/version-0.22.4/typedefs/SessionState.md
new file mode 100644
index 000000000..47c9f2f67
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/SessionState.md
@@ -0,0 +1,65 @@
+---
+id: version-0.22.4-session-state
+title: SessionState
+original_id: session-state
+---
+
+<a name="sessionstate"></a>
+
+Persistable [`Session`](../api/session) state.
+
+## Properties
+
+### `id`
+
+**Type**: `string`
+
+---
+
+### `cookieJar`
+
+**Type**: `CookieJar`
+
+---
+
+### `userData`
+
+**Type**: `object`
+
+---
+
+### `errorScore`
+
+**Type**: `number`
+
+---
+
+### `maxErrorScore`
+
+**Type**: `number`
+
+---
+
+### `errorScoreDecrement`
+
+**Type**: `number`
+
+---
+
+### `usageCount`
+
+**Type**: `number`
+
+---
+
+### `expiresAt`
+
+**Type**: `string`
+
+---
+
+### `createdAt`
+
+**Type**: `string`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/SnapshotterOptions.md b/website/versioned_docs/version-0.22.4/typedefs/SnapshotterOptions.md
new file mode 100644
index 000000000..19844c160
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/SnapshotterOptions.md
@@ -0,0 +1,84 @@
+---
+id: version-0.22.4-snapshotter-options
+title: SnapshotterOptions
+original_id: snapshotter-options
+---
+
+<a name="snapshotteroptions"></a>
+
+## Properties
+
+### `eventLoopSnapshotIntervalSecs`
+
+**Type**: `number` <code> = 0.5</code>
+
+Defines the interval of measuring the event loop response time.
+
+---
+
+### `clientSnapshotIntervalSecs`
+
+**Type**: `number` <code> = 1</code>
+
+Defines the interval of checking the current state of the remote API client.
+
+---
+
+### `maxBlockedMillis`
+
+**Type**: `number` <code> = 50</code>
+
+Maximum allowed delay of the event loop in milliseconds. Exceeding this limit overloads the event loop.
+
+---
+
+### `cpuSnapshotIntervalSecs`
+
+**Type**: `number` <code> = 1</code>
+
+Defines the interval of measuring CPU usage. This is only used when running locally. On the Apify platform, the statistics are provided externally at
+a fixed interval.
+
+---
+
+### `maxUsedCpuRatio`
+
+**Type**: `number` <code> = 0.95</code>
+
+Defines the maximum usage of CPU. Exceeding this limit overloads the CPU.
+
+---
+
+### `memorySnapshotIntervalSecs`
+
+**Type**: `number` <code> = 1</code>
+
+Defines the interval of measuring memory consumption. This is only used when running locally. On the Apify platform, the statistics are provided
+externally at a fixed interval. The measurement itself is resource intensive (25 - 50ms async). Therefore, setting this interval below 1 second is not
+recommended.
+
+---
+
+### `maxUsedMemoryRatio`
+
+**Type**: `number` <code> = 0.7</code>
+
+Defines the maximum ratio of total memory that can be used. Exceeding this limit overloads the memory.
+
+---
+
+### `maxClientErrors`
+
+**Type**: `number` <code> = 1</code>
+
+Defines the maximum number of new rate limit errors within the given interval.
+
+---
+
+### `snapshotHistorySecs`
+
+**Type**: `number` <code> = 60</code>
+
+Sets the interval in seconds for which a history of resource snapshots will be kept. Increasing this to very high numbers will affect performance.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/SocialHandles.md b/website/versioned_docs/version-0.22.4/typedefs/SocialHandles.md
new file mode 100644
index 000000000..05aa484de
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/SocialHandles.md
@@ -0,0 +1,74 @@
+---
+id: version-0.22.4-social-handles
+title: SocialHandles
+original_id: social-handles
+---
+
+<a name="socialhandles"></a>
+
+Representation of social handles parsed from a HTML page.
+
+The object has the following structure:
+
+```
+{
+ emails: String[],
+ phones: String[],
+ phonesUncertain: String[],
+ linkedIns: String[],
+ twitters: String[],
+ instagrams: String[],
+ facebooks: String[],
+ youtubes: String[],
+}
+```
+
+## Properties
+
+### `emails`
+
+**Type**: `Array<string>`
+
+---
+
+### `phones`
+
+**Type**: `Array<string>`
+
+---
+
+### `phonesUncertain`
+
+**Type**: `Array<string>`
+
+---
+
+### `linkedIns`
+
+**Type**: `Array<string>`
+
+---
+
+### `twitters`
+
+**Type**: `Array<string>`
+
+---
+
+### `instagrams`
+
+**Type**: `Array<string>`
+
+---
+
+### `facebooks`
+
+**Type**: `Array<string>`
+
+---
+
+### `youtubes`
+
+**Type**: `Array<string>`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/StatisticPersistedState.md b/website/versioned_docs/version-0.22.4/typedefs/StatisticPersistedState.md
new file mode 100644
index 000000000..fd154983b
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/StatisticPersistedState.md
@@ -0,0 +1,77 @@
+---
+id: version-0.22.4-statistic-persisted-state
+title: StatisticPersistedState
+original_id: statistic-persisted-state
+---
+
+<a name="statisticpersistedstate"></a>
+
+Format of the persisted stats
+
+## Properties
+
+### `requestRetryHistogram`
+
+**Type**: `Array<number>`
+
+---
+
+### `statsId`
+
+**Type**: `number`
+
+---
+
+### `requestAvgFailedDurationMillis`
+
+**Type**: `number`
+
+---
+
+### `requestAvgFinishedDurationMillis`
+
+**Type**: `number`
+
+---
+
+### `requestsFinishedPerMinute`
+
+**Type**: `number`
+
+---
+
+### `requestsFailedPerMinute`
+
+**Type**: `number`
+
+---
+
+### `requestTotalDurationMillis`
+
+**Type**: `number`
+
+---
+
+### `requestsTotal`
+
+**Type**: `number`
+
+---
+
+### `crawlerRuntimeMillis`
+
+**Type**: `number`
+
+---
+
+### `crawlerLastStartTimestamp`
+
+**Type**: `number`
+
+---
+
+### `statsPersistedAt`
+
+**Type**: `string`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/StatisticState.md b/website/versioned_docs/version-0.22.4/typedefs/StatisticState.md
new file mode 100644
index 000000000..0e6283c62
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/StatisticState.md
@@ -0,0 +1,89 @@
+---
+id: version-0.22.4-statistic-state
+title: StatisticState
+original_id: statistic-state
+---
+
+<a name="statisticstate"></a>
+
+Contains the statistics state
+
+## Properties
+
+### `requestsFinished`
+
+**Type**: `number`
+
+---
+
+### `requestsFailed`
+
+**Type**: `number`
+
+---
+
+### `requestsRetries`
+
+**Type**: `number`
+
+---
+
+### `requestsFailedPerMinute`
+
+**Type**: `number`
+
+---
+
+### `requestsFinishedPerMinute`
+
+**Type**: `number`
+
+---
+
+### `requestMinDurationMillis`
+
+**Type**: `number`
+
+---
+
+### `requestMaxDurationMillis`
+
+**Type**: `number`
+
+---
+
+### `requestTotalFailedDurationMillis`
+
+**Type**: `number`
+
+---
+
+### `requestTotalFinishedDurationMillis`
+
+**Type**: `number`
+
+---
+
+### `crawlerStartedAt`
+
+**Type**: `Date` | `string` | `null`
+
+---
+
+### `crawlerFinishedAt`
+
+**Type**: `Date` | `string` | `null`
+
+---
+
+### `crawlerRuntimeMillis`
+
+**Type**: `number`
+
+---
+
+### `statsPersistedAt`
+
+**Type**: `Date` | `string` | `null`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/StealthOptions.md b/website/versioned_docs/version-0.22.4/typedefs/StealthOptions.md
new file mode 100644
index 000000000..c8ac9998e
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/StealthOptions.md
@@ -0,0 +1,92 @@
+---
+id: version-0.22.4-stealth-options
+title: StealthOptions
+original_id: stealth-options
+---
+
+<a name="stealthoptions"></a>
+
+Configuration of stealth tricks for a proper hiding effect all of them should be set to true. These tricks are applied only when the `stealth` option
+is set to `true`.
+
+## Properties
+
+### `addPlugins`
+
+**Type**: `boolean` <code> = true</code>
+
+If plugins should be added to the navigator.
+
+---
+
+### `emulateWindowFrame`
+
+**Type**: `boolean` <code> = true</code>
+
+Emulates window Iframe.
+
+---
+
+### `emulateWebGL`
+
+**Type**: `boolean` <code> = true</code>
+
+Emulates graphic card.
+
+---
+
+### `emulateConsoleDebug`
+
+**Type**: `boolean` <code> = true</code>
+
+Emulates console.debug to return null.
+
+---
+
+### `addLanguage`
+
+**Type**: `boolean` <code> = true</code>
+
+Adds languages to the navigator.
+
+---
+
+### `hideWebDriver`
+
+**Type**: `boolean` <code> = true</code>
+
+Hides the webdriver by changing the navigator proto.
+
+---
+
+### `hackPermissions`
+
+**Type**: `boolean` <code> = true</code>
+
+Fakes interaction with permissions.
+
+---
+
+### `mockChrome`
+
+**Type**: `boolean` <code> = true</code>
+
+Adds the chrome runtime properties.
+
+---
+
+### `mockChromeInIframe`
+
+**Type**: `boolean` <code> = true</code>
+
+Adds the chrome runtime properties inside the every newly created iframe.
+
+---
+
+### `mockDeviceMemory`
+
+**Type**: `boolean` <code> = true</code>
+
+Sets device memory to other value than 0.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/SystemInfo.md b/website/versioned_docs/version-0.22.4/typedefs/SystemInfo.md
new file mode 100644
index 000000000..41df5c348
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/SystemInfo.md
@@ -0,0 +1,39 @@
+---
+id: version-0.22.4-system-info
+title: SystemInfo
+original_id: system-info
+---
+
+<a name="systeminfo"></a>
+
+Represents the current status of the system.
+
+## Properties
+
+### `isSystemIdle`
+
+**Type**: `boolean`
+
+If true, system is being overloaded.
+
+---
+
+### `memInfo`
+
+**Type**: `object`
+
+Memory
+
+---
+
+### `eventLoopInfo`
+
+**Type**: `object`
+
+---
+
+### `cpuInfo`
+
+**Type**: `object`
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/SystemStatusOptions.md b/website/versioned_docs/version-0.22.4/typedefs/SystemStatusOptions.md
new file mode 100644
index 000000000..42fc8030d
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/SystemStatusOptions.md
@@ -0,0 +1,57 @@
+---
+id: version-0.22.4-system-status-options
+title: SystemStatusOptions
+original_id: system-status-options
+---
+
+<a name="systemstatusoptions"></a>
+
+## Properties
+
+### `currentHistorySecs`
+
+**Type**: `number` <code> = 5</code>
+
+Defines max age of snapshots used in the [`SystemStatus.getCurrentStatus()`](../api/system-status#getcurrentstatus) measurement.
+
+---
+
+### `maxMemoryOverloadedRatio`
+
+**Type**: `number` <code> = 0.2</code>
+
+Sets the maximum ratio of overloaded snapshots in a memory sample. If the sample exceeds this ratio, the system will be overloaded.
+
+---
+
+### `maxEventLoopOverloadedRatio`
+
+**Type**: `number` <code> = 0.6</code>
+
+Sets the maximum ratio of overloaded snapshots in an event loop sample. If the sample exceeds this ratio, the system will be overloaded.
+
+---
+
+### `maxCpuOverloadedRatio`
+
+**Type**: `number` <code> = 0.4</code>
+
+Sets the maximum ratio of overloaded snapshots in a CPU sample. If the sample exceeds this ratio, the system will be overloaded.
+
+---
+
+### `maxClientOverloadedRatio`
+
+**Type**: `number` <code> = 0.3</code>
+
+Sets the maximum ratio of overloaded snapshots in a Client sample. If the sample exceeds this ratio, the system will be overloaded.
+
+---
+
+### `snapshotter`
+
+**Type**: [`Snapshotter`](../api/snapshotter)
+
+The `Snapshotter` instance to be queried for `SystemStatus`.
+
+---
diff --git a/website/versioned_docs/version-0.22.4/typedefs/UserFunc.md b/website/versioned_docs/version-0.22.4/typedefs/UserFunc.md
new file mode 100644
index 000000000..3fb4e52b2
--- /dev/null
+++ b/website/versioned_docs/version-0.22.4/typedefs/UserFunc.md
@@ -0,0 +1,13 @@
+---
+id: version-0.22.4-user-func
+title: UserFunc
+original_id: user-func
+---
+
+<a name="userfunc"></a>
+
+**Returns**:
+
+`Promise<void>`
+
+---
diff --git a/website/versioned_sidebars/version-0.22.4-sidebars.json b/website/versioned_sidebars/version-0.22.4-sidebars.json
new file mode 100644
index 000000000..8d4fe5b19
--- /dev/null
+++ b/website/versioned_sidebars/version-0.22.4-sidebars.json
@@ -0,0 +1,181 @@
+{
+ "version-0.22.4-docs": {
+ "Guide": [
+ "version-0.22.4-guides/motivation",
+ "version-0.22.4-guides/quick-start",
+ "version-0.22.4-guides/apify-platform",
+ "version-0.22.4-guides/getting-started",
+ "version-0.22.4-guides/data-storage",
+ "version-0.22.4-guides/environment-variables",
+ "version-0.22.4-guides/proxy-management",
+ "version-0.22.4-guides/session-management",
+ "version-0.22.4-guides/type-script-actor"
+ ],
+ "Examples": [
+ "version-0.22.4-examples/accept-user-input",
+ "version-0.22.4-examples/add-data-to-dataset",
+ "version-0.22.4-examples/basic-crawler",
+ "version-0.22.4-examples/call-actor",
+ "version-0.22.4-examples/capture-screenshot",
+ "version-0.22.4-examples/cheerio-crawler",
+ "version-0.22.4-examples/crawl-all-links",
+ "version-0.22.4-examples/crawl-multiple-urls",
+ "version-0.22.4-examples/crawl-relative-links",
+ "version-0.22.4-examples/crawl-single-url",
+ "version-0.22.4-examples/crawl-sitemap",
+ "version-0.22.4-examples/crawl-some-links",
+ "version-0.22.4-examples/forms",
+ "version-0.22.4-examples/handle-broken-links",
+ "version-0.22.4-examples/map-and-reduce",
+ "version-0.22.4-examples/puppeteer-crawler",
+ "version-0.22.4-examples/puppeteer-recursive-crawl",
+ "version-0.22.4-examples/puppeteer-sitemap",
+ "version-0.22.4-examples/puppeteer-with-proxy",
+ "version-0.22.4-examples/screenshots",
+ "version-0.22.4-examples/synchronous-run"
+ ],
+ "API Reference": [
+ "version-0.22.4-api/apify",
+ {
+ "type": "subcategory",
+ "label": "Crawlers",
+ "ids": [
+ "version-0.22.4-api/basic-crawler",
+ "version-0.22.4-api/cheerio-crawler",
+ "version-0.22.4-api/puppeteer-crawler"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Result Stores",
+ "ids": [
+ "version-0.22.4-api/dataset",
+ "version-0.22.4-api/key-value-store"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Scaling",
+ "ids": [
+ "version-0.22.4-api/autoscaled-pool",
+ "version-0.22.4-api/puppeteer-pool",
+ "version-0.22.4-api/session",
+ "version-0.22.4-api/session-pool",
+ "version-0.22.4-api/proxy-configuration",
+ "version-0.22.4-api/snapshotter",
+ "version-0.22.4-api/system-status"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Sources",
+ "ids": [
+ "version-0.22.4-api/request",
+ "version-0.22.4-api/request-list",
+ "version-0.22.4-api/request-queue",
+ "version-0.22.4-api/pseudo-url"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Utilities",
+ "ids": [
+ "version-0.22.4-api/utils",
+ "version-0.22.4-api/log",
+ "version-0.22.4-api/puppeteer",
+ "version-0.22.4-api/social"
+ ]
+ }
+ ],
+ "Type Definitions": [
+ {
+ "type": "subcategory",
+ "label": "Constructor Options",
+ "ids": [
+ "version-0.22.4-typedefs/autoscaled-pool-options",
+ "version-0.22.4-typedefs/basic-crawler-options",
+ "version-0.22.4-typedefs/cheerio-crawler-options",
+ "version-0.22.4-typedefs/puppeteer-crawler-options",
+ "version-0.22.4-typedefs/puppeteer-pool-options",
+ "version-0.22.4-typedefs/proxy-configuration-options",
+ "version-0.22.4-typedefs/proxy-info",
+ "version-0.22.4-typedefs/logger-options",
+ "version-0.22.4-typedefs/launch-puppeteer-options",
+ "version-0.22.4-typedefs/request-options",
+ "version-0.22.4-typedefs/request-list-options",
+ "version-0.22.4-typedefs/request-as-browser-options",
+ "version-0.22.4-typedefs/session-options",
+ "version-0.22.4-typedefs/session-pool-options",
+ "version-0.22.4-typedefs/snapshotter-options",
+ "version-0.22.4-typedefs/stealth-options",
+ "version-0.22.4-typedefs/system-status-options"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Functions - Crawlers",
+ "ids": [
+ "version-0.22.4-typedefs/cheerio-handle-page",
+ "version-0.22.4-typedefs/cheerio-handle-page-inputs",
+ "version-0.22.4-typedefs/handle-failed-request",
+ "version-0.22.4-typedefs/handle-failed-request-input",
+ "version-0.22.4-typedefs/handle-request",
+ "version-0.22.4-typedefs/handle-request-inputs",
+ "version-0.22.4-typedefs/prepare-request",
+ "version-0.22.4-typedefs/prepare-request-inputs",
+ "version-0.22.4-typedefs/puppeteer-handle-page",
+ "version-0.22.4-typedefs/puppeteer-handle-page-inputs",
+ "version-0.22.4-typedefs/launch-puppeteer",
+ "version-0.22.4-typedefs/puppeteer-goto",
+ "version-0.22.4-typedefs/puppeteer-goto-inputs"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Functions - Dataset",
+ "ids": [
+ "version-0.22.4-typedefs/dataset-consumer",
+ "version-0.22.4-typedefs/dataset-mapper",
+ "version-0.22.4-typedefs/dataset-reducer"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Functions - KeyValueStore",
+ "ids": [
+ "version-0.22.4-typedefs/key-consumer"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Functions - Sessions",
+ "ids": [
+ "version-0.22.4-typedefs/create-session"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Functions - Utilities",
+ "ids": [
+ "version-0.22.4-typedefs/request-transform"
+ ]
+ },
+ {
+ "type": "subcategory",
+ "label": "Return Types",
+ "ids": [
+ "version-0.22.4-typedefs/actor-run",
+ "version-0.22.4-api/apify-call-error",
+ "version-0.22.4-typedefs/apify-env",
+ "version-0.22.4-typedefs/dataset-content",
+ "version-0.22.4-typedefs/memory-info",
+ "version-0.22.4-typedefs/queue-operation-info",
+ "version-0.22.4-typedefs/request-list-state",
+ "version-0.22.4-typedefs/session-state",
+ "version-0.22.4-typedefs/social-handles",
+ "version-0.22.4-typedefs/system-info"
+ ]
+ }
+ ]
+ }
+}
diff --git a/website/versions.json b/website/versions.json
new file mode 100644
index 000000000..47f36f88e
--- /dev/null
+++ b/website/versions.json
@@ -0,0 +1,3 @@
+[
+ "0.22.4"
+]