From e4e2203cc41bf208ef84d9d21cdb29f6999be557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= <92638966+TC-MO@users.noreply.github.com> Date: Wed, 7 Jan 2026 12:50:09 +0100 Subject: [PATCH 1/6] docs: consolidate overview page --- docs/01_overview/01_introduction.mdx | 26 ---- docs/01_overview/02_setting_up.mdx | 71 ----------- docs/01_overview/03_getting_started.mdx | 74 ------------ docs/01_overview/overview.mdx | 153 ++++++++++++++++++++++++ 4 files changed, 153 insertions(+), 171 deletions(-) delete mode 100644 docs/01_overview/01_introduction.mdx delete mode 100644 docs/01_overview/02_setting_up.mdx delete mode 100644 docs/01_overview/03_getting_started.mdx create mode 100644 docs/01_overview/overview.mdx diff --git a/docs/01_overview/01_introduction.mdx b/docs/01_overview/01_introduction.mdx deleted file mode 100644 index 0b49f85d..00000000 --- a/docs/01_overview/01_introduction.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: introduction -title: Introduction ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; -import CodeBlock from '@theme/CodeBlock'; - -import UsageAsyncExample from '!!raw-loader!./code/01_usage_async.py'; -import UsageSyncExample from '!!raw-loader!./code/01_usage_sync.py'; - -The [Apify client for Python](https://github.com/apify/apify-client-python) is the official library to access the [Apify REST API](https://docs.apify.com/api/v2) from your Python applications. It provides useful features like automatic retries and convenience functions that improve the experience of using the Apify API. All requests and responses (including errors) are encoded in JSON format with UTF-8 encoding. The client provides both synchronous and asynchronous interfaces. - - - - - {UsageAsyncExample} - - - - - {UsageSyncExample} - - - diff --git a/docs/01_overview/02_setting_up.mdx b/docs/01_overview/02_setting_up.mdx deleted file mode 100644 index ef67a98c..00000000 --- a/docs/01_overview/02_setting_up.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -id: setting-up -title: Setting up ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; -import CodeBlock from '@theme/CodeBlock'; - -import AsyncExample from '!!raw-loader!./code/02_auth_async.py'; -import SyncExample from '!!raw-loader!./code/02_auth_sync.py'; - -This guide will help you get started with [Apify client for Python](https://github.com/apify/apify-client-python) by setting it up on your computer. Follow the steps below to ensure a smooth installation process. - -## Prerequisites - -Before installing `apify-client` itself, make sure that your system meets the following requirements: - -- **Python 3.10 or higher**: `apify-client` requires Python 3.10 or a newer version. You can download Python from the [official website](https://www.python.org/downloads/). -- **Python package manager**: While this guide uses Pip (the most common package manager), you can also use any package manager you want. You can download Pip from the [official website](https://pip.pypa.io/en/stable/installation/). - -### Verifying prerequisites - -To check if Python and the Pip package manager are installed, run the following commands: - -```sh -python --version -``` - -```sh -pip --version -``` - -If these commands return the respective versions, you're ready to continue. - -## Installation - -Apify client for Python is available as the [`apify-client`](https://pypi.org/project/apify-client/) package on PyPI. To install it, run: - -```sh -pip install apify-client -``` - -After installation, verify that `apify-client` is installed correctly by checking its version: - -```sh -python -c 'import apify_client; print(apify_client.__version__)' -``` - -## Authentication and initialization - -To use the client, you need an [API token](https://docs.apify.com/platform/integrations/api#api-token). You can find your token under [Integrations](https://console.apify.com/account/integrations) tab in Apify Console. Copy the token and initialize the client by providing the token (`MY-APIFY-TOKEN`) as a parameter to the `ApifyClient` constructor. - - - - - {AsyncExample} - - - - - {SyncExample} - - - - -:::warning Secure access - -The API token is used to authorize your requests to the Apify API. You can be charged for the usage of the underlying services, so do not share your API token with untrusted parties or expose it on the client side of your applications. - -::: diff --git a/docs/01_overview/03_getting_started.mdx b/docs/01_overview/03_getting_started.mdx deleted file mode 100644 index 43b128d0..00000000 --- a/docs/01_overview/03_getting_started.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: getting-started -title: Getting started ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; -import CodeBlock from '@theme/CodeBlock'; - -import UsageAsyncExample from '!!raw-loader!./code/01_usage_async.py'; -import UsageSyncExample from '!!raw-loader!./code/01_usage_sync.py'; -import InputAsyncExample from '!!raw-loader!./code/03_input_async.py'; -import InputSyncExample from '!!raw-loader!./code/03_input_sync.py'; -import DatasetAsyncExample from '!!raw-loader!./code/03_dataset_async.py'; -import DatasetSyncExample from '!!raw-loader!./code/03_dataset_sync.py'; - -This guide will walk you through how to use the [Apify Client for Python](https://github.com/apify/apify-client-python) to run [Actors](https://apify.com/actors) on the [Apify platform](https://docs.apify.com/platform), provide input to them, and retrieve results from their datasets. You'll learn the basics of running serverless programs (we're calling them Actors) and managing their output efficiently. - -## Running your first Actor - -To start an Actor, you need its ID (e.g., `john-doe/my-cool-actor`) and an API token. The Actor's ID is a combination of the username and the Actor owner's username. Use the [`ActorClient`](/reference/class/ActorClient) to run the Actor and wait for it to complete. You can run both your own Actors and [Actors from Apify store](https://docs.apify.com/platform/actors/running/actors-in-store). - - - - - {UsageAsyncExample} - - - - - {UsageSyncExample} - - - - -## Providing input to Actor - -Actors often require input, such as URLs to scrape, search terms, or other configuration data. You can pass input as a JSON object when starting the Actor using the [`ActorClient.call`](/reference/class/ActorClient#call) method. Actors respect the input schema defined in the Actor's [input schema](https://docs.apify.com/platform/actors/development/actor-definition/input-schema). - - - - - {InputAsyncExample} - - - - - {InputSyncExample} - - - - -## Getting results from the dataset - -To get the results from the dataset, you can use the [`DatasetClient`](/reference/class/DatasetClient) ([`ApifyClient.dataset`](/reference/class/ApifyClient#dataset) ) and [`DatasetClient.list_items`](/reference/class/DatasetClient#list_items) method. You need to pass the dataset ID to define which dataset you want to access. You can get the dataset ID from the Actor's run dictionary (represented by `defaultDatasetId`). - - - - - {InputAsyncExample} - - - - - {InputSyncExample} - - - - -:::note Dataset access - -Running an Actor might take time, depending on the Actor's complexity and the amount of data it processes. If you want only to get data and have an immediate response you should access the existing dataset of the finished [Actor run](https://docs.apify.com/platform/actors/running/runs-and-builds#runs). - -::: diff --git a/docs/01_overview/overview.mdx b/docs/01_overview/overview.mdx new file mode 100644 index 00000000..d8ba62d3 --- /dev/null +++ b/docs/01_overview/overview.mdx @@ -0,0 +1,153 @@ +--- +id: overview +title: Overview +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import CodeBlock from '@theme/CodeBlock'; + +import AuthAsyncExample from '!!raw-loader!./code/02_auth_async.py'; +import AuthSyncExample from '!!raw-loader!./code/02_auth_sync.py'; +import UsageAsyncExample from '!!raw-loader!./code/01_usage_async.py'; +import UsageSyncExample from '!!raw-loader!./code/01_usage_sync.py'; +import InputAsyncExample from '!!raw-loader!./code/03_input_async.py'; +import InputSyncExample from '!!raw-loader!./code/03_input_sync.py'; +import DatasetAsyncExample from '!!raw-loader!./code/03_dataset_async.py'; +import DatasetSyncExample from '!!raw-loader!./code/03_dataset_sync.py'; + +## Introduction + +The [Apify client for Python](https://github.com/apify/apify-client-python) is the official library to access the [Apify REST API](/api/v2) from your Python applications. It provides useful features like automatic retries and convenience functions that improve the experience of using the Apify API. + +Key features: + +- **Synchronous and asynchronous interfaces** for flexible integration +- **Automatic retries** for improved reliability +- **JSON encoding** with UTF-8 for all requests and responses +- **Comprehensive API coverage** for [Actors](), [datasets](), [key-value stores](), and more + +## Prerequisites + +Before installing the Apify client, ensure your system meets the following requirements: + +- **Python 3.10 or higher**: You can download Python from the [official website](https://www.python.org/downloads/). +- **Python package manager**: While this guide uses Pip (the most common package manager), you can also use any package manager you want. You can download Pip from the [official website](https://pip.pypa.io/en/stable/installation/). + +To verify that Python and Pip are installed, run the following commands: + +```sh +python --version +``` + +```sh +pip --version +``` + +If these commands return the respective versions, you're ready to continue. + +## Installation + +The Apify client is available as the [`apify-client`](https://pypi.org/project/apify-client/) package on PyPI. To install it, run: + +```sh +pip install apify-client +``` + +After installation, verify that the client is installed correctly by checking its version: + +```sh +python -c 'import apify_client; print(apify_client.__version__)' +``` + +## Authentication and initialization + +To use the client, you need an [API token](/platform/integrations/api#api-token). You can find your token under the [Integrations](https://console.apify.com/account/integrations) tab in Apify Console. Copy the token and initialize the client by providing it as a parameter to the `ApifyClient` constructor. + + + + + {AuthAsyncExample} + + + + + {AuthSyncExample} + + + + +:::warning Secure access + +The API token is used to authorize your requests to the Apify API. You can be charged for the usage of the underlying services, so do not share your API token with untrusted parties or expose it on the client side of your applications. + +::: + +## Quick start + +Now that you have the client set up, let's explore how to run Actors on the Apify platform, provide input to them, and retrieve their results. + +### Running your first Actor + +To start an Actor, you need its ID (e.g., `john-doe/my-cool-actor`) and an API token. The Actor's ID is a combination of the Actor name and the Actor owner's username. Use the [`ActorClient`](/reference/class/ActorClient) to run the Actor and wait for it to complete. You can run both your own Actors and [Actors from Apify Store](https://docs.apify.com/platform/actors/running/actors-in-store). + + + + + {UsageAsyncExample} + + + + + {UsageSyncExample} + + + + +### Providing input to Actor + +Actors often require input, such as URLs to scrape, search terms, or other configuration data. You can pass input as a JSON object when starting the Actor using the [`ActorClient.call`](/reference/class/ActorClient#call) method. Actors respect the input schema defined in the Actor's [input schema](https://docs.apify.com/platform/actors/development/actor-definition/input-schema). + + + + + {InputAsyncExample} + + + + + {InputSyncExample} + + + + +### Getting results from the dataset + +To get the results from the dataset, you can use the [`DatasetClient`](/reference/class/DatasetClient) ([`ApifyClient.dataset`](/reference/class/ApifyClient#dataset)) and [`DatasetClient.list_items`](/reference/class/DatasetClient#list_items) method. You need to pass the dataset ID to define which dataset you want to access. You can get the dataset ID from the Actor's run dictionary (represented by `defaultDatasetId`). + + + + + {DatasetAsyncExample} + + + + + {DatasetSyncExample} + + + + +:::note Dataset access + +Running an Actor might take time, depending on the Actor's complexity and the amount of data it processes. If you want only to get data and have an immediate response, you should access the existing dataset of the finished [Actor run](https://docs.apify.com/platform/actors/running/runs-and-builds#runs). + +::: + +## Next steps + +Now that you're familiar with the basics, explore more advanced features: + +- [Async support](/concepts/async-support) - Learn about asynchronous programming with the client +- [Examples](/examples/passing-input-to-actor) - See practical examples for common use cases +- [API Reference](/reference/class/ApifyClient) - Browse the complete API documentation From 5120300ca6b8763ba1cfb2197a804240a2c41ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= <92638966+TC-MO@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:19:01 +0100 Subject: [PATCH 2/6] further fixes remove bold add italics update links --- docs/01_overview/overview.mdx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/01_overview/overview.mdx b/docs/01_overview/overview.mdx index d8ba62d3..d75913d4 100644 --- a/docs/01_overview/overview.mdx +++ b/docs/01_overview/overview.mdx @@ -22,19 +22,19 @@ The [Apify client for Python](https://github.com/apify/apify-client-python) is t Key features: -- **Synchronous and asynchronous interfaces** for flexible integration -- **Automatic retries** for improved reliability -- **JSON encoding** with UTF-8 for all requests and responses -- **Comprehensive API coverage** for [Actors](), [datasets](), [key-value stores](), and more +- Synchronous and asynchronous interfaces for flexible integration +- Automatic retries for improved reliability +- JSON encoding with UTF-8 for all requests and responses +- Comprehensive API coverage for [Actors](/platform/actors), [datasets]/platform/storage/dataset), [key-value stores](/platform/storage/key-value-store), and more ## Prerequisites Before installing the Apify client, ensure your system meets the following requirements: -- **Python 3.10 or higher**: You can download Python from the [official website](https://www.python.org/downloads/). -- **Python package manager**: While this guide uses Pip (the most common package manager), you can also use any package manager you want. You can download Pip from the [official website](https://pip.pypa.io/en/stable/installation/). +- _Python 3.10 or higher_: You can download Python from the [official website](https://www.python.org/downloads/). +- _Python package manager_: While this guide uses [pip](https://pip.pypa.io/en/stable/), you can also use any package manager you want. -To verify that Python and Pip are installed, run the following commands: +To verify that Python and pip are installed, run the following commands: ```sh python --version @@ -148,6 +148,8 @@ Running an Actor might take time, depending on the Actor's complexity and the am Now that you're familiar with the basics, explore more advanced features: -- [Async support](/concepts/async-support) - Learn about asynchronous programming with the client -- [Examples](/examples/passing-input-to-actor) - See practical examples for common use cases -- [API Reference](/reference/class/ApifyClient) - Browse the complete API documentation +- [Asyncio support](/concepts/asyncio-support) - Learn about asynchronous programming with the client +- Common use-case examples like: + - [Passing an input to Actor](/api/client/python/docs/examples/passing-input-to-actor) + - [Retrieve Actor data](/api/client/python/docs/examples/retrieve-actor-data) +- [API Reference](/api/client/python/reference) - Browse the complete API documentation From c8e9bccac60da4dabb5e8918a940dce1108516a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= <92638966+TC-MO@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:20:45 +0100 Subject: [PATCH 3/6] rename overview to index --- docs/01_overview/{overview.mdx => index.mdx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/01_overview/{overview.mdx => index.mdx} (100%) diff --git a/docs/01_overview/overview.mdx b/docs/01_overview/index.mdx similarity index 100% rename from docs/01_overview/overview.mdx rename to docs/01_overview/index.mdx From 0dd09479cc422a866137c822295e6e0aaa463861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= <92638966+TC-MO@users.noreply.github.com> Date: Mon, 12 Jan 2026 12:41:01 +0100 Subject: [PATCH 4/6] fixes to navigation fix links in left side and top side navbars --- website/docusaurus.config.js | 2 +- website/sidebars.js | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 8d0c6c73..44c8cc03 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -45,7 +45,7 @@ module.exports = { title: 'API Client for Python', items: [ { - to: 'docs/overview/introduction', + to: 'docs/overview', label: 'Docs', position: 'left', activeBaseRegex: '/docs(?!/changelog)', diff --git a/website/sidebars.js b/website/sidebars.js index e2e96264..5e053e71 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -1,15 +1,8 @@ module.exports = { sidebar: [ { - type: 'category', - label: 'Overview', - collapsed: true, - items: [ - { - type: 'autogenerated', - dirName: '01_overview', - }, - ], + type: 'doc', + id: 'overview/overview', }, { type: 'category', From f293a4f7cd622b97421a23747f0f019a5513efbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= <92638966+TC-MO@users.noreply.github.com> Date: Mon, 12 Jan 2026 12:41:46 +0100 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Marcel Rebro --- docs/01_overview/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/01_overview/index.mdx b/docs/01_overview/index.mdx index d75913d4..9a74c19d 100644 --- a/docs/01_overview/index.mdx +++ b/docs/01_overview/index.mdx @@ -25,7 +25,7 @@ Key features: - Synchronous and asynchronous interfaces for flexible integration - Automatic retries for improved reliability - JSON encoding with UTF-8 for all requests and responses -- Comprehensive API coverage for [Actors](/platform/actors), [datasets]/platform/storage/dataset), [key-value stores](/platform/storage/key-value-store), and more +- Comprehensive API coverage for [Actors](/platform/actors), [datasets](/platform/storage/dataset), [key-value stores](/platform/storage/key-value-store), and more ## Prerequisites From 449da7e8da2d3be41b6189ce8e5068fdf967778b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= <92638966+TC-MO@users.noreply.github.com> Date: Mon, 12 Jan 2026 13:31:54 +0100 Subject: [PATCH 6/6] add apify account to requirements --- docs/01_overview/index.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/01_overview/index.mdx b/docs/01_overview/index.mdx index 9a74c19d..a47d1790 100644 --- a/docs/01_overview/index.mdx +++ b/docs/01_overview/index.mdx @@ -31,6 +31,7 @@ Key features: Before installing the Apify client, ensure your system meets the following requirements: +- _An Apify account_ - _Python 3.10 or higher_: You can download Python from the [official website](https://www.python.org/downloads/). - _Python package manager_: While this guide uses [pip](https://pip.pypa.io/en/stable/), you can also use any package manager you want.