Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.11.0

- Updated to the Apify OpenAPI specification `v2-2026-12-03T122505Z`: regenerated the embedded
response schemas (more nullable fields, reduced `stats` of a Store Actor).
- Added `ActorStoreListItem.UserFullName`, `Description`, `Categories`, `IsVerified`, and `Stats`.
- Added `StoreCollectionClient.SearchAsync`, `StoreSearchOptions`, and `StoreSearchResult` for the Store search, which
the API answers with one page of at most 100 Actors and cannot be paged.
- **Breaking:** removed `StoreListOptions.Search` (use `SearchAsync`), `AllowsAgenticUsers` (no longer in the
specification), and `SortBy` (the API ignores it; Actors come in Store order, so sort the results on the client).
`IterateAsync` no longer searches.
- Added `RunClient.GetStreamedLog(toLog, since)` and `StreamedLog.LastRedirectedAt`. A log stream that breaks off
while the run goes on is reopened, and the redirection continues after the last redirected message.
- An error that a streamed log cannot recover from now ends the redirection with a warning on the standard error
output instead of failing `StreamedLog.StopAsync` and `CallAsync`.
- Documented that a signed public URL of a dataset or key list grants read access to all of it, and that its options
only set the default shape of the response.
- `ActorVersionCollectionClient.CreateAsync` and `ActorVersionClient.UpdateAsync` use the `Long` timeout tier.

## 0.10.1

- Updated to the Apify OpenAPI specification `v2-2026-11-18T151559Z`. User responses with the reduced shape that
Expand Down
5 changes: 3 additions & 2 deletions docs/actors.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,15 @@ collection clients these methods take no filtering/paging options.
- `IterateAsync()` → `IAsyncEnumerable<ActorVersion>`: iterate the versions; exists for API parity
with the other collection iterators (the endpoint has only the one page).
- `CreateAsync(object version)`: create a version from any JSON-serializable definition. Returns
`ActorVersion`.
`ActorVersion`. Uses the `Long` timeout tier, since the version can carry its source files.

### Single version: `client.Actor(id).Version(versionNumber)` → `ActorVersionClient`

`versionNumber` is the version identifier (e.g. `0.1`).

- `GetAsync()` → `ActorVersion?` (null if not found).
- `UpdateAsync(object newFields)` → `ActorVersion`: update with any JSON-serializable set of fields.
- `UpdateAsync(object newFields)` → `ActorVersion`: update with any JSON-serializable set of fields. Uses the `Long`
timeout tier, since the version can carry its source files.
- `DeleteAsync()`.
- `EnvVars()` → `ActorEnvVarCollectionClient`: this version's environment-variable collection.
- `EnvVar(string name)` → `ActorEnvVarClient`: a single environment variable of this version.
Expand Down
39 changes: 25 additions & 14 deletions docs/misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,47 @@

## Apify Store: `client.Store()`

Browse public Actors in the [Apify Store](https://apify.com/store).
Browse and search public Actors in [Apify Store](https://apify.com/store). The API serves the Store in two
ways, and the client has one set of methods for each.

- `ListAsync(StoreListOptions? options = null)` → `PaginationList<ActorStoreListItem>` (one page).
- `IterateAsync(StoreListOptions? options = null)` → `IAsyncEnumerable<ActorStoreListItem>` (lazy, all
pages; `Limit` caps the total number of Actors yielded and `ChunkSize` sets the page size).
- `ListAsync(StoreListOptions? options = null)` → `PaginationList<ActorStoreListItem>` (one page, in Store order).
- `IterateAsync(StoreListOptions? options = null)` → `IAsyncEnumerable<ActorStoreListItem>` (lazy, all pages;
`Limit` caps the total number of Actors yielded and `ChunkSize` sets the page size).
- `SearchAsync(StoreSearchOptions options)` → `StoreSearchResult`: the Actors that match a query best, by relevance.

`StoreListOptions` fields:
`StoreListOptions` and `StoreSearchOptions` share the filters `Category`, `Username`, `PricingModel`,
`IncludeUnrunnableActors`, `IncludeInputSchema`, and `ResponseFormat`. `StoreListOptions` fields:

| Field | Type | Description |
|---|---|---|
| `Offset` | `int?` | Number of Actors to skip from the start. |
| `Limit` | `int?` | Maximum number of Actors to return (for `IterateAsync`, in total across all pages). |
| `Limit` | `int?` | Maximum number of Actors to return (for `IterateAsync`, in total across all pages). The API's maximum is 1000. |
| `ChunkSize` | `int?` | Page size used by `IterateAsync` (positive; the smaller of this and the remaining `Limit` is requested per call). Never sent to the API. |
| `Search` | `string?` | Full-text search string to filter Actors by. |
| `SortBy` | `string?` | Field to sort by (e.g. `popularity`, `newest`). |
| `Category` | `string?` | Restrict results to a Store category. |
| `Category` | `string?` | Restrict results to Store category IDs, comma-separated and case-insensitive (for example `AI_AND_ML,ECOMMERCE`); an Actor has to match all of them. An unknown category fails with a `400` error. |
| `Username` | `string?` | Restrict results to a given owner's Actors. |
| `PricingModel` | `string?` | Filter by pricing model (`FREE`, `PRICE_PER_DATASET_ITEM`, `PAY_PER_EVENT`; the rental model `FLAT_PRICE_PER_MONTH` is no longer supported). |
| `IncludeUnrunnableActors` | `bool?` | Include Actors that cannot currently be run. |
| `AllowsAgenticUsers` | `bool?` | Only Actors that permit agentic (automated) users. |
| `IncludeInputSchema` | `bool?` | Include each Actor's compact `inputSchema` (read it with `Get("inputSchema")`). The API then caps `limit` at 10, so iteration requests pages of at most 10. |
| `ResponseFormat` | `string?` | Requested response format. |
| `IncludeUnrunnableActors` | `bool?` | Include Actors that are not safe to run automatically, such as Actors of developers who have not passed KYC or full-permission Actors without a large user base. They are left out by default. |
| `IncludeInputSchema` | `bool?` | Include each Actor's compact `inputSchema` (read it with `Get("inputSchema")`). The API rejects a `limit` above 10 with a `400` error, so `ListAsync` with a larger `Limit` fails, and iteration requests pages of at most 10. |
| `ResponseFormat` | `string?` | `full` (default) returns the complete response. `agent` returns a reduced field set for LLM consumers: `id`, `title`, `name`, `username`, `description`, `notice`, `badge`, `categories`, and minimal `stats`. |

The API answers a search with one page of at most 100 Actors, ordered by relevance. It ignores `offset`, and it
reports the number of Actors returned as the total. A search therefore cannot be paged or iterated, and
`SearchAsync` makes one request. It throws `ArgumentException` for a missing or empty `Search` and
`ArgumentOutOfRangeException` for a zero or negative `Limit`, before sending any request.

`StoreSearchOptions` has `Search` (required), `Limit` (the API's default and maximum is 100), and the shared filters.
With `IncludeInputSchema` the API rejects a `Limit` above 10 with a `400` error. `StoreSearchResult` has `Items`
(best match first) and `Limit`, the number of Actors the API allowed. When `Items` holds that many, more Actors may
match, so narrow the query with a more specific `Search` or with the filters.

```csharp
using System;
using Apify.Client;
using Apify.Client.Options;

var client = new ApifyClient("my-api-token");
await foreach (var item in client.Store().IterateAsync(new StoreListOptions { Search = "crawler", Limit = 50 }))
var result = await client.Store().SearchAsync(new StoreSearchOptions { Search = "crawler", Limit = 50 });
foreach (var item in result.Items)
{
Console.WriteLine(item.Name);
}
Expand Down
5 changes: 5 additions & 0 deletions docs/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ An entry returned when browsing the Apify Store.
| `Name` | `string?` | The Actor's technical name. |
| `Username` | `string?` | Username of the Actor's owner. |
| `Title` | `string?` | Human-readable title. |
| `UserFullName` | `string?` | Full name of the Actor's owner. |
| `Description` | `string?` | The Actor's description. |
| `Categories` | `IReadOnlyList<string>?` | Store category IDs of the Actor. |
| `IsVerified` | `bool?` | Whether the Actor's developer has a verified identity. |
| `Stats` | `JsonObject?` | Usage statistics and Store metrics: `totalUsers`, `totalRuns`, `totalUsers7Days`, `totalUsers30Days`, `totalUsers90Days`, `actorReviewRating`, and `actorReviewCount`. |

## `ActorTask`

Expand Down
11 changes: 11 additions & 0 deletions docs/runs.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ collections, not by task runs).
- `GetStreamedLog(Action<string> toLog, bool fromStart = true)` → `StreamedLog`: redirects the run's live
log to `toLog` one complete message at a time. Call `Start()` to begin and `StopAsync()` (or dispose) to
end. `fromStart: false` skips messages older than the helper's creation.
- `GetStreamedLog(Action<string> toLog, DateTimeOffset? since)` → `StreamedLog`: redirects only the messages logged at
`since` or later (`null` redirects the whole log). `StreamedLog.LastRedirectedAt` is the timestamp of the last
redirected message. To continue the redirection after a restart, save it and pass it as `since`: messages logged at
exactly that time are redirected again, and passing one millisecond later could skip messages that share that
millisecond but were not redirected yet.

With either overload, and with the `log` argument of `CallAsync`, a log stream that breaks off while the run goes
on is reopened after a one-second pause, and the messages already redirected are skipped. The reopened stream
downloads the whole log again, because the API cannot start from a given point. An error the redirection cannot
recover from, such as a failed reopen, ends it with a warning on the standard error output and does not fail the
call.

### Option and charge types

Expand Down
4 changes: 2 additions & 2 deletions docs/storages.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ reached from a run (`client.Run(id).Dataset()`, `.KeyValueStore()`, `.RequestQue
serialization). Anything else, such as a bare number or an array of non-objects, throws `ArgumentException`
before a request is sent, because the API accepts only objects.
- `GetStatisticsAsync()` → `JsonObject` (throws if the dataset does not exist).
- `CreateItemsPublicUrlAsync(DatasetListItemsOptions? options = null, int? expiresInSecs = null, DownloadItemsFormat? format = null)` → `string` (a signed public URL; `format` defaults to `Json`; `expiresInSecs` must be positive, leave it out for a URL that never expires, otherwise `ArgumentOutOfRangeException` is thrown before any request).
- `CreateItemsPublicUrlAsync(DatasetListItemsOptions? options = null, int? expiresInSecs = null, DownloadItemsFormat? format = null)` → `string` (a signed public URL; it grants read access to the whole dataset until it expires, and the options only set the default shape of the response, which anyone holding the URL can change; `format` defaults to `Json`; `expiresInSecs` must be positive, leave it out for a URL that never expires, otherwise `ArgumentOutOfRangeException` is thrown before any request).

`DatasetListItemsOptions` selects and reshapes items: `Offset`/`Limit` (pagination: `Limit` is the number of
dataset rows read, in total across pages when iterating; `0` or unset means no cap), `ChunkSize` (the page
Expand Down Expand Up @@ -116,7 +116,7 @@ await csvStream.CopyToAsync(file);
`SetRecordJsonAsync(string key, object? value)` (serializes `value` to JSON bytes).
- `DeleteRecordAsync(string key)`.
- `GetRecordPublicUrlAsync(string key)` → `string` and
`CreateKeysPublicUrlAsync(ListKeysOptions? options = null, int? expiresInSecs = null)` → `string` (both signed public URLs; `expiresInSecs` must be positive, leave it out for a URL that never expires, otherwise `ArgumentOutOfRangeException` is thrown before any request).
`CreateKeysPublicUrlAsync(ListKeysOptions? options = null, int? expiresInSecs = null)` → `string` (both signed public URLs; the keys URL grants read access to the full key list until it expires, and its options only set the default shape of the response, which anyone holding the URL can change; `expiresInSecs` must be positive, leave it out for a URL that never expires, otherwise `ArgumentOutOfRangeException` is thrown before any request).

`ListKeysOptions` fields: `Limit` (page size), `ExclusiveStartKey` (start after this key),
`Prefix` (only keys with this prefix), `Collection` (a named record collection), and `Signature`
Expand Down
2 changes: 1 addition & 1 deletion src/Apify.Client/Apify.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- NuGet package metadata (see the publish workflow). -->
<PackageId>Apify.Client</PackageId>
<Version>0.10.1</Version>
<Version>0.11.0</Version>
<Authors>Apify</Authors>
<Company>Apify</Company>
<Product>Apify API client for .NET</Product>
Expand Down
4 changes: 2 additions & 2 deletions src/Apify.Client/ApifyClientVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public static class ApifyClientVersion
/// The semantic version of this client library (see https://semver.org/). Changes to the public
/// interface other than additive ones are considered breaking changes.
/// </summary>
public const string ClientVersion = "0.10.1";
public const string ClientVersion = "0.11.0";

/// <summary>
/// The version of the Apify OpenAPI specification this client was generated and verified against.
/// Corresponds to the <c>info.version</c> field of the Apify OpenAPI document.
/// </summary>
public const string ApiSpecVersion = "v2-2026-11-18T151559Z";
public const string ApiSpecVersion = "v2-2026-12-03T122505Z";
}
2 changes: 1 addition & 1 deletion src/Apify.Client/Internal/PagedIteration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal static class PagedIteration
/// <param name="totalLimit">The most items (or rows, see <paramref name="limitCountsRows"/>) across all pages, or <c>null</c>/<c>0</c> for no cap.</param>
/// <param name="limitCountsRows">
/// Whether <paramref name="totalLimit"/> counts the rows scanned (dataset items) rather than the items returned
/// (listings, where the API can scan more rows than it returns, such as the Store dropping Actors the caller cannot run).
/// (listings, where the API can scan more rows than it returns, such as the Store dropping Actors that are not safe to run automatically).
/// </param>
/// <param name="chunkSize">The most rows to request per call, or <c>null</c> for the API default.</param>
/// <param name="fetchPage">Fetches one page given its offset and limit (<c>null</c> limit: leave it out).</param>
Expand Down
2 changes: 1 addition & 1 deletion src/Apify.Client/Internal/ResponseSchemas.json

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/Apify.Client/Models/ActorStoreListItem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Text.Json.Nodes;

namespace Apify.Client.Models;
Expand All @@ -23,4 +24,23 @@ public ActorStoreListItem(JsonObject data)

/// <summary>The human-readable title.</summary>
public string? Title => GetString("title");

/// <summary>The full name of the Actor's owner.</summary>
public string? UserFullName => GetString("userFullName");

/// <summary>The Actor's description.</summary>
public string? Description => GetString("description");

/// <summary>The IDs of the Store categories of the Actor (<c>null</c> if the API reports none).</summary>
public IReadOnlyList<string>? Categories => GetStringList("categories");

/// <summary>Whether the Actor's developer has a verified identity.</summary>
public bool? IsVerified => GetBool("isVerified");

/// <summary>
/// The Actor's usage statistics and Store metrics: <c>totalUsers</c>, <c>totalRuns</c>, <c>totalUsers7Days</c>,
/// <c>totalUsers30Days</c>, <c>totalUsers90Days</c>, <c>actorReviewRating</c>, and <c>actorReviewCount</c>. The Store
/// endpoint returns this reduced set instead of the full Actor statistics.
/// </summary>
public JsonObject? Stats => Get("stats") as JsonObject;
}
35 changes: 35 additions & 0 deletions src/Apify.Client/Models/StoreSearchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Collections.Generic;
using System.Text.Json.Nodes;

namespace Apify.Client.Models;

/// <summary>
/// The single page of results of a Store search. This result exposes no total, offset, or count, because for a search the
/// API fills them with values that would read as the number of matches and a position to continue from.
/// </summary>
public sealed class StoreSearchResult
{
private StoreSearchResult(IReadOnlyList<ActorStoreListItem> items, long limit)
{
Items = items;
Limit = limit;
}

/// <summary>Builds a result from the decoded paginated response object.</summary>
/// <param name="data">The decoded response object.</param>
internal static StoreSearchResult FromData(JsonNode? data)
{
var page = PaginationList<ActorStoreListItem>.FromData(data, static d => new ActorStoreListItem(d));
return new StoreSearchResult(page.Items, page.Limit);
}

/// <summary>The Actors matching the query, best match first.</summary>
public IReadOnlyList<ActorStoreListItem> Items { get; }

/// <summary>
/// The maximum number of Actors the API allowed in this result: the requested limit, or the API's maximum when none or
/// a larger one was requested. When <see cref="Items"/> holds that many, more Actors may match the query than were
/// returned, so narrow it with a more specific query or with the filters.
/// </summary>
public long Limit { get; }
}
60 changes: 60 additions & 0 deletions src/Apify.Client/Options/StoreFilterOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Apify.Client.Internal;

namespace Apify.Client.Options;

/// <summary>The filters that <see cref="StoreListOptions"/> and <see cref="StoreSearchOptions"/> share.</summary>
public abstract class StoreFilterOptions
{
/// <summary>The API's maximum <c>limit</c> while <see cref="IncludeInputSchema"/> is set.</summary>
public const int MaxPageLimitWithInputSchema = 10;

// Only the two options classes of this assembly derive from it.
internal StoreFilterOptions()
{
}

/// <summary>
/// Filter Actors by category. Accepts one or more category IDs separated by commas, case-insensitive, such as
/// <c>AI_AND_ML,ECOMMERCE</c>, and an Actor has to match all of them. An unknown category fails with a <c>400</c> error.
/// </summary>
public string? Category { get; init; }

/// <summary>Filter Actors by owner username.</summary>
public string? Username { get; init; }

/// <summary>
/// Filter Actors by pricing model (<c>FREE</c>, <c>PRICE_PER_DATASET_ITEM</c>,
/// <c>PAY_PER_EVENT</c>). The rental model (<c>FLAT_PRICE_PER_MONTH</c>) is no longer supported.
/// </summary>
public string? PricingModel { get; init; }

/// <summary>
/// By default, results leave out Actors that are not safe to run automatically, such as Actors of developers who have
/// not passed KYC or full-permission Actors without a large user base. <c>true</c> includes them.
/// </summary>
public bool? IncludeUnrunnableActors { get; init; }

/// <summary>
/// Include each Actor's <c>inputSchema</c>, a compact form of the input schema of its default build (property types and
/// required properties). The API rejects a <c>limit</c> above <see cref="MaxPageLimitWithInputSchema"/>
/// with a <c>400</c> error, so a call with a larger <c>Limit</c> fails.
/// </summary>
public bool? IncludeInputSchema { get; init; }

/// <summary>
/// The shape of the response. <c>full</c> (default) is the complete response. <c>agent</c> is a reduced field set for
/// LLM consumers: <c>id</c>, <c>title</c>, <c>name</c>, <c>username</c>, <c>description</c>, <c>notice</c>, <c>badge</c>,
/// <c>categories</c>, and minimal <c>stats</c>.
/// </summary>
public string? ResponseFormat { get; init; }

internal void AppendFilters(QueryParams q)
{
q.AddString("category", Category)
.AddString("username", Username)
.AddString("pricingModel", PricingModel)
.AddBool("includeUnrunnableActors", IncludeUnrunnableActors)
.AddBool("includeInputSchema", IncludeInputSchema)
.AddString("responseFormat", ResponseFormat);
}
}
Loading
Loading