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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ 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.1.1] - 2026-07-07

### Changed

- Verified the client against OpenAPI specification version `v2-2026-07-07T132551Z` and bumped
`Version.API_SPEC_VERSION` accordingly.
- Corrected the `LastRunOptions` documentation: `origin` is now a spec-declared query parameter on
the `runs/last` endpoints (behaviour unchanged).

## [0.1.0] - 2026-07-03

Initial release of the official (experimental, AI-generated and AI-maintained) Java client for the
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Maven:
<dependency>
<groupId>com.apify</groupId>
<artifactId>apify-client</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
</dependency>
```

Gradle:

```groovy
implementation 'com.apify:apify-client:0.1.0'
implementation 'com.apify:apify-client:0.1.1'
```

## Quick start
Expand Down Expand Up @@ -122,9 +122,9 @@ try {

## Versioning

- `Version.CLIENT_VERSION` — the semantic version of this client (`0.1.0`).
- `Version.CLIENT_VERSION` — the semantic version of this client (`0.1.1`).
- `Version.API_SPEC_VERSION` — the Apify OpenAPI specification version this client was verified
against (`v2-2026-07-02T131926Z`).
against (`v2-2026-07-07T132551Z`).

Changes to the public interface other than additive ones are considered breaking changes and follow
[Semantic Versioning](https://semver.org/).
Expand Down
44 changes: 27 additions & 17 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,38 @@ System.out.println("Item count: " + items.getCount());
## Each storage: create, push, read

```java
// Dataset
// Named storages persist on your account; each block deletes its storage in a finally so the
// example does not leak them.

// Dataset: create, push items, read them back.
Dataset dataset = client.datasets().getOrCreate("example-ds");
client.dataset(dataset.getId()).pushItems(List.of(Map.of("hello", "world")));
PaginationList<JsonNode> dsItems = client.dataset(dataset.getId()).listItems(new DatasetListItemsOptions());
System.out.println("Dataset items: " + dsItems.getCount());
try {
client.dataset(dataset.getId()).pushItems(List.of(Map.of("hello", "world")));
PaginationList<JsonNode> items = client.dataset(dataset.getId()).listItems(new DatasetListItemsOptions());
System.out.println("Dataset items: " + items.getItems());
} finally {
client.dataset(dataset.getId()).delete();
}

// Key-value store
// Key-value store: create, set a record, read it back.
KeyValueStore store = client.keyValueStores().getOrCreate("example-kvs");
client.keyValueStore(store.getId()).setRecordJson("OUTPUT", Map.of("answer", 42));
Optional<KeyValueStoreRecord> record = client.keyValueStore(store.getId()).getRecord("OUTPUT");
record.ifPresent(r -> System.out.println("OUTPUT bytes: " + r.getValue().length));
try {
client.keyValueStore(store.getId()).setRecordJson("OUTPUT", Map.of("answer", 42));
Optional<KeyValueStoreRecord> record = client.keyValueStore(store.getId()).getRecord("OUTPUT");
record.ifPresent(r -> System.out.println("KVS record bytes: " + r.getValue().length));
} finally {
client.keyValueStore(store.getId()).delete();
}

// Request queue
// Request queue: create, add a request, read the head.
RequestQueue queue = client.requestQueues().getOrCreate("example-rq");
client.requestQueue(queue.getId()).addRequest(new RequestQueueRequest("https://example.com", "example"), false);
RequestQueueHead head = client.requestQueue(queue.getId()).listHead(10L);
System.out.println("Queue head items: " + head.getItems().size());

// Named storages persist on your account; delete them when done so the example does not leak them.
client.dataset(dataset.getId()).delete();
client.keyValueStore(store.getId()).delete();
client.requestQueue(queue.getId()).delete();
try {
client.requestQueue(queue.getId()).addRequest(new RequestQueueRequest("https://example.com", "example"), false);
RequestQueueHead head = client.requestQueue(queue.getId()).listHead(10L);
System.out.println("Request queue head size: " + head.getItems().size());
} finally {
client.requestQueue(queue.getId()).delete();
}
```

## Get own account details
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.apify</groupId>
<artifactId>apify-client</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
<packaging>jar</packaging>

<name>Apify Java Client</name>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/apify/client/LastRunOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* Filters which "last" run the {@link ActorClient#lastRun}/{@link TaskClient#lastRun} accessors
* resolve to. Leave a field unset to leave that filter unset.
*
* <p>{@code origin} is an Apify-platform convenience exposed by the reference client but not
* documented as a query parameter in the OpenAPI spec; it is included for parity, threaded to the
* same {@code runs/last} endpoint.
* <p>{@code origin} is now a spec-declared query parameter on the {@code runs/last} endpoints
* (alongside {@code status}), matching the reference client's {@code lastRun({status, origin})}.
* The spec also declares {@code waitForFinish} on those endpoints, but the reference client does
* not expose it on {@code lastRun}, so neither do we.
*/
public final class LastRunOptions {
private String status;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/apify/client/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public final class Version {
* The semantic version of this client library (see <a href="https://semver.org/">SemVer</a>).
* Changes to the public interface other than additive ones are considered breaking changes.
*/
public static final String CLIENT_VERSION = "0.1.0";
public static final String CLIENT_VERSION = "0.1.1";

/**
* The version of the Apify OpenAPI specification this client was generated and verified against.
* Corresponds to the {@code info.version} field of the Apify OpenAPI document.
*/
public static final String API_SPEC_VERSION = "v2-2026-07-02T131926Z";
public static final String API_SPEC_VERSION = "v2-2026-07-07T132551Z";

private Version() {}
}
Loading