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
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ All notable changes to the Apify Go 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-11-06

### Added

- `ActorClient.Server()` returns an `ActorServerClient` for Server Actors (formerly Actor Standby):
`GetURL`, `GetOpenAPISpec`, `Request` and `RequestStream`. `ActorClient.Standby()` is a
deprecated alias.
- `ErrNotServerActor`, and `FollowsRedirects`: the requests to a Server Actor do not follow
redirects with the default `HTTPBackend`, so the token never reaches another host. A custom
`HTTPBackend` that follows redirects has to check `FollowsRedirects` itself.
- `Actor.StandbyURL` (normalized) and `ActorVersion.ActorPath`, the Actor's directory inside the
uploaded source of a `SOURCE_FILES` or `TARBALL` version.

### Changed

- `DatasetClient.CreateItemsPublicURL`, `CreateItemsPublicURLWithFormat` and
`KeyValueStoreClient.CreateKeysPublicURL` reject an `expiresInSecs` of zero or below, which gave
a URL that was already expired. Pass nil for a URL that never expires.
- Bumped `APISpecVersion` to `v2-2026-11-04T151257Z` and `ClientVersion` to `0.15.0`.
- `PaginationList.Count` of a page from `DatasetClient.ListItems` is the number of rows the API
scanned, or the number of items returned when that is larger. With filters it can be above
`len(Items)`. Iterators step by `Count`, capped at the requested limit.
- `standbyUrl` is no longer in the `Extra` map of `Actor`, and `actorPath` is no longer in the
`Extra` map of `ActorVersion`.
- Documented that `TARBALL` is a zip archive, and the `actorPath` rules.

## [0.14.0] - 2026-10-30

### Added
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ request queues, tasks, schedules, webhooks, the store, users and logs).
- Replaceable HTTP transport (the `HTTPBackend` interface) with a default implementation.
- Convenience helpers: start-and-wait with live log redirection, build/run polling, lazy store
and request-queue iterators, live iteration of a running Actor's dataset items, dataset
export, signed public URLs, request-queue locking, and more.
export, signed public URLs, request-queue locking, requests to Server Actors, and more.
- Forward-compatible models that keep unknown API fields in an `Extra` map.
- A single third-party dependency (`github.com/andybalholm/brotli`, used for Brotli
request-body compression); everything else is the Go standard library.
Expand Down Expand Up @@ -199,6 +199,7 @@ decoding the response fail.
| `client.Store()` | `*StoreCollectionClient` | Browse and iterate the Apify Store. |
| `client.Me()` / `client.User(id)` | `*UserClient` | Account details, usage and limits (for your own account or your organization with `User(id)`). |
| `client.Log(buildOrRunID)` | `*LogClient` | Read or stream a build/run log. |
| `client.Actor(id).Server()` | `*ActorServerClient` | Send requests to a Server Actor (formerly Actor Standby) and get its URL and OpenAPI specification. See [docs/server_actors.md](docs/server_actors.md). |

## Error handling

Expand Down Expand Up @@ -251,7 +252,10 @@ same way, with no separate option needed.
## Custom HTTP transport

The transport is replaceable. Implement `HTTPBackend` (a single `Do` method) to integrate a
custom client, proxy, or test double, and pass it with `WithHTTPBackend`:
custom client, proxy, or test double, and pass it with `WithHTTPBackend`. A backend that follows
redirects must not follow them for a request that `apify.FollowsRedirects(req)` reports false for,
as the requests to a [Server Actor](docs/server_actors.md) carry a token meant for one host only,
and a redirect to another host would send it there:

```go
package main
Expand All @@ -266,7 +270,13 @@ import (
type myBackend struct{ inner *http.Client }

func (b *myBackend) Do(req *http.Request) (*http.Response, error) {
return b.inner.Do(req)
if apify.FollowsRedirects(req) {
return b.inner.Do(req)
}
// This request carries a token meant for one host only, so a redirect is returned as it is.
client := *b.inner
client.CheckRedirect = func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }
return client.Do(req)
}

func main() {
Expand All @@ -282,7 +292,7 @@ func main() {

- `apify.ClientVersion` — the semantic version of this library.
- `apify.APISpecVersion` — the Apify OpenAPI spec version this client was built against
(`v2-2026-10-29T100357Z`).
(`v2-2026-11-04T151257Z`).

### Releasing

Expand Down Expand Up @@ -326,7 +336,7 @@ APIFY_TOKEN=<your-token> go run ./examples/run_store_actor
## Documentation

Per-resource guides are in [`docs/`](docs):
[actors](docs/actors.md), [builds](docs/builds.md), [runs](docs/runs.md),
[actors](docs/actors.md), [server Actors](docs/server_actors.md), [builds](docs/builds.md), [runs](docs/runs.md),
[tasks](docs/tasks.md), [storages](docs/storages.md), [schedules](docs/schedules.md),
[webhooks](docs/webhooks.md), [misc (store, users, logs)](docs/misc.md).

Expand Down
4 changes: 4 additions & 0 deletions actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/base64"
"encoding/json"
"net/http"
"sync"
"time"
)

Expand Down Expand Up @@ -101,6 +102,9 @@ type ActorClient struct {
ctx *resourceContext
baseURL string
id string

serverOnce sync.Once
server *ActorServerClient
}

func newActorClient(root *ApifyClient, hc *httpClient, baseURL, id string) *ActorClient {
Expand Down
Loading
Loading