Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.9 KB

File metadata and controls

50 lines (41 loc) · 1.9 KB
id single-and-collection-clients
title Single and collection clients

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock';

import ApiLink from '@theme/ApiLink';

import CollectionAsyncExample from '!!raw-loader!./code/02_collection_async.py'; import CollectionSyncExample from '!!raw-loader!./code/02_collection_sync.py'; import SingleAsyncExample from '!!raw-loader!./code/02_single_async.py'; import SingleSyncExample from '!!raw-loader!./code/02_single_sync.py';

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:

  • ActorClient - Manages a single resource.
  • ActorCollectionClient - Manages a collection of resources.
{CollectionAsyncExample} {CollectionSyncExample}

The resource ID can be the resource's id or a combination of username/resource-name.

{SingleAsyncExample} {SingleSyncExample}

By utilizing the appropriate collection or resource client, you can simplify how you interact with the Apify API.