Skip to content

Commit d91a6e4

Browse files
docs: Refactor documentation structure and add new content
1 parent 0a1529d commit d91a6e4

37 files changed

+217
-71
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ website/typedoc-types*
5151

5252
# Default directory for memory storage
5353
storage/
54+
config.bat
55+
node_modules
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
id: overview
3+
title: Overview
4+
description: 'The official Python library for accessing the Apify API, providing synchronous and asynchronous interfaces for Actors, datasets, and storage.'
5+
---
6+
7+
## Introduction
8+
9+
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.
10+
11+
Key features:
12+
13+
- Synchronous and asynchronous interfaces for flexible integration
14+
- Automatic retries for improved reliability
15+
- JSON encoding with UTF-8 for all requests and responses
16+
- Comprehensive API coverage for [Actors](/platform/actors), [datasets](/platform/storage/dataset), [key-value stores](/platform/storage/key-value-store), and more
17+
18+
## Next steps
19+
20+
Now that you're familiar with the basics, explore more advanced features:
21+
22+
- [Asyncio support](/concepts/asyncio-support) - Learn about asynchronous programming with the client
23+
- Common use-case examples like:
24+
- [Passing an input to Actor](/api/client/python/docs/examples/passing-input-to-actor)
25+
- [Retrieve Actor data](/api/client/python/docs/examples/retrieve-actor-data)
26+
- [API Reference](/api/client/python/reference) - Browse the complete API documentation
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: installation
3+
title: Installation
4+
description: 'How to install the Apify client for Python and verify the installation.'
5+
---
6+
7+
## Prerequisites
8+
9+
Before installing the Apify client, ensure your system meets the following requirements:
10+
11+
- _An Apify account_
12+
- _Python 3.10 or higher_: You can download Python from the [official website](https://www.python.org/downloads/).
13+
- _Python package manager_: While this guide uses [pip](https://pip.pypa.io/en/stable/), you can also use any package manager you want.
14+
15+
To verify that Python and pip are installed, run the following commands:
16+
17+
```sh
18+
python --version
19+
```
20+
21+
```sh
22+
pip --version
23+
```
24+
25+
If these commands return the respective versions, you're ready to continue.
26+
27+
## Installation
28+
29+
The Apify client is available as the [`apify-client`](https://pypi.org/project/apify-client/) package on PyPI. To install it, run:
30+
31+
```sh
32+
pip install apify-client
33+
```
34+
35+
After installation, verify that the client is installed correctly by checking its version:
36+
37+
```sh
38+
python -c 'import apify_client; print(apify_client.__version__)'
39+
```
Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
2-
id: overview
3-
title: Overview
2+
id: quick-start
3+
title: Quick start
4+
description: 'Get started with the Apify client for Python by running your first Actor and retrieving results.'
5+
---
6+
7+
Learn how to start Actors and retrieve their results using the Apify Client.
8+
49
---
510

611
import Tabs from '@theme/Tabs';
@@ -16,52 +21,7 @@ import InputSyncExample from '!!raw-loader!./code/03_input_sync.py';
1621
import DatasetAsyncExample from '!!raw-loader!./code/03_dataset_async.py';
1722
import DatasetSyncExample from '!!raw-loader!./code/03_dataset_sync.py';
1823

19-
## Introduction
20-
21-
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.
22-
23-
Key features:
24-
25-
- Synchronous and asynchronous interfaces for flexible integration
26-
- Automatic retries for improved reliability
27-
- JSON encoding with UTF-8 for all requests and responses
28-
- Comprehensive API coverage for [Actors](/platform/actors), [datasets](/platform/storage/dataset), [key-value stores](/platform/storage/key-value-store), and more
29-
30-
## Prerequisites
31-
32-
Before installing the Apify client, ensure your system meets the following requirements:
33-
34-
- _An Apify account_
35-
- _Python 3.10 or higher_: You can download Python from the [official website](https://www.python.org/downloads/).
36-
- _Python package manager_: While this guide uses [pip](https://pip.pypa.io/en/stable/), you can also use any package manager you want.
37-
38-
To verify that Python and pip are installed, run the following commands:
39-
40-
```sh
41-
python --version
42-
```
43-
44-
```sh
45-
pip --version
46-
```
47-
48-
If these commands return the respective versions, you're ready to continue.
49-
50-
## Installation
51-
52-
The Apify client is available as the [`apify-client`](https://pypi.org/project/apify-client/) package on PyPI. To install it, run:
53-
54-
```sh
55-
pip install apify-client
56-
```
57-
58-
After installation, verify that the client is installed correctly by checking its version:
59-
60-
```sh
61-
python -c 'import apify_client; print(apify_client.__version__)'
62-
```
63-
64-
## Authentication and initialization
24+
## Step 1: Authentication and initialization
6525

6626
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.
6727

@@ -84,11 +44,7 @@ The API token is used to authorize your requests to the Apify API. You can be ch
8444

8545
:::
8646

87-
## Quick start
88-
89-
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.
90-
91-
### Running your first Actor
47+
## Step 2: Running your first Actor
9248

9349
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).
9450

@@ -105,7 +61,7 @@ To start an Actor, you need its ID (e.g., `john-doe/my-cool-actor`) and an API t
10561
</TabItem>
10662
</Tabs>
10763

108-
### Providing input to Actor
64+
### Passing input to the Actor
10965

11066
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).
11167

@@ -122,7 +78,7 @@ Actors often require input, such as URLs to scrape, search terms, or other confi
12278
</TabItem>
12379
</Tabs>
12480

125-
### Getting results from the dataset
81+
## Step 3: Getting results from the dataset
12682

12783
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`).
12884

@@ -144,13 +100,3 @@ To get the results from the dataset, you can use the [`DatasetClient`](/referenc
144100
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).
145101

146102
:::
147-
148-
## Next steps
149-
150-
Now that you're familiar with the basics, explore more advanced features:
151-
152-
- [Asyncio support](/concepts/asyncio-support) - Learn about asynchronous programming with the client
153-
- Common use-case examples like:
154-
- [Passing an input to Actor](/api/client/python/docs/examples/passing-input-to-actor)
155-
- [Retrieve Actor data](/api/client/python/docs/examples/retrieve-actor-data)
156-
- [API Reference](/api/client/python/reference) - Browse the complete API documentation
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)