Skip to content

Commit 0662b4a

Browse files
authored
docs: restore v2.5 docs snapshot and add missing v3.0 versioned docs (#808)
The v3.0.0 docs versioning run snapshotted docs using the pre-bump version (`2.5.1`), which overwrote `version-2.5` with v3 content and never created `version-3.0`. This PR restores the correct historical `2.5` snapshot and adds a proper `3.0` snapshot from current docs. - **Restore `2.5` to the last known good snapshot** - Replaced `website/versioned_docs/version-2.5/` with the tree from `5f7f7b1`. - Restored `website/versioned_sidebars/version-2.5-sidebars.json` to match that snapshot. - Removes v3-only docs from `2.5` (e.g. `upgrading_to_v3.mdx`, custom HTTP client/timeouts/typed-models concept pages). - **Create a proper `3.0` versioned snapshot** - Added `website/versioned_docs/version-3.0/` from current `docs/` + API versioned output. - Added `website/versioned_sidebars/version-3.0-sidebars.json` and reformatted to 4-space indentation to match existing versioned sidebar files. - Ensures v3-only docs are present under `3.0` (including `upgrading_to_v3.mdx` and new concepts docs), with the larger v3 `api-typedoc.json`. - **Correct version registry ordering** - Updated `website/versions.json` to: ```json ["3.0", "2.5", "1.12", "0.6"] ``` - **Keep versioned snapshot clean** - Removed root-gitignored carryovers from `version-3.0` (`.ruff_cache`, `changelog.md`, `pyproject.toml`).
1 parent b6cdc54 commit 0662b4a

106 files changed

Lines changed: 201492 additions & 162114 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

website/versioned_docs/version-2.5/01_introduction/code/03_input_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ async def main() -> None:
1212
'some': 'input',
1313
}
1414

15-
# Start an Actor and wait for it to finish.
15+
# Start an Actor and waits for it to finish.
1616
call_result = await actor_client.call(run_input=run_input)

website/versioned_docs/version-2.5/01_introduction/code/03_input_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ def main() -> None:
1212
'some': 'input',
1313
}
1414

15-
# Start an Actor and wait for it to finish.
15+
# Start an Actor and waits for it to finish.
1616
call_result = actor_client.call(run_input=run_input)

website/versioned_docs/version-2.5/01_introduction/index.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
id: introduction
33
title: Overview
4+
sidebar_label: Overview
45
slug: /
5-
description: The official Python library to access the Apify API, with automatic retries, async support, and comprehensive API coverage.
6+
description: "The official Python library to access the Apify API, with automatic retries, async support, and comprehensive API coverage."
67
---
78

89
import Tabs from '@theme/Tabs';
@@ -23,7 +24,7 @@ The client simplifies interaction with the Apify platform by providing:
2324

2425
## Prerequisites
2526

26-
`apify-client` requires Python 3.11 or higher. Python is available for download on the [official website](https://www.python.org/downloads/). Check your current Python version by running:
27+
`apify-client` requires Python 3.10 or higher. Python is available for download on the [official website](https://www.python.org/downloads/). Check your current Python version by running:
2728

2829
```bash
2930
python --version
@@ -39,7 +40,7 @@ pip install apify-client
3940

4041
## Quick example
4142

42-
The following example shows how to run an Actor and retrieve its results:
43+
Here's an example showing how to run an Actor and retrieve its results:
4344

4445
<Tabs>
4546
<TabItem value="AsyncExample" label="Async client" default>

website/versioned_docs/version-2.5/01_introduction/quick-start.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
id: quick-start
33
title: Quick start
4-
description: Get started with the Apify API client for Python by running an Actor and retrieving results from its dataset.
4+
sidebar_label: Quick start
5+
description: "Get started with the Apify API client for Python by running an Actor and retrieving results from its dataset."
56
---
67

78
import Tabs from '@theme/Tabs';
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
id: asyncio-support
33
title: Asyncio support
4-
description: Use the async client for non-blocking API calls with Python asyncio.
54
---
65

76
import Tabs from '@theme/Tabs';
@@ -11,12 +10,10 @@ import ApiLink from '@theme/ApiLink';
1110

1211
import AsyncSupportExample from '!!raw-loader!./code/01_async_support.py';
1312

14-
The package provides an asynchronous version of the client, <ApiLink to="class/ApifyClientAsync">`ApifyClientAsync`</ApiLink>, which allows you to interact with the Apify API using Python's standard async/await syntax. This enables you to perform non-blocking operations, see the Python [asyncio documentation](https://docs.python.org/3/library/asyncio-task.html) for more information. This is useful for applications that need to perform multiple API operations concurrently or integrate with other async frameworks.
13+
The package provides an asynchronous version of the client, <ApiLink to="class/ApifyClientAsync">`ApifyClientAsync`</ApiLink>, which allows you to interact with the Apify API using Python's standard async/await syntax. This enables you to perform non-blocking operations, see the Python [asyncio documentation](https://docs.python.org/3/library/asyncio-task.html) for more information.
1514

16-
The following example shows how to run an Actor asynchronously and stream its logs while it is running:
15+
The following example demonstrates how to run an Actor asynchronously and stream its logs while it is running:
1716

1817
<CodeBlock className="language-python">
1918
{AsyncSupportExample}
2019
</CodeBlock>
21-
22-
For the full async client API, see the <ApiLink to="class/ApifyClientAsync">`ApifyClientAsync`</ApiLink> reference.

website/versioned_docs/version-2.5/02_concepts/02_single_collection_clients.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
id: single-and-collection-clients
33
title: Single and collection clients
4-
description: Understand the two types of resource clients, single-resource and collection clients.
54
---
65

76
import Tabs from '@theme/Tabs';
@@ -15,7 +14,7 @@ import CollectionSyncExample from '!!raw-loader!./code/02_collection_sync.py';
1514
import SingleAsyncExample from '!!raw-loader!./code/02_single_async.py';
1615
import SingleSyncExample from '!!raw-loader!./code/02_single_sync.py';
1716

18-
The Apify client provides two types of resource clients: single-resource clients for managing an individual resource, and collection clients for listing or creating resources.
17+
The Apify client interface is designed to be consistent and intuitive across all of its components. When you call specific methods on the main client, you create specialized clients to manage individual API resources. There are two main types of clients:
1918

2019
- <ApiLink to="class/ActorClient">`ActorClient`</ApiLink> - Manages a single resource.
2120
- <ApiLink to="class/ActorCollectionClient">`ActorCollectionClient`</ApiLink> - Manages a collection of resources.

website/versioned_docs/version-2.5/02_concepts/03_nested_clients.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
id: nested-clients
33
title: Nested clients
4-
description: Access related resources directly through nested client methods.
54
---
65

76
import Tabs from '@theme/Tabs';
@@ -13,7 +12,7 @@ import ApiLink from '@theme/ApiLink';
1312
import NestedAsyncExample from '!!raw-loader!./code/03_nested_async.py';
1413
import NestedSyncExample from '!!raw-loader!./code/03_nested_sync.py';
1514

16-
Nested clients let you access related resources directly from a parent resource client, without manually constructing new client instances.
15+
In some cases, the Apify client provides nested clients to simplify working with related collections. For example, you can easily manage the runs of a specific Actor without having to construct multiple endpoints or client instances manually.
1716

1817
<Tabs>
1918
<TabItem value="AsyncExample" label="Async client" default>
Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
id: error-handling
33
title: Error handling
4-
description: Handle API errors with the ApifyApiError exception and automatic data parsing.
54
---
65

76
import Tabs from '@theme/Tabs';
@@ -14,22 +13,6 @@ import ErrorSyncExample from '!!raw-loader!./code/04_error_sync.py';
1413

1514
When you use the Apify client, it automatically extracts all relevant data from the endpoint and returns it in the expected format. Date strings, for instance, are seamlessly converted to Python `datetime.datetime` objects. If an error occurs, the client raises an <ApiLink to="class/ApifyApiError">`ApifyApiError`</ApiLink>. This exception wraps the raw JSON errors returned by the API and provides additional context, making it easier to debug any issues that arise.
1615

17-
## Error subclasses
18-
19-
The Apify client provides dedicated error subclasses based on the HTTP status code of the failed response, so you can branch on error kind without inspecting `status_code` or `type`:
20-
21-
| Status | Subclass |
22-
|---|---|
23-
| 400 | <ApiLink to="class/InvalidRequestError">`InvalidRequestError`</ApiLink> |
24-
| 401 | <ApiLink to="class/UnauthorizedError">`UnauthorizedError`</ApiLink> |
25-
| 403 | <ApiLink to="class/ForbiddenError">`ForbiddenError`</ApiLink> |
26-
| 404 | <ApiLink to="class/NotFoundError">`NotFoundError`</ApiLink> |
27-
| 409 | <ApiLink to="class/ConflictError">`ConflictError`</ApiLink> |
28-
| 429 | <ApiLink to="class/RateLimitError">`RateLimitError`</ApiLink> |
29-
| 5xx | <ApiLink to="class/ServerError">`ServerError`</ApiLink> |
30-
31-
All subclasses inherit from <ApiLink to="class/ApifyApiError">`ApifyApiError`</ApiLink>, so an existing `except ApifyApiError` handler still catches every API error. Catch a specific subclass when you want to react differently to, for example, a missing resource or a rate-limit:
32-
3316
<Tabs>
3417
<TabItem value="AsyncExample" label="Async client" default>
3518
<CodeBlock className="language-python">
@@ -42,5 +25,3 @@ All subclasses inherit from <ApiLink to="class/ApifyApiError">`ApifyApiError`</A
4225
</CodeBlock>
4326
</TabItem>
4427
</Tabs>
45-
46-
For a complete list of error classes, see the <ApiLink to="class/ApifyApiError">`ApifyApiError`</ApiLink> reference.

website/versioned_docs/version-2.5/02_concepts/05_retries.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
id: retries
33
title: Retries
4-
description: Configure automatic retries with exponential backoff for failed requests.
54
---
65

76
import Tabs from '@theme/Tabs';
@@ -13,23 +12,23 @@ import ApiLink from '@theme/ApiLink';
1312
import RetriesAsyncExample from '!!raw-loader!./code/05_retries_async.py';
1413
import RetriesSyncExample from '!!raw-loader!./code/05_retries_sync.py';
1514

16-
The Apify client automatically retries requests that fail due to:
15+
When dealing with network communication, failures can occasionally occur. The Apify client automatically retries requests that fail due to:
1716

1817
- Network errors
1918
- Internal errors in the Apify API (HTTP status codes 500 and above)
2019
- Rate limit errors (HTTP status code 429)
2120

22-
By default, the client retries a failed request up to 4 times. The retry intervals use an exponential backoff strategy:
21+
By default, the client will retry a failed request up to 8 times. The retry intervals use an exponential backoff strategy:
2322

2423
- The first retry occurs after approximately 500 milliseconds.
2524
- The second retry occurs after approximately 1,000 milliseconds, and so on.
2625

2726
You can customize this behavior using the following options in the <ApiLink to="class/ApifyClient">`ApifyClient`</ApiLink> constructor:
2827

2928
- `max_retries`: Defines the maximum number of retry attempts.
30-
- `min_delay_between_retries`: Sets the minimum delay between retries as a `timedelta`.
29+
- `min_delay_between_retries_millis`: Sets the minimum delay between retries (in milliseconds).
3130

32-
Retries with exponential backoff help reduce the load on the server and increase the chances of a successful request.
31+
Retries with exponential backoff are a common strategy for handling network errors. They help to reduce the load on the server and increase the chances of a successful request.
3332

3433
<Tabs>
3534
<TabItem value="AsyncExample" label="Async client" default>

website/versioned_docs/version-2.5/02_concepts/06_logging.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
id: logging
33
title: Logging
4-
description: Configure debug logging to inspect API requests and responses.
54
---
65

76
import Tabs from '@theme/Tabs';

0 commit comments

Comments
 (0)