An open API service indexing awesome lists of open source software.

https://github.com/apify/apify-client-dotnet

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.
https://github.com/apify/apify-client-dotnet

Last synced: 14 days ago
JSON representation

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.

Awesome Lists containing this project

README

          

# 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](https://docs.apify.com/api/v2), mirroring the
official [JavaScript](https://github.com/apify/apify-client-js) 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

```bash
dotnet add package Apify.Client
```

## Quick start

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

```csharp
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](https://console.apify.com/settings/integrations).

## Documentation

Full documentation lives in [`docs/`](docs/README.md), organized by resource, with runnable
[examples](docs/examples.md).

## 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](LICENSE).