From aafb516e5e603eb394eb8bb25e389674720c23d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Tue, 15 Jul 2025 23:08:30 +0200 Subject: [PATCH 1/6] docs: replace all api docs links replace all old api-docs link to current working URLs fix prose --- .../deploying_your_code/inputs_outputs.md | 2 +- .../platform/getting_started/apify_api.md | 6 ++-- .../platform/getting_started/apify_client.md | 2 +- .../academy/platform/running_a_web_server.md | 2 +- .../run_actor_and_retrieve_data_via_api.md | 22 ++++++------ .../node_js/apify_free_google_serp_api.md | 2 +- .../tutorials/php/using_apify_from_php.md | 10 +++--- .../development/builds_and_runs/runs.md | 2 +- .../container_web_server.md | 2 +- .../actors/running/runs_and_builds.md | 4 +-- sources/platform/actors/running/tasks.md | 4 +-- sources/platform/integrations/actors/index.md | 2 +- .../actors/integrating_actors_via_api.md | 2 +- .../platform/integrations/programming/api.md | 2 +- .../programming/webhooks/events.md | 2 +- sources/platform/limits.md | 2 +- sources/platform/schedules.md | 10 +++--- sources/platform/storage/dataset.md | 24 ++++++------- sources/platform/storage/key_value_store.md | 20 +++++------ sources/platform/storage/request_queue.md | 36 +++++++++---------- sources/platform/storage/usage.md | 26 +++++++------- 21 files changed, 91 insertions(+), 93 deletions(-) diff --git a/sources/academy/platform/deploying_your_code/inputs_outputs.md b/sources/academy/platform/deploying_your_code/inputs_outputs.md index fbef2d2db7..a41f8ab377 100644 --- a/sources/academy/platform/deploying_your_code/inputs_outputs.md +++ b/sources/academy/platform/deploying_your_code/inputs_outputs.md @@ -125,7 +125,7 @@ solution = add_all_numbers(actor_input) print(solution) ``` -> For a better understanding of the API endpoints for reading and modifying key-value stores, check the [official API reference](/api/v2#/reference/key-value-stores). +> For a better understanding of the API endpoints for reading and modifying key-value stores, check the [official API reference](/api/v2/storage-key-value-stores). ## Writing output {#writing-output} diff --git a/sources/academy/platform/getting_started/apify_api.md b/sources/academy/platform/getting_started/apify_api.md index 0f410f7b7f..b55cb6149e 100644 --- a/sources/academy/platform/getting_started/apify_api.md +++ b/sources/academy/platform/getting_started/apify_api.md @@ -11,7 +11,7 @@ slug: /getting-started/apify-api --- -[Apify's API](/api/v2#/reference) is your ticket to the Apify platform without even needing to access the [Apify Console](https://console.apify.com?asrc=developers_portal) web-interface. The API is organized around RESTful HTTP endpoints. +[Apify's API](/api/v2) web-interface. The API is organized around RESTful HTTP endpoints. In this lesson, we'll be learning how to use the Apify API to call an Actor and view its results. We'll be using the Actor we created in the previous lesson, so if you haven't already gotten that one set up, go ahead do that before moving forward if you'd like to follow along. @@ -45,7 +45,7 @@ Let's say we want to run our **adding-actor** via API and view its results in CS https://api.apify.com/v2/acts/YOUR_USERNAME~adding-actor/run-sync-get-dataset-items?token=YOUR_TOKEN_HERE&format=csv ``` -Additional parameters can be passed to this endpoint. You can learn about them [here](/api/v2#/reference/actors/run-actor-synchronously-and-get-dataset-items/run-actor-synchronously-with-input-and-get-dataset-items) +Additional parameters can be passed to this endpoint. You can learn about them [here](/api/v2/act-run-sync-get-dataset-items-post) > Network components can record visited URLs, so it's more secure to send the token as a HTTP header, not as a parameter. The header should look like `Authorization: Bearer YOUR_TOKEN`. Popular HTTP clients, such as [Postman](../../glossary/tools/postman.md) or [Insomnia](../../glossary/tools/insomnia.md), provide a convenient way to configure the Authorization header for all your API requests. @@ -65,7 +65,7 @@ And there it is! The Actor was run with our inputs of **num1** and **num2**, the ## Apify API's many features {#api-many-features} -What we've done in this lesson only scratches the surface of what the Apify API can do. Right from Insomnia, or from any HTTP client, you can [manage datasets](/api/v2#/reference/datasets/dataset/get-dataset) and [key-value stores](/api/v2#/reference/key-value-stores/key-collection/get-dataset), [add to request queues](/api/v2#/reference/request-queues/queue-collection/add-request), [update Actors](/api/v2#/reference/actors/actor-object/add-request), and much more! Basically, whatever you can do on the platform's web interface, you also do through the API. +What we've done in this lesson only scratches the surface of what the Apify API can do. Right from Insomnia, or from any HTTP client, you can [manage datasets](/api/v2/storage-datasets) and [key-value stores](/api/v2/storage-key-value-stores), [add to request queues]/api/v2/storage-request-queues), [update Actors](/api/v2/storage-request-queues-requests), and much more! Basically, whatever you can do on the platform's web interface, you also do through the API. ## Next up {#next} diff --git a/sources/academy/platform/getting_started/apify_client.md b/sources/academy/platform/getting_started/apify_client.md index 27364ffeee..0389e792ca 100644 --- a/sources/academy/platform/getting_started/apify_client.md +++ b/sources/academy/platform/getting_started/apify_client.md @@ -220,7 +220,7 @@ print(items) If you check the **Settings** tab within your **adding-actor**, you'll notice that the default memory being allocated to the Actor is **2048 MB**. This is a bit overkill considering the fact that the Actor is only adding two numbers together - **256 MB** would be much more reasonable. Also, we can safely say that the run should never take more than 20 seconds (even this is a generous number) and that the default of 3600 seconds is also overkill. -Let's change these two Actor settings via the Apify client using the [`actor.update()`](/api/client/js/reference/class/ActorClient#update) function. This function will call the **update Actor** endpoint, which can take `defaultRunOptions` as an input property. You can find the shape of the `defaultRunOptions` in the [API documentation](/api/v2#/reference/actors/actor-object/update-actor). Perfect! +Let's change these two Actor settings via the Apify client using the [`actor.update()`](/api/client/js/reference/class/ActorClient#update) function. This function will call the **update Actor** endpoint, which can take `defaultRunOptions` as an input property. You can find the shape of the `defaultRunOptions` in the [API documentation](/api/v2/act-put). Perfect! First, we'll create a pointer to our Actor, similar to before (except this time, we won't be using `.call()` at the end): diff --git a/sources/academy/platform/running_a_web_server.md b/sources/academy/platform/running_a_web_server.md index d35727bf20..e3e9cbb032 100644 --- a/sources/academy/platform/running_a_web_server.md +++ b/sources/academy/platform/running_a_web_server.md @@ -17,7 +17,7 @@ Sometimes, an Actor needs a channel for communication with other systems (or hum - An API to receive commands. - An HTML page displaying output data. -Running a web server in an Actor is a piece of cake! Each Actor run is available at a unique URL (container URL) which always takes the form `https://CONTAINER-KEY.runs.apify.net`. This URL is available in the [**Actor run** object](/api/v2#/reference/actor-runs/run-object-and-its-storages/get-run) returned by the Apify API, as well as in the Apify console. +Running a web server in an Actor is a piece of cake! Each Actor run is available at a unique URL (container URL) which always takes the form `https://CONTAINER-KEY.runs.apify.net`. This URL is available in the [**Actor run** object](/api/v2/actor-run-get) returned by the Apify API, as well as in the Apify console. If you start a web server on the port defined by the **APIFY_CONTAINER_PORT** environment variable (the default value is **4321**), the container URL becomes available and gets displayed in the **Live View** tab in the Actor run console. diff --git a/sources/academy/tutorials/api/run_actor_and_retrieve_data_via_api.md b/sources/academy/tutorials/api/run_actor_and_retrieve_data_via_api.md index b901b6c46c..557529ce25 100644 --- a/sources/academy/tutorials/api/run_actor_and_retrieve_data_via_api.md +++ b/sources/academy/tutorials/api/run_actor_and_retrieve_data_via_api.md @@ -28,7 +28,7 @@ If the Actor being run via API takes 5 minutes or less to complete a typical run > If you are unsure about the differences between an Actor and a task, you can read about them in the [tasks](/platform/actors/running/tasks) documentation. In brief, tasks are pre-configured inputs for Actors. -The API endpoints and usage (for both sync and async) for [Actors](/api/v2#tag/ActorsRun-collection/operation/act_runs_post) and [tasks](/api/v2#/reference/actor-tasks/run-collection/run-task) are essentially the same. +The API endpoints and usage (for both sync and async) for [Actors](/api/v2#tag/ActorsRun-collection/operation/act_runs_post) and [tasks](/api/v2/actor-task-runs-post) are essentially the same. To run, or **call**, an Actor/task, you will need a few things: @@ -86,7 +86,7 @@ If we press **Send**, it will immediately return some info about the run. The `s ![Actor run info in Postman](./images/run-info-postman.png) -We will later use this **run info** JSON to retrieve the run's output data. This info about the run can also be retrieved with another call to the [**Get run**](https://apify.com/docs/api/v2#/reference/actors/run-object/get-run) endpoint. +We will later use this **run info** JSON to retrieve the run's output data. This info about the run can also be retrieved with another call to the [**Get run**](/api/v2/act-run-get) endpoint. ## JavaScript and Python client {#javascript-and-python-client} @@ -150,7 +150,7 @@ If your synchronous run exceeds the 5-minute time limit, the response will be a ### Synchronous runs with dataset output {#synchronous-runs-with-dataset-output} -Most Actor runs will store their data in the default [dataset](/platform/storage/dataset). The Apify API provides **run-sync-get-dataset-items** endpoints for [Actors](/api/v2#/reference/actors/run-actor-synchronously-and-get-dataset-items/run-actor-synchronously-with-input-and-get-dataset-items) and [tasks](/api/v2#/reference/actor-tasks/run-task-synchronously-and-get-dataset-items/run-task-synchronously-and-get-dataset-items-(post)), which allow you to run an Actor and receive the items from the default dataset once the run has finished. +Most Actor runs will store their data in the default [dataset](/platform/storage/dataset). The Apify API provides **run-sync-get-dataset-items** endpoints for [Actors](/api/v2/act-run-sync-get-dataset-items-post) and [tasks](/api/v2/actor-task-run-sync-get-dataset-items-post), which allow you to run an Actor and receive the items from the default dataset once the run has finished. Here is a Node.js example of calling a task via the API and logging the dataset items to the console: @@ -187,9 +187,7 @@ items.forEach((item) => { ### Synchronous runs with key-value store output {#synchronous-runs-with-key-value-store-output} -[Key-value stores](/platform/storage/key-value-store) are useful for storing files like images, HTML snapshots, or JSON data. The Apify API provides **run-sync** endpoints for [Actors](/api/v2#/reference/actors/run-actor-synchronously/with-input) and [tasks](/api/v2#/reference/actor-tasks/run-task-synchronously/run-task-synchronously), which allow you to run a specific task and receive the output. By default, they return the `OUTPUT` record from the default key-value store. - -> For more detailed information, check the [API reference](/api/v2#/reference/actors/run-actor-synchronously-and-get-dataset-items/run-actor-synchronously-with-input-and-get-dataset-items). +[Key-value stores](/platform/storage/key-value-store) are useful for storing files like images, HTML snapshots, or JSON data. The Apify API provides **run-sync** endpoints for [Actors](/api/v2/act-run-sync-post) and [tasks](/api/v2/actor-task-run-sync-post), which allow you to run a specific task and receive the output. By default, they return the `OUTPUT` record from the default key-value store. ## Asynchronous flow {#asynchronous-flow} @@ -215,7 +213,7 @@ This solution is quite similar to the synchronous flow. To make the POST request https://api.apify.com/v2/acts/apify~web-scraper/runs?token=YOUR_TOKEN&waitForFinish=60 ``` -You can also use the `waitForFinish` parameter with the [**GET Run** endpoint](/api/v2#/reference/actors/run-object/get-run) to implement a smarter [polling](#polling) system. +You can also use the `waitForFinish` parameter with the [**GET Run** endpoint](/api/v2/actor-run-get) to implement a smarter [polling](#polling) system. Once again, the final response will be the **run info object**; however, now its status should be `SUCCEEDED` or `FAILED`. If the run exceeds the `waitForFinish` duration, the status will still be `RUNNING`. @@ -237,7 +235,7 @@ Once your server receives this request from the webhook, you know that the event What if you don't have a server, and the run you'd like to do is much too long to use a synchronous call? In cases like these, periodic **polling** of the run's status is the solution. -When we run the Actor with the [usual API call](#run-an-actor-or-task) shown above, we will back a response with the **run info** object. From this JSON object, we can then extract the ID of the Actor run that we just started from the `id` field. Then, we can set an interval that will poll the Apify API (let's say every 5 seconds) by calling the [**Get run**](https://apify.com/docs/api/v2#/reference/actors/run-object/get-run) endpoint to retrieve the run's status. +When we run the Actor with the [usual API call](#run-an-actor-or-task) shown above, we will back a response with the **run info** object. From this JSON object, we can then extract the ID of the Actor run that we just started from the `id` field. Then, we can set an interval that will poll the Apify API (let's say every 5 seconds) by calling the [**Get run**](/api/v2/actor-run-get) endpoint to retrieve the run's status. Replace the `RUN_ID` in the following URL with the ID you extracted earlier: @@ -257,7 +255,7 @@ The **run info** JSON also contains the IDs of the default [dataset](/platform/s > If you are scraping products, or any list of items with similar fields, the [dataset](/platform/storage/dataset) should be your storage of choice. Don't forget though, that dataset items are immutable. This means that you can only add to the dataset, and not change the content that is already inside it. -To retrieve the data from a dataset, send a GET request to the [**Get items**](/api/v2#/reference/datasets/item-collection/get-items) endpoint and pass the `defaultDatasetId` into the URL. For a GET request to the default dataset, no token is needed. +To retrieve the data from a dataset, send a GET request to the [**Get items**](/api/v2/dataset-items-get) endpoint and pass the `defaultDatasetId` into the URL. For a GET request to the default dataset, no token is needed. ```cURL https://api.apify.com/v2/datasets/DATASET_ID/items @@ -265,7 +263,7 @@ https://api.apify.com/v2/datasets/DATASET_ID/items By default, it will return the data in JSON format with some metadata. The actual data are in the `items` array. -You can use plenty of additional parameters, to learn more about them, visit our API reference [documentation](/api/v2#/reference/datasets/item-collection/get-items). We will only mention that you can pass a `format` parameter that transforms the response into popular formats like CSV, XML, Excel, RSS, etc. +You can use plenty of additional parameters, to learn more about them, visit our API reference [documentation](/api/v2/dataset-items-get). We will only mention that you can pass a `format` parameter that transforms the response into popular formats like CSV, XML, Excel, RSS, etc. The items are paginated, which means you can ask only for a subset of the data. Specify this using the `limit` and `offset` parameters. This endpoint has a limit of 250,000 items that it can return per request. To retrieve more, you will need to send more requests incrementing the `offset` parameter. @@ -279,13 +277,13 @@ https://api.apify.com/v2/datasets/DATASET_ID/items?format=csv&offset=250000 When you want to retrieve something from a key-value store, the `defaultKeyValueStoreId` is _not_ enough. You also need to know the name (or **key**) of the record you want to retrieve. -If you have a single output JSON, the convention is to return it as a record named `OUTPUT` to the default key-value store. To retrieve the record's content, call the [**Get record**](/api/v2#/reference/key-value-stores/record/get-record) endpoint. +If you have a single output JSON, the convention is to return it as a record named `OUTPUT` to the default key-value store. To retrieve the record's content, call the [**Get record**](/api/v2/key-value-store-record-get) endpoint. ```cURL https://api.apify.com/v2/key-value-stores/STORE_ID/records/RECORD_KEY ``` -If you don't know the keys (names) of the records in advance, you can retrieve just the keys with the [**List keys**](https://apify.com/docs/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys) endpoint. +If you don't know the keys (names) of the records in advance, you can retrieve just the keys with the [**List keys**](/api/v2/key-value-store-keys-get) endpoint. Keep in mind that you can get a maximum of 1000 keys per request, so you will need to paginate over the keys using the `exclusiveStartKey` parameter if you have more than 1000 keys. To do this, after each call, take the last record key and provide it as the `exclusiveStartKey` parameter. You can do this until you get 0 keys back. diff --git a/sources/academy/tutorials/node_js/apify_free_google_serp_api.md b/sources/academy/tutorials/node_js/apify_free_google_serp_api.md index 762013cb3a..ac643b365b 100644 --- a/sources/academy/tutorials/node_js/apify_free_google_serp_api.md +++ b/sources/academy/tutorials/node_js/apify_free_google_serp_api.md @@ -12,6 +12,6 @@ You need to regularly grab SERP data about your target keywords? Apify provides Hit `Save & Run` and you'll have the downloaded data as soon as the query finishes. To have it run at a regular frequency, you can set up the task to run on an [automatic schedule](/platform/schedules#setting-up-a-new-schedule). -To run from the API, send a [synchronous POST request]() to an endpoint such as `https://api.apify.com/v2/acts/TASK_NAME_OR_ID/runs?token=YOUR_TOKEN`. Include any required input in a JSON object in the request's body. +To run from the API, send a [synchronous POST request](/api/v2/actor-task-run-sync-get-dataset-items-post) to an endpoint such as `https://api.apify.com/v2/acts/TASK_NAME_OR_ID/runs?token=YOUR_TOKEN`. Include any required input in a JSON object in the request's body. Keep in mind that, as Google search uses a non-deterministic algorithm, output results may vary even if the input settings are exactly the same. diff --git a/sources/academy/tutorials/php/using_apify_from_php.md b/sources/academy/tutorials/php/using_apify_from_php.md index 82809ee73f..a039ae6063 100644 --- a/sources/academy/tutorials/php/using_apify_from_php.md +++ b/sources/academy/tutorials/php/using_apify_from_php.md @@ -35,7 +35,7 @@ $client = new \GuzzleHttp\Client([ Note that we pass the API token in the header. It can also be passed as a query string `token` parameter, but passing it in the header is preferred and more secure. -To check whether everything works well, we'll try to get information about the [current user](/api/v2#/reference/users/private-data/get-private-user-data). +To check whether everything works well, we'll try to get information about the [current user](/api/v2/users-me-get). ```php // Call the endpoint using our client @@ -55,7 +55,7 @@ If, instead of data, you see an error saying `Authentication token is not valid` Now that we have our guzzle client ready to go, we can run some Actors. Let's try the **Contact Details Scraper** ([vdrmota/contact-info-scraper](https://apify.com/vdrmota/contact-info-scraper)). -The [API reference](/api/v2#/reference/actors/run-collection/run-actor) states that an Actor's input should be passed as JSON in the request body. Other options are passed as query parameters. +The [API reference](/api/v2/act-runs-post) states that an Actor's input should be passed as JSON in the request body. Other options are passed as query parameters. ```php // To run the Actor, we make a POST request to its run's endpoint @@ -86,7 +86,7 @@ You should see information about the run, including its ID and the ID of its def ## Getting the results from dataset -Actors usually store their output in a default dataset. The [Actor runs endpoint](/api/v2#/reference/actor-runs) lets you get overall info about an Actor run's default dataset. +Actors usually store their output in a default dataset. The [Actor runs endpoint](/api/v2/actor-runs) lets you get overall info about an Actor run's default dataset. ```php // Replace with the run ID you from earlier @@ -124,7 +124,7 @@ $parsedResponse = \json_decode($response->getBody(), true); echo \json_encode($parsedResponse, JSON_PRETTY_PRINT); ``` -All the available parameters are described in [our API reference](/api/v2#/reference/datasets/item-collection/get-items) and work both for all datasets. +All the available parameters are described in [our API reference](/api/v2/dataset-items-get) and work both for all datasets. ## Getting the results from key-value stores @@ -177,7 +177,7 @@ file_put_contents(__DIR__ . '/hello-world.pdf', $response->getBody()); If you open the generated `hello-world.pdf` file, you should see... well, "Hello World". -If the Actor stored the data in a key-value store other than the default, we can use the standalone endpoints, `key-value-stores/`, `key-value-stores//keys`, and `key-value-stores//records/`. They behave the same way as the default endpoints. [See the full docs](https://docs.apify.com/api/v2#/reference/key-value-stores/store-object). +If the Actor stored the data in a key-value store other than the default, we can use the standalone endpoints, `key-value-stores/`, `key-value-stores//keys`, and `key-value-stores//records/`. They behave the same way as the default endpoints. [See the full docs](/api/v2/storage-key-value-stores). ## When are the data ready diff --git a/sources/platform/actors/development/builds_and_runs/runs.md b/sources/platform/actors/development/builds_and_runs/runs.md index 755d466e94..19f9567a2a 100644 --- a/sources/platform/actors/development/builds_and_runs/runs.md +++ b/sources/platform/actors/development/builds_and_runs/runs.md @@ -16,7 +16,7 @@ When you start an Actor, you create a run. A run is a single execution of your A You can start an Actor in several ways: - Manually from the [Apify Console](https://console.apify.com/actors) UI -- Via the [Apify API](https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor) +- Via the [Apify API](/api/v2/act-runs-post) - Using the [Scheduler](../../../schedules.md) provided by the Apify platform - By one of the available [integrations](../../../integrations/index.mdx) diff --git a/sources/platform/actors/development/programming_interface/container_web_server.md b/sources/platform/actors/development/programming_interface/container_web_server.md index 97c5d95529..aff8b31dfd 100644 --- a/sources/platform/actors/development/programming_interface/container_web_server.md +++ b/sources/platform/actors/development/programming_interface/container_web_server.md @@ -25,7 +25,7 @@ The container web server provides a way how to connect to one specific Actor run You can find the container URL in three locations: - In the web application, on the Actor run details page as the **Container URL** field. -- In the API as the `containerUrl` property of the [Run object](/api/v2#/reference/actors/run-object/get-run). +- In the API as the `containerUrl` property of the [Run object](/api/v2/actor-run-get). - In the Actor run's container as the `ACTOR_WEB_SERVER_URL` environment variable. ## Set up the web server diff --git a/sources/platform/actors/running/runs_and_builds.md b/sources/platform/actors/running/runs_and_builds.md index 78acfaa6ea..ee90723eb4 100644 --- a/sources/platform/actors/running/runs_and_builds.md +++ b/sources/platform/actors/running/runs_and_builds.md @@ -99,7 +99,7 @@ You can abort runs with the statuses **READY**, **RUNNING**, or **TIMING-OUT** i - _Immediately_ - this is the default option. The Actor process is killed immediately with no grace period. - _Gracefully_ - the Actor run receives a signal about aborting via the `aborting` event and is granted a 30-second window to finish in-progress tasks before getting aborted. This is helpful in cases where you plan to resurrect the run later because it gives the Actor a chance to persist its state. When resurrected, the Actor can restart where it left off. -You can abort a run in Apify Console using the **Abort** button or via API using the [Abort run](/api/v2#/reference/actor-runs/abort-run/abort-run) endpoint. +You can abort a run in Apify Console using the **Abort** button or via API using the [Abort run](/v2/actor-run-abort-post) endpoint. ### Resurrection of finished run @@ -111,7 +111,7 @@ The whole process of resurrection looks as follows: - Updated duration will not include the time when the Actor was not running. - Timeout will be counted from the point when this Actor run was resurrected. -Resurrection can be performed in Apify Console using the **resurrect** button or via API using the [Resurrect run](/api/v2#/reference/actors/resurrect-run) API endpoint. +Resurrection can be performed in Apify Console using the **resurrect** button or via API using the [Resurrect run](/api/v2/act-run-resurrect-post) API endpoint. :::info Settings adjustments You can also adjust timeout and memory or change Actor build before the resurrection. This is especially helpful in case of an error in the Actor's source code as it enables you to: diff --git a/sources/platform/actors/running/tasks.md b/sources/platform/actors/running/tasks.md index e181aa2366..132ebb7b67 100644 --- a/sources/platform/actors/running/tasks.md +++ b/sources/platform/actors/running/tasks.md @@ -10,7 +10,7 @@ sidebar_label: Tasks --- -Actor tasks let you create multiple reusable configurations of a single Actor, adapted for specific use cases. For example, you can create one [_Web Scraper_](https://apify.com/apify/web-scraper) configuration (task) that scrapes the latest reviews from imdb.com, another that scrapes nike.com for the latest sneakers, and a third that scrapes your competitor's e-shop. You can then use and reuse these configurations directly from [Apify Console](https://console.apify.com/actors/tasks), [Schedules](../../schedules.md), or [API](/api/v2#/reference/actor-tasks/run-collection/run-task). +Actor tasks let you create multiple reusable configurations of a single Actor, adapted for specific use cases. For example, you can create one [_Web Scraper_](https://apify.com/apify/web-scraper) configuration (task) that scrapes the latest reviews from imdb.com, another that scrapes nike.com for the latest sneakers, and a third that scrapes your competitor's e-shop. You can then use and reuse these configurations directly from [Apify Console](https://console.apify.com/actors/tasks), [Schedules](../../schedules.md), or [API](/api/v2/actor-task-runs-post). You can find all your tasks in the [Apify Console](https://console.apify.com/actors/tasks). @@ -47,7 +47,7 @@ Or using the **Start** button positioned following the input configuration. You can also run tasks using: - [Schedules](../../schedules.md). -- Directly via the [Apify API](/api/v2#/reference/actor-tasks/run-collection/run-task). +- Directly via the [Apify API](/api/v2/actor-task-runs-post). - The [JavaScript API client](/api/client/js/reference/class/TaskClient). - The [Python API client](/api/client/python/reference/class/TaskClient). diff --git a/sources/platform/integrations/actors/index.md b/sources/platform/integrations/actors/index.md index e387eb5685..76e1bbdb79 100644 --- a/sources/platform/integrations/actors/index.md +++ b/sources/platform/integrations/actors/index.md @@ -37,7 +37,7 @@ This leads you to a setup screen, where you can provide: ![Integration trigger select](./images/integration_triggers.png) - **Input for the integrated Actor**: Typically, the input has two parts. The information that is independent of the run triggering it and information that is specific for that run. The "independent" information (e.g. connection string to database or table name) can be added to the input as is. The information specific to the run (e.g. dataset ID) is either obtained from the implicit `payload` field (this is the case for most Actors that are integration-ready), or they can be provided using variables. -- **Available variables** are the same ones as in webhooks. The one that you probably are going to need the most is `{{resource}}`, which is the Run object in the same shape you get from the [API](/api/v2#/reference/actor-runs/run-object-and-its-storages/get-run) (for build event types, it will be the Build object). The variables can make use of dot notation, so you will most likely just need `{{resource.defaultDatasetId}}` or `{{resource.defaultKeyValueStoreId}}`. +- **Available variables** are the same ones as in webhooks. The one that you probably are going to need the most is `{{resource}}`, which is the Run object in the same shape you get from the [API](/api/v2/actor-run-get) (for build event types, it will be the Build object). The variables can make use of dot notation, so you will most likely just need `{{resource.defaultDatasetId}}` or `{{resource.defaultKeyValueStoreId}}`. ## Testing your integration diff --git a/sources/platform/integrations/actors/integrating_actors_via_api.md b/sources/platform/integrations/actors/integrating_actors_via_api.md index 49f8f48b7c..e13fd8133b 100644 --- a/sources/platform/integrations/actors/integrating_actors_via_api.md +++ b/sources/platform/integrations/actors/integrating_actors_via_api.md @@ -14,7 +14,7 @@ import TabItem from '@theme/TabItem'; --- -You can integrate Actors via API using the [Create webhook](/api/v2#/reference/webhooks/webhook-collection/create-webhook) endpoint. It's the same as any other webhook, but to make sure you see it in Apify Console, you need to make sure of a few things. +You can integrate Actors via API using the [Create webhook](/api/v2/webhooks-post) endpoint. It's the same as any other webhook, but to make sure you see it in Apify Console, you need to make sure of a few things. * The `requestUrl` field needs to point to the **Run Actor** or **Run task** endpoints and needs to use their IDs as identifiers (i.e. not their technical names). * The `payloadTemplate` field should be valid JSON - i.e. it should only use variables enclosed in strings. You will also need to make sure that it contains a `payload` field. diff --git a/sources/platform/integrations/programming/api.md b/sources/platform/integrations/programming/api.md index d5d8d34c1a..65a8b34b7e 100644 --- a/sources/platform/integrations/programming/api.md +++ b/sources/platform/integrations/programming/api.md @@ -33,7 +33,7 @@ unless you fully understand the consequences! You can also consider [limiting t You can authenticate the Apify API in two ways. You can either pass the token via the `Authorization` HTTP header or the URL `token` query parameter. We always recommend you use the authentication via the HTTP header as this method is more secure. -Note that some API endpoints, such as [Get list of keys](/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys), +Note that some API endpoints, such as [Get list of keys](/api/v2/key-value-store-keys-get), do not require an authentication token because they contain a hard-to-guess identifier that effectively serves as an authentication key. ## Expiration diff --git a/sources/platform/integrations/programming/webhooks/events.md b/sources/platform/integrations/programming/webhooks/events.md index bd12f73446..f6050fec59 100644 --- a/sources/platform/integrations/programming/webhooks/events.md +++ b/sources/platform/integrations/programming/webhooks/events.md @@ -37,7 +37,7 @@ The following data is provided for Actor run events: } ``` -To fetch the results from the Actor run, you can use the `actorRunId` event property and call one of the [Run object and its storages](/api/v2#/reference/actor-runs/run-object-and-its-storages) API endpoints. For example: +To fetch the results from the Actor run, you can use the `actorRunId` event property and call one of the [Run object and its storages](/api/v2/actor-runs) API endpoints. For example: ```text https://api.apify.com/v2/actor-runs/[ACTOR_RUN_ID]/dataset/items?token=[TOKEN] diff --git a/sources/platform/limits.md b/sources/platform/limits.md index fa62e57381..19c0847350 100644 --- a/sources/platform/limits.md +++ b/sources/platform/limits.md @@ -12,7 +12,7 @@ slug: /limits --- -The tables below demonstrate the Apify platform's default resource limits. For API limits such as rate limits and max payload size, see the [API documentation](https://docs.apify.com/api/v2#/introduction/rate-limiting). +The tables below demonstrate the Apify platform's default resource limits. For API limits such as rate limits and max payload size, see the [API documentation](/api/v2#rate-limiting). > If needed, the limits shown below can be increased on paid accounts. For details, contact us at **[hello@apify.com](mailto:hello@apify.com)** or using the chat in [Apify Console](https://console.apify.com/) under the "Help & Resources → Contact Support". diff --git a/sources/platform/schedules.md b/sources/platform/schedules.md index e0b92ca3c3..ef13cc0048 100644 --- a/sources/platform/schedules.md +++ b/sources/platform/schedules.md @@ -19,11 +19,11 @@ Schedules allow timezone settings and support daylight saving time shifts (DST). You can set up and manage your Schedules using: * [Apify Console](https://console.apify.com/schedules) -* [Apify API](https://docs.apify.com/api/v2#/reference/schedules) +* [Apify API](/api/v2/schedules) * [JavaScript API client](https://docs.apify.com/api/client/js/reference/class/ScheduleClient) * [Python API client](https://docs.apify.com/api/client/python/reference/class/ScheduleClient) -When scheduling a new Actor or task run, you can override its input settings using a JSON object similarly to when invoking an Actor or task using the [Apify REST API](/api/v2#/reference/schedules/). +When scheduling a new Actor or task run, you can override its input settings using a JSON object similarly to when invoking an Actor or task using the [Apify REST API](/api/v2/schedules). :::note Events Startup Variability In most cases, scheduled events are fired within one second of their scheduled time.
@@ -73,12 +73,12 @@ For integrations, you can also add a [webhook](/platform/integrations/webhooks) ### Apify API -To create a new [schedule](/api/v2#/reference/schedules) using the Apify API, send a `POST` request to the [create schedule](/api/v2#/reference/schedules/schedules-collection/create-schedule) endpoint. +To create a new [schedule](/api/v2/schedules) using the Apify API, send a `POST` request to the [create schedule](/api/v2/schedules-post) endpoint. You can find your [secret API token](./integrations/index.mdx) under the [Integrations](https://console.apify.com/account?tab=integrations) tab of your Apify account settings. :::caution API authentication recommendations -When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL ([more info](/api/v2#/introduction/authentication)). +When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL ([more info](/api/v2#authentication)). ::: In the `POST` request's payload should be a JSON object specifying the schedule's name, your [user ID](https://console.apify.com/account#/integrations), and the schedule's _actions_. @@ -110,7 +110,7 @@ If the request is successful, you will receive a `201` [HTTP response code](http You can add multiple Actor and task runs to a schedule with a single `POST` request. Simply add another object with the run's details to the **actions** array in your `POST` request's payload object. -For more information, refer to the [schedules](/api/v2#/reference/schedules/schedule-object/get-schedule) section in our API documentation. +For more information, refer to the [schedules](/api/v2/schedule-get) section in our API documentation. ## Schedule setup diff --git a/sources/platform/storage/dataset.md b/sources/platform/storage/dataset.md index 44781852aa..15e6ba1cca 100644 --- a/sources/platform/storage/dataset.md +++ b/sources/platform/storage/dataset.md @@ -29,7 +29,7 @@ Dataset storage is _append-only_ - data can only be added and cannot be modified You can access your datasets in several ways: - [Apify Console](https://console.apify.com) - provides an easy-to-understand interface. -- [Apify API](/api/v2#) - to access your datasets programmatically. +- [Apify API](/api/v2) - to access your datasets programmatically. - [Apify API client](/api) - to access your datasets from any Node.js/Python application. - [Apify SDKs](/sdk) - when building your own JavaScript/Python Actor. @@ -45,31 +45,31 @@ To view or download a dataset: 2. Select the format & configure other options if desired in **Export dataset** section. 3. Click **Download**. -Utilize the **Actions** menu to modify the dataset's name, which also affects its [retention period](/platform/storage/usage#data-retention), and to adjust [access rights](../collaboration/index.md). The **API** button allows you to explore and test the dataset's [API endpoints](/api/v2#/reference/datasets). +Utilize the **Actions** menu to modify the dataset's name, which also affects its [retention period](/platform/storage/usage#data-retention), and to adjust [access rights](../collaboration/index.md). The **API** button allows you to explore and test the dataset's [API endpoints](/api/v2/storage-datasets). ![Datasets detail view](./images/datasets-detail.png) ### Apify API -The [Apify API](/api/v2#/reference/datasets) enables you programmatic access to your datasets using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). +The [Apify API](/api/v2/storage-datasets) enables you programmatic access to your datasets using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). If you are accessing your datasets using the `username~store-name` [store ID format](./index.md), you will need to use your secret API token. You can find the token (and your user ID) on the [Integrations](https://console.apify.com/account#/integrations)tab of **Settings** page of your Apify account. > When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. ([More info](../integrations/programming/api.md#authentication)). -To retrieve a list of your datasets, send a GET request to the [Get list of datasets](/api/v2#/reference/datasets/dataset-collection/get-list-of-datasets) endpoint. +To retrieve a list of your datasets, send a GET request to the [Get list of datasets](/api/v2/datasets-get) endpoint. ```text https://api.apify.com/v2/datasets ``` -To get information about a dataset such as its creation time and item count, send a GET request to the [Get dataset](/api/v2#/reference/datasets/dataset/get-dataset) endpoint. +To get information about a dataset such as its creation time and item count, send a GET request to the [Get dataset](/api/v2/dataset-get) endpoint. ```text https://api.apify.com/v2/datasets/{DATASET_ID} ``` -To view a dataset's data, send a GET request to the [Get dataset items](/api/v2#/reference/datasets/item-collection/get-items) Apify API endpoint. +To view a dataset's data, send a GET request to the [Get dataset items](/api/v2/dataset-items-get) Apify API endpoint. ```text https://api.apify.com/v2/datasets/{DATASET_ID}/items @@ -89,7 +89,7 @@ https://api.apify.com/v2/datasets/{DATASET_ID}/items?format=json&fields=hotel%2C > Use `%2C` instead of commas for URL encoding, as `%2C` represent a comma. For more on URL encoding check out [this page](https://www.url-encode-decode.com) -To add data to a dataset, issue a POST request to the [Put items](/api/v2#/reference/datasets/item-collection/put-items) endpoint with the data as a JSON object payload. +To add data to a dataset, issue a POST request to the [Put items](/api/v2/dataset-items-post) endpoint with the data as a JSON object payload. ```text https://api.apify.com/v2/datasets/{DATASET_ID}/items @@ -113,7 +113,7 @@ Example payload: ] ``` -For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2#/reference/datasets). +For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2/storage-datasets). ### Apify API Clients @@ -300,7 +300,7 @@ The following example demonstrates a dataset record with hidden fields, includin } ``` -Data excluding hidden fields, termed as "clean" data, can be downloaded from the [Apify Console](https://console.apify.com/storage?tab=datasets) using the **Clean items** option. Alternatively, you can download it via API by applying `clean=true` or `clean=1` as [URL parameters](/api/v2#/reference/datasets/item-collection/get-items). +Data excluding hidden fields, termed as "clean" data, can be downloaded from the [Apify Console](https://console.apify.com/storage?tab=datasets) using the **Clean items** option. Alternatively, you can download it via API by applying `clean=true` or `clean=1` as [URL parameters](/api/v2/dataset-items-get). ## XML format extension @@ -452,8 +452,8 @@ See the [Storage overview](/platform/storage/usage#sharing-storages-between-runs ### Rate limiting {#rate-limiting} -The rate limit for pushing data to a dataset through the [API](/api/v2#/reference/datasets/item-collection/put-items) is capped at _200 requests per second_ for each dataset, a measure to prevent overloading Apify servers. +The rate limit for pushing data to a dataset through the [API](/api/v2/dataset-items-post) is capped at _200 requests per second_ for each dataset, a measure to prevent overloading Apify servers. -For all other dataset [API endpoints](/api/v2#/reference/datasets) , the rate limit is _30 requests per second_ for each dataset. +For all other dataset [API endpoints](/api/v2/storage-datasets) , the rate limit is _30 requests per second_ for each dataset. -Check out the [API documentation](/api/v2#/introduction/rate-limiting) for more information and guidance on actions to take if you exceed these rate limits. +Check out the [API documentation](/api/v2#rate-limiting) for more information and guidance on actions to take if you exceed these rate limits. diff --git a/sources/platform/storage/key_value_store.md b/sources/platform/storage/key_value_store.md index 6176a66d02..95941d9a79 100644 --- a/sources/platform/storage/key_value_store.md +++ b/sources/platform/storage/key_value_store.md @@ -29,7 +29,7 @@ Key-value stores are mutable–you can both add entries and delete them. You can access key-value stores through several methods - [Apify Console](https://console.apify.com) - provides an easy-to-understand interface. -- [Apify API](/api/v2#) - for accessing your key-value stores programmatically. +- [Apify API](/api/v2) - for accessing your key-value stores programmatically. - [Apify API clients](/api) - to access your key-value stores from any Node.js/Python application. - [Apify SDKs](/sdk) - when building your own JavaScript/Python Actor. @@ -41,37 +41,37 @@ In [Apify Console](https://console.apify.com), you can view your key-value store To view a key-value store's content, click on its **Store ID**. Under the **Actions** menu, you can rename your store (and, in turn extend its [retention period](/platform/storage/usage#named-and-unnamed-storages)) and grant [access rights](../collaboration/index.md) using the **Share** button. -Click on the **API** button to view and test a store's [API endpoints](/api/v2#/reference/key-value-stores). +Click on the **API** button to view and test a store's [API endpoints](/api/v2/storage-key-value-stores). ![Key-value stores detail](./images/key-value-stores-detail.png) ### Apify API -The [Apify API](/api/v2#/reference/key-value-stores) enables you programmatic access to your key-value stores using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). +The [Apify API](/api/v2/storage-key-value-stores) enables you programmatic access to your key-value stores using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). If you are accessing your datasets using the `username~store-name` [store ID format](./index.md), you will need to use your secret API token. You can find the token (and your user ID) on the [Integrations](https://console.apify.com/account#/integrations) tab of **Settings** page of your Apify account. > When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. ([More info](../integrations/programming/api.md#authentication)). -To retrieve a list of your key-value stores, send a GET request to the [Get list of key-value stores](/api/v2#/reference/key-value-stores/store-collection/get-list-of-key-value-stores) endpoint. +To retrieve a list of your key-value stores, send a GET request to the [Get list of key-value stores](/api/v2/key-value-stores-get) endpoint. ```text https://api.apify.com/v2/key-value-stores ``` -To get information about a key-value store such as its creation time and item count, send a GET request to the [Get store](/api/v2#/reference/key-value-stores/store-object/get-store) endpoint. +To get information about a key-value store such as its creation time and item count, send a GET request to the [Get store](/api/v2/key-value-store-get) endpoint. ```text https://api.apify.com/v2/key-value-stores/{STORE_ID} ``` -To get a record (its value) from a key-value store, send a GET request to the [Get record](/api/v2#/reference/key-value-stores/key-collection/get-record) endpoint. +To get a record (its value) from a key-value store, send a GET request to the [Get record](/api/v2/key-value-store-record-get) endpoint. ```text https://api.apify.com/v2/key-value-stores/{STORE_ID}/records/{KEY_ID} ``` -To add a record with a specific key in a key-value store, send a PUT request to the [Put record](/api/v2#/reference/key-value-stores/record/put-record) endpoint. +To add a record with a specific key in a key-value store, send a PUT request to the [Store record](/api/v2/key-value-store-record-put) endpoint. ```text https://api.apify.com/v2/key-value-stores/{STORE_ID}/records/{KEY_ID} @@ -86,13 +86,13 @@ Example payload: } ``` -To delete a record, send a DELETE request specifying the key from a key-value store to the [Delete record](/api/v2#/reference/key-value-stores/record/delete-record) endpoint. +To delete a record, send a DELETE request specifying the key from a key-value store to the [Delete record](/api/v2/key-value-store-record-delete) endpoint. ```text https://api.apify.com/v2/key-value-stores/{STORE_ID}/records/{KEY_ID} ``` -For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2#/reference/key-value-stores). +For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2/storage-key-value-stores). ### Apify API Clients @@ -248,7 +248,7 @@ Check out the [Python SDK documentation](/sdk/python/docs/concepts/storages#work ## Compression -Previously, when using the [Put record](/api/v2#/reference/key-value-stores/record/put-record) endpoint, every record was automatically compressed with Gzip before being uploaded. However, this process has been updated. _Now, records are stored exactly as you upload them._ This change means that it is up to you whether the record is stored compressed or uncompressed. +Previously, when using the [Store record](/api/v2/key-value-store-record-put) endpoint, every record was automatically compressed with Gzip before being uploaded. However, this process has been updated. _Now, records are stored exactly as you upload them._ This change means that it is up to you whether the record is stored compressed or uncompressed. You can compress a record and use the [Content-Encoding request header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding) to let our platform know which compression it uses. We recommend compressing large key-value records to save storage space and network traffic. diff --git a/sources/platform/storage/request_queue.md b/sources/platform/storage/request_queue.md index 5702a4b08e..04ab0377f9 100644 --- a/sources/platform/storage/request_queue.md +++ b/sources/platform/storage/request_queue.md @@ -25,7 +25,7 @@ The storage system for request queues accommodates both breadth-first and depth- You can access your request queues in several ways: - [Apify Console](https://console.apify.com) - provides an easy-to-understand interface. -- [Apify API](/api/v2#) - for accessing your request queues programmatically. +- [Apify API](/api/v2) - for accessing your request queues programmatically. - [Apify API clients](/api) - to access your request queues from any Node.js application. - [Apify SDK](/sdk) - when building your own JavaScript Actor. @@ -38,37 +38,37 @@ In the [Apify Console](https://console.apify.com), you can view your request que To view a request queue, click on its **Queue ID**. Under the **Actions** menu, you can rename your queue's name (and, in turn, its [retention period](/platform/storage/usage#named-and-unnamed-storages)) and [access rights](../collaboration/index.md) using the **Share** button. -Click on the **API** button to view and test a queue's [API endpoints](/api/v2#/reference/request-queues). +Click on the **API** button to view and test a queue's [API endpoints](/api/v2/storage-request-queues). ![Request queues detail](./images/request-queue-detail.png) ### Apify API -The [Apify API](/api/v2#/reference/request-queues) allows you programmatic access to your request queues using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). +The [Apify API](/api/v2/storage-request-queues) allows you programmatic access to your request queues using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). If you are accessing your datasets using the `username~store-name` [store ID format](./index.md), you will need to use your secret API token. You can find the token (and your user ID) on the [Integrations](https://console.apify.com/account#/integrations) page of your Apify account. > When providing your API authentication token, we recommend using the request's `Authorization` header, rather than the URL. ([More info](../integrations/programming/api.md#authentication)). -To get a list of your request queues, send a GET request to the [Get list of request queues](/api/v2#/reference/request-queues/store-collection/get-list-of-request-queues) endpoint. +To get a list of your request queues, send a GET request to the [Get list of request queues](/api/v2/request-queues-get) endpoint. ```text https://api.apify.com/v2/request-queues ``` -To get information about a request queue such as its creation time and item count, send a GET request to the [Get request queue](/api/v2#/reference/request-queues/queue/get-request-queue) endpoint. +To get information about a request queue such as its creation time and item count, send a GET request to the [Get request queue](/api/v2/request-queue-get) endpoint. ```text https://api.apify.com/v2/request-queues/{QUEUE_ID} ``` -To get a request from a queue, send a GET request to the [Get request](/api/v2#/reference/request-queues/request/get-request) endpoint. +To get a request from a queue, send a GET request to the [Get request](/api/v2/request-queue-request-get) endpoint. ```text https://api.apify.com/v2/request-queues/{QUEUE_ID}/requests/{REQUEST_ID} ``` -To add a request to a queue, send a POST request with the request to be added as a JSON object in the request's payload to the [Add request](/api/v2#/reference/request-queues/request-collection/add-request) endpoint. +To add a request to a queue, send a POST request with the request to be added as a JSON object in the request's payload to the [Add request](/api/v2/request-queue-requests-post) endpoint. ```text https://api.apify.com/v2/request-queues/{QUEUE_ID}/requests @@ -84,7 +84,7 @@ Example payload: } ``` -To update a request in a queue, send a PUT request with the request to update as a JSON object in the request's payload to the [Update request](/api/v2#/reference/request-queues/request/update-request) endpoint. In the payload, specify the request's ID and add the information you want to update. +To update a request in a queue, send a PUT request with the request to update as a JSON object in the request's payload to the [Update request](/api/v2/request-queue-request-put) endpoint. In the payload, specify the request's ID and add the information you want to update. ```text https://api.apify.com/v2/request-queues/{QUEUE_ID}/requests/{REQUEST_ID} @@ -101,11 +101,11 @@ Example payload: } ``` -> When adding or updating requests, you can optionally provide a `clientKey` parameter to your request. It must be a string between 1 and 32 characters in length. This identifier is used to determine whether the queue was accessed by [multiple clients](#sharing). If `clientKey` is not provided, the system considers this API call to come from a new client. See the `hadMultipleClients` field returned by the [`Get head`](/api/v2#/reference/request-queues/queue-head/get-head) operation for details.
+> When adding or updating requests, you can optionally provide a `clientKey` parameter to your request. It must be a string between 1 and 32 characters in length. This identifier is used to determine whether the queue was accessed by [multiple clients](#sharing). If `clientKey` is not provided, the system considers this API call to come from a new client. See the `hadMultipleClients` field returned by the [`Get head`](/api/v2/request-queue-head-get) operation for details.
> > Example: `client-abc` -For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2#/reference/key-value-stores). +For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2/storage-key-value-stores). ### Apify API Clients @@ -338,7 +338,7 @@ await Actor.exit(); ### Batch operations Request queues support batch operations on requests to enqueue or retrieve multiple requests in bulk, to cut down on network latency and enable easier parallel processing of requests. -You can find the batch operations in the [Apify API](https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations), as well in the Apify API client for [JavaScript](https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#batchAddRequests) and [Python](https://docs.apify.com/api/client/python/reference/class/RequestQueueClient#batch_add_requests). +You can find the batch operations in the [Apify API](/api/v2/storage-request-queues), as well in the Apify API client for [JavaScript](https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#batchAddRequests) and [Python](https://docs.apify.com/api/client/python/reference/class/RequestQueueClient#batch_add_requests). @@ -622,13 +622,13 @@ Check out the [Storage overview](/platform/storage/usage#sharing-storages-betwee ### Rate limiting {#rate-limiting} -When managing request queues via [API](/api/v2#/reference/request-queues/put-items), -CRUD ([add](/api/v2#/reference/request-queues/request-collection/add-request), -[get](/api/v2#/reference/request-queues/request-collection/get-request), -[update](/api/v2#/reference/request-queues/request-collection/update-request), -[delete](/api/v2#/reference/request-queues/request-collection/delete-request)) +When managing request queues via [API](/api/v2/storage-request-queues-requests), +CRUD ([add](/api/v2/request-queue-requests-post), +[get](/api/v2/request-queue-request-get), +[update](/api/v2/request-queue-request-put), +[delete](/api/v2/request-queue-request-delete)) operation requests are limited to _200 requests per second_ per request queue. This helps protect Apify servers from being overloaded. -All other request queue API [endpoints](/api/v2#/reference/request-queues) are limited to _30 requests per second_ per request queue. +All other request queue API [endpoints](/api/v2/storage-request-queues) are limited to _30 requests per second_ per request queue. -Check out the [API documentation](/api/v2#/introduction/rate-limiting) for more information and guidance on actions to take if you exceed these rate limits. +Check out the [API documentation](/api/v2#rate-limiting) for more information and guidance on actions to take if you exceed these rate limits. diff --git a/sources/platform/storage/usage.md b/sources/platform/storage/usage.md index f57507b940..b3dcff7b54 100644 --- a/sources/platform/storage/usage.md +++ b/sources/platform/storage/usage.md @@ -34,7 +34,7 @@ The [key-value store](./key_value_store.md) is ideal for saving data records suc You can access your storage in several ways: * [Apify Console](https://console.apify.com/storage) - provides an easy-to-use interface. -* [Apify API](/api/v2#/reference/key-value-stores) - to access your storages programmatically. +* [Apify API](/api/v2/storage-key-value-stores) - to access your storages programmatically. * [API clients](/api) - to access your storages from any Node.js/Python application. * [Apify SDKs](/sdk) - when building your own JavaScript/Python Actor. @@ -53,7 +53,7 @@ Additionally, you can quickly share the contents and details of your storage by ![Storage API](./images/overview-api.png) -These URLs link to API _endpoints_—the places where your data is stored. Endpoints that allow you to _read_ stored information do not require an [authentication token](/api/v2#/introduction/authentication). Calls are authenticated using a hard-to-guess ID, allowing for secure sharing. However, operations such as _update_ or _delete_ require the authentication token. +These URLs link to API _endpoints_—the places where your data is stored. Endpoints that allow you to _read_ stored information do not require an [authentication token](/api/v2#authentication). Calls are authenticated using a hard-to-guess ID, allowing for secure sharing. However, operations such as _update_ or _delete_ require the authentication token. > Never share a URL containing your authentication token, to avoid compromising your account's security.
@@ -61,7 +61,7 @@ These URLs link to API _endpoints_—the places where your data is stored. Endpo ### Apify API {#apify-api} -The [Apify API](/api/v2#/reference/key-value-stores) allows you to access your storages programmatically using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) and easily share your crawling results. +The [Apify API](/api/v2/storage-key-value-stores) allows you to access your storages programmatically using [HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) and easily share your crawling results. In most cases, when accessing your storages via API, you will need to provide a `store ID`, which you can do in the following formats: @@ -71,9 +71,9 @@ In most cases, when accessing your storages via API, you will need to provide a For read (GET) requests, it is enough to use a store's alphanumerical ID, since the ID is hard to guess and effectively serves as an authentication key. -With other request types and when using the `username~store-name`, however, you will need to provide your secret API token in your request's [`Authorization`](/api/v2#/introduction/authentication) header or as a query parameter. You can find your token on the [Integrations](https://console.apify.com/account?tab=integrations) page of your Apify account. +With other request types and when using the `username~store-name`, however, you will need to provide your secret API token in your request's [`Authorization`](/api/v2#authentication) header or as a query parameter. You can find your token on the [Integrations](https://console.apify.com/account?tab=integrations) page of your Apify account. -For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2#/reference/datasets). +For further details and a breakdown of each storage API endpoint, refer to the [API documentation](/api/v2/storage-datasets). ### Apify API Clients @@ -92,11 +92,11 @@ The Apify SDKs are libraries in JavaScript or Python that provide tools for buil All API endpoints limit their rate of requests to protect Apify servers from overloading. The default rate limit for storage objects is _30 requests per second_. However, there are exceptions limited to _200 requests per second_ per storage object, including: -* [Push items](/api/v2#/reference/datasets/item-collection/put-items) to dataset. -* CRUD ([add](/api/v2#/reference/request-queues/request-collection/add-request), -[get](/api/v2#/reference/request-queues/request-collection/get-request), -[update](/api/v2#/reference/request-queues/request-collection/update-request), -[delete](/api/v2#/reference/request-queues/request-collection/delete-request)) +* [Push items](/api/v2/dataset-items-post) to dataset. +* CRUD ([add](/api/v2/request-queue-requests-post), +[get](/api/v2/request-queue-request-get), +[update](/api/v2/request-queue-request-put), +[delete](/api/v2/request-queue-request-delete)) operations of _request queue_ requests. If a client exceeds this limit, the API endpoints respond with the HTTP status code `429 Too Many Requests` and the following body: @@ -110,7 +110,7 @@ If a client exceeds this limit, the API endpoints respond with the HTTP status c } ``` -Go to the [API documentation](/api/v2#/introduction/rate-limiting) for details and to learn what to do if you exceed the rate limit. +Go to the [API documentation](/api/v2#rate-limiting) for details and to learn what to do if you exceed the rate limit. ## Data retention {#data-retention} @@ -124,7 +124,7 @@ To ensure indefinite retention of your storages, assign them a name. This can be Find and open your storage by clicking the ID, click on the **Actions** menu, choose **Rename**, and enter its new name in the field. Your storage will now be preserved indefinitely. -To name your storage via API, get its ID from the run that generated it using the [Get run](/api/v2#/reference/actor-runs/run-object-and-its-storages/get-run) endpoint. You can then give it a new name using the `Update \[storage\]` endpoint. For example, [Update dataset](/api/v2#/reference/datasets/dataset/update-dataset). +To name your storage via API, get its ID from the run that generated it using the [Get run](/api/v2/actor-run-get) endpoint. You can then give it a new name using the `Update \[storage\]` endpoint. For example, [Update dataset](/api/v2/dataset-put). Our SDKs and clients each have unique naming conventions for storages. For more information check out documentation: @@ -178,4 +178,4 @@ or [request queue](/api/client/js/reference/class/RequestQueueClient) clients. [dataset](/api/client/python#datasetclient), [key-value store](/api/client/python/reference/class/KeyValueStoreClient), or [request queue](/api/client/python/reference/class/RequestQueueClient) clients. -* [API](/api/v2#/reference/key-value-stores/store-object/delete-store) using the - `Delete [store]` endpoint, where `[store]` is the type of storage you want to delete. +* [API](/api/v2/key-value-store-delete) using the - `Delete [store]` endpoint, where `[store]` is the type of storage you want to delete. From d3e15c188db7372b54447bd035ce4fdc021a7f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Tue, 15 Jul 2025 23:11:23 +0200 Subject: [PATCH 2/6] fix mdlint --- sources/academy/platform/getting_started/apify_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/academy/platform/getting_started/apify_api.md b/sources/academy/platform/getting_started/apify_api.md index b55cb6149e..2d0f9130e9 100644 --- a/sources/academy/platform/getting_started/apify_api.md +++ b/sources/academy/platform/getting_started/apify_api.md @@ -45,7 +45,7 @@ Let's say we want to run our **adding-actor** via API and view its results in CS https://api.apify.com/v2/acts/YOUR_USERNAME~adding-actor/run-sync-get-dataset-items?token=YOUR_TOKEN_HERE&format=csv ``` -Additional parameters can be passed to this endpoint. You can learn about them [here](/api/v2/act-run-sync-get-dataset-items-post) +Additional parameters can be passed to this endpoint. You can learn about them in our [API documentation](/api/v2/act-run-sync-get-dataset-items-post) > Network components can record visited URLs, so it's more secure to send the token as a HTTP header, not as a parameter. The header should look like `Authorization: Bearer YOUR_TOKEN`. Popular HTTP clients, such as [Postman](../../glossary/tools/postman.md) or [Insomnia](../../glossary/tools/insomnia.md), provide a convenient way to configure the Authorization header for all your API requests. From 57a706b150de8c453461384ac8449555de40e065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Tue, 15 Jul 2025 23:15:24 +0200 Subject: [PATCH 3/6] fix mdlint --- sources/academy/platform/getting_started/apify_client.md | 2 +- sources/academy/platform/running_a_web_server.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/academy/platform/getting_started/apify_client.md b/sources/academy/platform/getting_started/apify_client.md index 0389e792ca..04bd7d8511 100644 --- a/sources/academy/platform/getting_started/apify_client.md +++ b/sources/academy/platform/getting_started/apify_client.md @@ -114,7 +114,7 @@ run = client.actor('YOUR_USERNAME/adding-actor').call(run_input={
-> Learn more about the `.call()` function [here](/api/client/js/reference/class/ApifyClient#actor). +> Learn more about the `.call()` function in our [API documentation](/api/client/js/reference/class/ApifyClient#actor). ## Downloading dataset items {#downloading-dataset-items} diff --git a/sources/academy/platform/running_a_web_server.md b/sources/academy/platform/running_a_web_server.md index e3e9cbb032..13d78164ca 100644 --- a/sources/academy/platform/running_a_web_server.md +++ b/sources/academy/platform/running_a_web_server.md @@ -236,4 +236,4 @@ When we deploy and run this Actor on the Apify platform, then we can open the ** With that, we're done! And our application works like a charm :) -The complete code of this Actor is available [here](https://apify.com/apify/example-web-server). You can run it there or copy it to your account. +The complete code of this Actor is available at it's [page](https://apify.com/apify/example-web-server). You can run it there or copy it to your account. From 1a51365e646dcd953c00a8c5b7513bd78cfd0a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Tue, 15 Jul 2025 23:18:22 +0200 Subject: [PATCH 4/6] fix broken link --- sources/platform/actors/running/runs_and_builds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/platform/actors/running/runs_and_builds.md b/sources/platform/actors/running/runs_and_builds.md index ee90723eb4..e6176b1197 100644 --- a/sources/platform/actors/running/runs_and_builds.md +++ b/sources/platform/actors/running/runs_and_builds.md @@ -99,7 +99,7 @@ You can abort runs with the statuses **READY**, **RUNNING**, or **TIMING-OUT** i - _Immediately_ - this is the default option. The Actor process is killed immediately with no grace period. - _Gracefully_ - the Actor run receives a signal about aborting via the `aborting` event and is granted a 30-second window to finish in-progress tasks before getting aborted. This is helpful in cases where you plan to resurrect the run later because it gives the Actor a chance to persist its state. When resurrected, the Actor can restart where it left off. -You can abort a run in Apify Console using the **Abort** button or via API using the [Abort run](/v2/actor-run-abort-post) endpoint. +You can abort a run in Apify Console using the **Abort** button or via API using the [Abort run](/api/v2/actor-run-abort-post) endpoint. ### Resurrection of finished run From 3cc7e0793bf7ebbea5ff47beddc5fe293d9a1407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 16 Jul 2025 16:46:06 +0200 Subject: [PATCH 5/6] fix link to store --- sources/academy/platform/running_a_web_server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/academy/platform/running_a_web_server.md b/sources/academy/platform/running_a_web_server.md index 13d78164ca..f8e43d383c 100644 --- a/sources/academy/platform/running_a_web_server.md +++ b/sources/academy/platform/running_a_web_server.md @@ -236,4 +236,4 @@ When we deploy and run this Actor on the Apify platform, then we can open the ** With that, we're done! And our application works like a charm :) -The complete code of this Actor is available at it's [page](https://apify.com/apify/example-web-server). You can run it there or copy it to your account. +The complete code of this Actor is available on its Store [page](https://apify.com/apify/example-web-server/source-code). You can run it there or copy it to your account. From f9270aec0e0c620cc509b2623d318ad351e17cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Thu, 17 Jul 2025 00:11:40 +0200 Subject: [PATCH 6/6] fix deleted section --- sources/academy/platform/getting_started/apify_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/academy/platform/getting_started/apify_api.md b/sources/academy/platform/getting_started/apify_api.md index 2d0f9130e9..1ff4bfe678 100644 --- a/sources/academy/platform/getting_started/apify_api.md +++ b/sources/academy/platform/getting_started/apify_api.md @@ -11,7 +11,7 @@ slug: /getting-started/apify-api --- -[Apify's API](/api/v2) web-interface. The API is organized around RESTful HTTP endpoints. +[Apify's API](/api/v2) is your ticket to the Apify platform without even needing to access the [Apify Console](https://console.apify.com?asrc=developers_portal) web-interface. The API is organized around RESTful HTTP endpoints. In this lesson, we'll be learning how to use the Apify API to call an Actor and view its results. We'll be using the Actor we created in the previous lesson, so if you haven't already gotten that one set up, go ahead do that before moving forward if you'd like to follow along.