A class that extends the BaseDocumentLoader and implements the DocumentLoader interface. It represents a document loader that loads documents from an Apify dataset.

Hierarchy

Implements

Constructors

Properties

apifyClient: ApifyClient
datasetId: string
datasetMappingFunction: ((item) => Document<Record<string, any>>)

Type declaration

    • (item): Document<Record<string, any>>
    • Parameters

      • item: Record<string | number, unknown>

      Returns Document<Record<string, any>>

Methods

  • Create an ApifyDatasetLoader by calling an Actor on the Apify platform and waiting for its results to be ready.

    Parameters

    • actorId: string

      The ID or name of the Actor on the Apify platform.

    • input: Record<string | number, unknown>

      The input object of the Actor that you're trying to run.

    • config: {
          datasetMappingFunction: ApifyDatasetMappingFunction;
          callOptions?: ActorCallOptions;
          clientOptions?: ApifyClientOptions;
      }
      • datasetMappingFunction: ApifyDatasetMappingFunction
      • Optional callOptions?: ActorCallOptions
      • Optional clientOptions?: ApifyClientOptions

    Returns Promise<ApifyDatasetLoader>

    An instance of ApifyDatasetLoader with the results from the Actor run.

  • Create an ApifyDatasetLoader by calling a saved Actor task on the Apify platform and waiting for its results to be ready.

    Parameters

    • taskId: string

      The ID or name of the task on the Apify platform.

    • input: Record<string | number, unknown>

      The input object of the task that you're trying to run. Overrides the task's saved input.

    • config: {
          datasetMappingFunction: ApifyDatasetMappingFunction;
          callOptions?: TaskCallOptions;
          clientOptions?: ApifyClientOptions;
      }
      • datasetMappingFunction: ApifyDatasetMappingFunction
      • Optional callOptions?: TaskCallOptions
      • Optional clientOptions?: ApifyClientOptions

    Returns Promise<ApifyDatasetLoader>

    An instance of ApifyDatasetLoader with the results from the task's run.

Generated using TypeDoc