Skip to content

apify/apify-client-dotnet

Repository files navigation

Apify API client for .NET

Official, but experimental — AI-generated and AI-maintained. This is an official Apify client, but it is experimental: it is generated and maintained by AI. Review the code before relying on it in production and report issues on the repository.

A resource-oriented .NET client for the Apify API, mirroring the official JavaScript reference client: start from an ApifyClient, then drill down into resources (Actors, runs, datasets, key-value stores, request queues, tasks, schedules, webhooks, the store, users and logs).

All calls are asynchronous (Task-returning, CancellationToken-aware).

Requirements

  • .NET 8.0 or newer.

Installation

dotnet add package Apify.Client

Quick start

ImplicitUsings is disabled in this repository, so every using (even System) is listed explicitly.

using System;
using Apify.Client;

var client = new ApifyClient("my-api-token");

// Start an Actor and wait for it to finish (null waits indefinitely; pass seconds to bound the wait).
var run = await client.Actor("apify/hello-world").CallAsync(null, null, null);

// Read items from the run's default dataset.
var items = await client.Dataset(run.DefaultDatasetId!).ListItemsAsync();
// Count is the number of items in THIS page; Total is the dataset's full count across all pages.
Console.WriteLine($"Items on this page: {items.Count} (of {items.Total} total)");

new ApifyClient("my-api-token") takes the token as an explicit argument — it does not read APIFY_TOKEN automatically. Get your token from the Apify Console → Settings → API & Integrations.

Documentation

Full documentation lives in docs/, organized by resource, with runnable examples.

Versioning

  • Apify.Client.ApifyClientVersion.ClientVersion — the semantic version of this library.
  • Apify.Client.ApifyClientVersion.ApiSpecVersion — the Apify OpenAPI spec version this client was built against.

License

Apache-2.0.

About

Apify API client for .NET—Programmatically run Actors, manage and stream data from storages (datasets, key-value stores, request queues), schedule and monitor runs, and access the full Apify platform API. Sync and async interfaces with automatic retries and pagination.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages