Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
54976b2
feat: sync Store, run origin and Actor version timeouts with the Apif…
claude Nov 27, 2026
4f65616
feat: accept InputStream request bodies, add streamed record read, an…
claude Nov 27, 2026
c0f6ea9
fix: retry streamed record reads, close stream bodies, and do not fol…
claude Nov 27, 2026
1932a17
fix: guard stream bodies against a second send, retry log and dataset…
claude Nov 27, 2026
c868713
docs: align stream retry docs and Javadoc wording
claude Nov 27, 2026
231ef75
docs: list the callers of the one-argument transport methods correctly
claude Nov 27, 2026
65c76fc
feat!: split the Store search from the Store listing
claude Dec 3, 2026
5742fe4
feat!: port the streamed log resume, sync the Store with the 2026-12-…
claude Dec 3, 2026
2d75729
fix: redirect the last log message when a broken stream is not reopened
claude Dec 3, 2026
8d4bf1a
fix: do not redirect a log message twice after a stop during the replay
claude Dec 3, 2026
08c9f52
fix: keep the held-back log message and skip a truncated copy of it
claude Dec 3, 2026
885f3d1
fix: read the log instead of flushing a replay that was cut short
claude Dec 3, 2026
22552ff
fix: keep the fuller held-back message when a cut-short replay cannot…
claude Dec 3, 2026
53d68cb
fix: keep the longest copy of the held-back log message
claude Dec 3, 2026
0f4a5c7
fix: forget the held-back log message once a later one is redirected
claude Dec 3, 2026
4b73f8c
ci: do not create GitHub deployments for the tests environment
claude Dec 3, 2026
2fa5a09
fix: replace a held-back log message that is not a copy of the new one
claude Dec 3, 2026
f95d8a6
Merge remote-tracking branch 'origin/master' into HEAD
claude Dec 3, 2026
072080d
docs: state when the held-back log message is cleared
claude Dec 3, 2026
29de7ec
docs: use US spelling in a StreamedLog comment
claude Dec 3, 2026
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
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,42 @@ All notable changes to the Apify Java client are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.15.0] - 2026-12-03

### Added

- `StoreCollectionClient.search`, with `StoreSearchOptions` and `StoreSearchResult`, for a Store search. It sends one request and completes with the Actors and the limit the API applied.
- `StoreFilterOptions`, the filters that `StoreListOptions` and `StoreSearchOptions` share.
- `StreamedLogOptions.since` and `StreamedLog.getLastRedirectedAt`, to redirect only the log lines from a given time and to continue a redirection later.
- `StoreActorStats`, the statistics of a Store Actor: `totalUsers`, `totalRuns`, `totalUsers7Days`, `totalUsers30Days`, `totalUsers90Days`, `actorReviewRating`, and `actorReviewCount`.
- `ActorStoreListItem` getters for `userFullName`, `categories`, `notice`, `isVerified`, and `badge`.
- `KeyValueStoreClient.setRecord` overloads that take an `InputStream`. The stream is sent without being held in memory, and the upload is not retried or compressed. Like a request to an Actor's server, it needs an `HttpTransport` that can disable redirects.
- `KeyValueStoreClient.getRecordStream` and `KeyValueStoreRecordStream`, which read a record as an `InputStream`. The request is retried like any other.
- `InputStream` as the input of `ActorClient.start`, `ActorClient.call`, `TaskClient.start`, and `TaskClient.call`, and as the body of `ActorServerClient.request` and `requestStream`. A stream is sent once, with no retry, and needs an `HttpTransport` that can disable redirects.
- `APIFY_AI` run origin.

### Changed

- Updated to Apify OpenAPI specification `v2-2026-12-02T102104Z`.
- **Breaking:** `ActorStoreListItem.getStats()` returns `StoreActorStats` instead of `ActorStats`. The Store no longer returns `totalBuilds`, `totalMetamorphs`, and `lastRunStartedAt`.
- **Breaking:** the `StoreListOptions` filter setters (`category`, `username`, `pricingModel`, `includeUnrunnableActors`, `responseFormat`, `includeInputSchema`) now come from `StoreFilterOptions`. Code compiled against 0.14.x must be recompiled.
- **Breaking:** `StreamedLog` takes `since` instead of `fromStart`: `new StreamedLog(logClient, destination, since)`.
- A `StreamedLog` reopens a log stream that is cut off while the run is still going and continues after the last redirected message.
- `StoreListOptions.category` takes comma-separated category IDs.
- `LogClient.stream` and `DatasetClient.streamItems` retry the request like any other, until the response headers arrive.
- `ActorVersionCollectionClient.create` and `ActorVersionClient.update` use the long timeout tier, since a version can carry its source files.
- Documented that creating an Actor with a name you already use fails with a `ConflictError` (`actor-name-not-unique`).
- Documented that the build OpenAPI definition needs an API token with access to the build, unless the Actor is public or the build's owner allows anyone with the ID to read.
- Documented that a public storage URL grants read access to the whole storage, and that its options do not limit it.
- `ActorClient.validateInput` and `RunClient.metamorph` throw `IllegalArgumentException` for an `InputStream` input, instead of serializing it to JSON.

### Removed

- **Breaking:** `StoreListOptions.search`. Use `StoreCollectionClient.search`: the Store answers a search with one page of at most 100 Actors and ignores `offset`.
- **Breaking:** `StoreListOptions.sortBy`, which the API ignores.
- **Breaking:** `StreamedLogOptions.fromStart`. Use `StreamedLogOptions.since`: `fromStart(false)` becomes `since(Instant.now())`, and `fromStart(true)` is the default.
- **Breaking:** `StoreListOptions.allowsAgenticUsers` and `ActorStoreListItem.getIsWhiteListedForAgenticPayments`, which the API no longer has.

## [0.14.1] - 2026-11-20

### Changed
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Maven (Maven Central is a default repository, so no extra configuration is neede
<dependency>
<groupId>com.apify</groupId>
<artifactId>apify-client</artifactId>
<version>0.14.1</version>
<version>0.15.0</version>
</dependency>
```

Expand All @@ -35,7 +35,7 @@ repositories {
}

dependencies {
implementation 'com.apify:apify-client:0.14.1'
implementation 'com.apify:apify-client:0.15.0'
}
```

Expand Down Expand Up @@ -308,15 +308,16 @@ both non-blocking. `HttpRequest` and `HttpResponse<T>` below are the JDK's `java

| Method | Signature | Contract |
|---|---|---|
| `sendAsync` | `CompletableFuture<HttpResponse<byte[]>> sendAsync(HttpRequest request)` | Sends the single, fully-prepared request (auth, `User-Agent` and any other headers are already set by the client) and completes the future with the response with its body fully buffered as `byte[]`. Used for every non-streaming call. |
| `sendStreamingAsync` | `CompletableFuture<HttpResponse<InputStream>> sendStreamingAsync(HttpRequest request)` | Sends the request and completes the future with the response body as a live `InputStream` for incremental consumption, used by log streaming (`LogClient.stream(...)`) and dataset export streaming (`DatasetClient.streamItems(...)`). The *caller* (the client) is responsible for closing the returned stream; an implementation must not close it itself before completing the future. |
| `sendAsync` | `CompletableFuture<HttpResponse<byte[]>> sendAsync(HttpRequest request)` | Sends the single, fully-prepared request (auth, `User-Agent` and any other headers are already set by the client) and completes the future with the response with its body fully buffered as `byte[]`. Used for every non-streaming call that follows redirects. |
| `sendStreamingAsync` | `CompletableFuture<HttpResponse<InputStream>> sendStreamingAsync(HttpRequest request)` | Sends the request and completes the future with the response body as a live `InputStream` for incremental consumption, used by log streaming (`LogClient.stream(...)`), dataset export streaming (`DatasetClient.streamItems(...)`), and record streaming (`KeyValueStoreClient.getRecordStream(...)`). The *caller* (the client) is responsible for closing the returned stream; an implementation must not close it itself before completing the future. |

Two further methods, `sendAsync(HttpRequest, boolean followRedirects)` and
`sendStreamingAsync(HttpRequest, boolean followRedirects)`, have default implementations that send
the request through the methods above when `followRedirects` is `true` and **fail** the future with an
`UnsupportedOperationException` when it is `false`. A request to an Actor's server (see
[Server Actors](docs/actors.md#server-actors)) is sent with `followRedirects` set to `false`, so
that the API token never follows a redirect to another host. Override both to support it: with
[Server Actors](docs/actors.md#server-actors)) and a request whose body is an `InputStream` are sent
with `followRedirects` set to `false`, so that the API token never follows a redirect to another
host and a stream is never sent twice. Override both to support it: with
`false`, return a redirect response as it is. `DefaultHttpTransport` does, also when it wraps your own
JDK `HttpClient` (it then copies the client's settings into one that does not follow redirects).

Expand Down Expand Up @@ -437,10 +438,10 @@ try {
The public `com.apify.client.Version` class (`import com.apify.client.Version;`) exposes two
constants:

- `Version.CLIENT_VERSION`: the semantic version of this client (`0.14.1`).
- `Version.CLIENT_VERSION`: the semantic version of this client (`0.15.0`).
- `Version.API_SPEC_VERSION`: the version of the [Apify OpenAPI specification](https://docs.apify.com/api/openapi.json)
(its `info.version` field) that this client's endpoints, parameters, and models were last generated
and checked against (`v2-2026-11-18T151559Z`). It is a snapshot, not a live compatibility
and checked against (`v2-2026-12-02T102104Z`). It is a snapshot, not a live compatibility
guarantee: the client keeps working against newer, backward-compatible spec revisions, but a
feature added to the API after this snapshot has no corresponding method here yet.

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ option types, so import each resource you use from its own package:
| `com.apify.client.build` | `Build`, `BuildClient`, `BuildCollectionClient`, `BuildActVersion`, `ActorDefinition`, `ActorDefinitionMeta`, `ActorDefinitionStorages`, `BuildMeta`, `BuildStats`, `BuildOptions`, `BuildUsage` |
| `com.apify.client.run` | `ActorRun`, `ActorRunStats`, `ActorRunOptions`, `ActorRunMeta`, `ActorRunStandby`, `ActorRunUsage`, `RunClient`, `RunCollectionClient`, `RunListOptions`, `LastRunOptions`, `MetamorphOptions`, `RunChargeOptions`, `RunResurrectOptions`, `SetStatusMessageOptions` |
| `com.apify.client.dataset` | `Dataset`, `DatasetClient`, `DatasetCollectionClient`, `DatasetListItemsOptions`, `DatasetDownloadOptions`, `DownloadItemsFormat` |
| `com.apify.client.keyvalue` | `KeyValueStore`, `KeyValueStoreClient`, `KeyValueStoreCollectionClient`, `KeyValueStoreRecord`, `KeyValueStoreKeysPage`, `KeyValueStoreKey`, `GetRecordOptions`, `SetRecordOptions`, `ListKeysOptions` |
| `com.apify.client.keyvalue` | `KeyValueStore`, `KeyValueStoreClient`, `KeyValueStoreCollectionClient`, `KeyValueStoreRecord`, `KeyValueStoreRecordStream`, `KeyValueStoreKeysPage`, `KeyValueStoreKey`, `GetRecordOptions`, `SetRecordOptions`, `ListKeysOptions` |
| `com.apify.client.requestqueue` | `RequestQueue`, `RequestQueueClient`, `RequestQueueCollectionClient`, `RequestQueueRequest`, `RequestQueueHead`, `LockedRequestQueueHead`, `RequestQueueOperationInfo`, `RequestLockInfo`, `UnlockRequestsResult`, `RequestsList`, `BatchAddResult`, `BatchDeleteResult`, `DeletedRequestInfo`, `ListRequestsOptions`, `BatchAddRequestsOptions` |
| `com.apify.client.task` | `Task`, `TaskStats`, `TaskOptions`, `TaskClient`, `TaskCollectionClient`, `TaskStartOptions`, `TaskCallOptions` |
| `com.apify.client.schedule` | `Schedule`, `ScheduleNotifications`, `ScheduleClient`, `ScheduleCollectionClient` |
| `com.apify.client.webhook` | `Webhook`, `WebhookStats`, `WebhookLastDispatch`, `WebhookClient`, `WebhookCollectionClient`, `WebhookDispatchCollectionClient`, `NestedWebhookCollectionClient`, `WebhookDispatch`, `WebhookDispatchClient`, `WebhookDispatchCall`, `WebhookDispatchWebhookInfo`, `WebhookDispatchEventData` |
| `com.apify.client.user` | `User`, `UserClient`, `UserProfile`, `UserProxy`, `UserPlan`, `ProxyGroup` |
| `com.apify.client.store` | `ActorStoreListItem`, `StoreCollectionClient`, `StoreListOptions`, `PricingInfo` |
| `com.apify.client.store` | `ActorStoreListItem`, `StoreActorStats`, `StoreCollectionClient`, `StoreFilterOptions`, `StoreListOptions`, `StoreSearchOptions`, `StoreSearchResult`, `PricingInfo` |
| `com.apify.client.log` | `LogClient`, `LogOptions`, `StreamedLog`, `StreamedLogOptions` |

For example, the [top-level README's dataset snippet](../README.md#quick-start) needs
Expand Down
13 changes: 7 additions & 6 deletions docs/actors.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ where `id` is an Actor ID or `username~name` (a `/` in the id is accepted and no
|---|---|
| `list(ActorListOptions)` | List the account's Actors. Completes with `PaginationList<Actor>`. |
| `iterate(ActorListOptions, Long chunkSize)` | Lazy `Flow.Publisher<Actor>` over all matches; the options' `limit` caps the total yielded (`null`/unset or non-positive = all), `chunkSize` sets the page size (`null` = server default). |
| `create(Object)` | Create a new Actor from a JSON-serializable definition. Completes with `Actor`. |
| `create(Object)` | Create a new Actor from a JSON-serializable definition. Completes with `Actor`. Fails with a `ConflictError` (409, `actor-name-not-unique`) if you already have an Actor with that name. |

`ActorListOptions` adds `my(Boolean)` (only Actors owned by the current user) and
`sortBy(String)` (e.g. `createdAt`, `stats.lastRunStartedAt`) on top of the standard offset/limit/desc.
Expand Down Expand Up @@ -46,7 +46,7 @@ Actor created = client.actors().create(Map.of(
| `get()` | Fetch the Actor. Completes with `Optional<Actor>`. |
| `update(Object)` | Update the Actor with the given fields. Completes with `Actor`. |
| `delete()` | Delete the Actor. |
| `start(Object input, ActorStartOptions)` | Start a run, returning immediately. Completes with `ActorRun`. The `input` is any JSON-serializable value, or a `byte[]`/`String` that is sent as it is (set the matching `ActorStartOptions.contentType(...)`), or `null`. |
| `start(Object input, ActorStartOptions)` | Start a run, returning immediately. Completes with `ActorRun`. The `input` is any JSON-serializable value, or a `byte[]`, `String`, or `InputStream` that is sent as it is (set the matching `ActorStartOptions.contentType(...)`), or `null`. A stream is read once, so its start is sent once: it is not retried, even with `waitForResources`. |
| `call(Object input, ActorStartOptions, Long waitSecs)` | Start a run and poll until it finishes (`null` waits indefinitely); does **not** stream the run's log. Completes with `ActorRun`. |
| `call(Object input, ActorCallOptions, Long waitSecs)` | As above, additionally streaming the run's log for the duration of the wait by default. Use `ActorCallOptions.disableLogStreaming()` to opt out, or `logOptions(StreamedLogOptions)` for a custom destination. |
| `validateInput(Object input)` / `validateInput(Object input, ValidateInputOptions)` | Validate an input against the Actor's input schema. Completes with `boolean`. `ValidateInputOptions` fields (optional): `build` (`String`), `contentType` (`String`). |
Expand Down Expand Up @@ -131,8 +131,9 @@ Actor's `standbyUrl` and `actorStandby` fields.
`ActorServerRequestOptions` fields (all optional): `method(String)` (`GET` by default; also `HEAD`,
`POST`, `PUT`, `DELETE`, `OPTIONS`, `TRACE`, `PATCH`), `param(String, Object)`/`params(Map)` (query
parameters, converted as for API calls: `null` is left out, a boolean is sent as `1`/`0`, a
collection comma-joined), `header(String, String)`/`headers(Map)`, `body(Object)` (a `byte[]` or
`String` is sent as it is; anything else is serialized to JSON and sent as `application/json`
collection comma-joined), `header(String, String)`/`headers(Map)`, `body(Object)` (a `byte[]`,
`String`, or `InputStream` is sent as it is, and a stream is sent once, with no retry, no
compression, and no redirect followed; anything else is serialized to JSON and sent as `application/json`
unless you set a `Content-Type` header), `parentRequestId(String)` (see
[Calling a Server Actor from a Server Actor](#calling-a-server-actor-from-a-server-actor)),
`compression(HttpCompressor)` and `timeout(Timeout)`
Expand Down Expand Up @@ -232,14 +233,14 @@ and deletes a single version and exposes its environment variables.
|---|---|
| `list(ListOptions)` | List the Actor's versions. Completes with `PaginationList<ActorVersion>`. The endpoint takes no query parameters; `options` (`offset`/`limit`/`desc`) is accepted only for signature consistency with every other `list(ListOptions)` and has no effect; pass `null`. |
| `iterate(ListOptions)` | Lazy `Flow.Publisher<ActorVersion>` over all versions; `limit` caps the total (`null`/unset or non-positive = all), applied client-side after the single fetch. `offset` has no effect and there is no page size to tune. |
| `create(Object version)` | Create a version. Completes with `ActorVersion`. |
| `create(Object version)` | Create a version. Completes with `ActorVersion`. Uses the long timeout tier, since the version can carry its source files. |

### `ActorVersionClient`: `client.actor(id).version(v)`

| Method | Description |
|---|---|
| `get()` | Fetch the version. Completes with `Optional<ActorVersion>`. |
| `update(Object)` | Update the version. Completes with `ActorVersion`. |
| `update(Object)` | Update the version. Completes with `ActorVersion`. Uses the long timeout tier, since the version can carry its source files. |
| `delete()` | Delete the version. |
| `envVars()` | An `ActorEnvVarCollectionClient` for the version's environment variables. |
| `envVar(String name)` | An `ActorEnvVarClient` for a single environment variable. |
Expand Down
2 changes: 1 addition & 1 deletion docs/builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ builds) and a single build with `client.build(id)`.
| `abort()` | Abort the build. Completes with `Build`. |
| `delete()` | Delete the build. |
| `waitForFinish(Long waitSecs)` | Poll until the build finishes (`null` waits indefinitely); see [the run equivalent](runs.md#runclient) for its 404 handling. Completes with `Build`. |
| `getOpenApiDefinition()` | The build's OpenAPI definition. Completes with `Optional<JsonNode>`. |
| `getOpenApiDefinition()` | The build's OpenAPI definition. Completes with `Optional<JsonNode>`. It needs an API token with access to the build, unless the Actor is public or the build's owner has general resource access set to "Anyone with ID can read"; otherwise the API answers `401` or `403`. |
| `log()` | A `LogClient` for the build's log. |

`Build` fields: `getId()`, `getActId()`, `getUserId()`, `getStatus()`, `getStartedAt()`,
Expand Down
Loading
Loading