All notable changes to the Apify Go client are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Initial release of the official Go client for the Apify API, verified against OpenAPI
specification version v2-2026-06-16T064758Z.
- Resource-oriented
ApifyClientmirroring the official JavaScript and Rust clients, with accessors for Actors, Actor versions and environment variables, builds, runs, datasets, key-value stores, request queues, tasks, schedules, webhooks, webhook dispatches, the Apify Store, users, and logs. - Replaceable HTTP transport via the
HTTPBackendinterface (defaultDefaultHTTPBackend), configurable throughWithHTTPBackend. - Cross-cutting request behaviour applied to every call: bearer-token authentication, the
mandated
User-Agentheader, exponential-backoff-with-jitter retries (429 and 5xx and network errors), and a growing-but-capped per-attempt timeout. - Convenience helpers matching the reference clients:
Actor.Call/Task.Call(start and wait),Build.WaitForFinish/Run.WaitForFinish,Actor.DefaultBuild,Actor.ValidateInput,Run.Metamorph/Reboot/Resurrect/Charge, run-nested default storages (Run.Dataset/KeyValueStore/RequestQueue/Log), lazyStore.IterateandRequestQueue.PaginateRequestsiterators, datasetDownloadItems/GetStatistics/CreateItemsPublicURL, key-value-storeGetRecords(ZIP), record public URLs and key-list public URLs with HMAC-SHA256 signing, request-queue lock lifecycle, andApifyClient.SetStatusMessage. - Public version constants
CLIENT_VERSIONandAPI_SPEC_VERSION. - Forward-compatible models that capture unmodelled API fields in an
Extramap. - Offline unit tests (mock HTTP backend) covering retries, error parsing, 404→absent mapping, the User-Agent format, base-URL resolution, and the storage-signature scheme.
- Integration test suite (one simple GET plus one CRUD flow per resource) and runnable, CI-tested documentation examples.
- A language-specific GitHub Actions workflow that runs gofmt, go vet, build, unit tests and integration tests, triggered by PRs to master touching Go code or manual dispatch.
RunClient.Chargenow always sends anidempotency-keyheader (auto-generated when not supplied), so a transport-retried charge is applied at most once — matching the reference client and preventing double-charging.KeyValueStoreClient.GetRecordnow defaultsattachmentto the truthy form, matching the reference client's record-fetch behaviour. (On the wire this client serialises booleans as1/0, so the request carriesattachment=1; functionally equivalent to the reference client'sattachment=true.)WaitForFinish(used byRun.WaitForFinish,Build.WaitForFinish,Actor.Call,Task.Call) no longer hangs forever on a transient404during an indefinite wait (waitSecs == nil). A just-started run/build can briefly return404because of database-replica lag; the wait now polls through404s on a pure time bound (defaulting an indefinite wait to a finite upper bound, mirroring the reference client'sMAX_WAIT_FOR_FINISH) and, if the resource never becomes available within the budget, returns a descriptive error instead of spinning until the context is cancelled.
RunClient.Chargenow takes aRunChargeOptions{EventName, Count, IdempotencyKey}struct.RunClient.Metamorphnow takes aMetamorphOptions{Build, ContentType}struct.RunResurrectOptionsgainedMaxItems,MaxTotalChargeUsd,RestartOnError(all in the spec and the reference client).RunClient.GetWithWaitandBuildClient.GetWithWaitexpose the spec'swaitForFinishquery parameter for a server-side synchronous fetch.RunCollectionClient.ListStatusfilter accepts multiple statuses ([]string, comma-separated), as the API allows.RequestQueueClient.BatchAddRequestsauto-chunks inputs at the API's 25-per-call limit and returns a typedBatchAddResult{ProcessedRequests, UnprocessedRequests}.RequestQueueClient.ListRequestsvalidates its options (mutually-exclusiveExclusiveStartID/Cursor;Filterrestricted tolocked/pending).- Tasks use a dedicated
TaskStartOptionsthat omits the Actor-onlycontentTypeandforcePermissionLevelfields (which the task run endpoint does not accept). LogClientexposes the spec'sraw/downloadoptions viaGetWithOptions/StreamWithOptions, andRunClient.GetStreamedLogprovides a raw live-stream convenience.RunClient.Abortnow takesgracefully *boolinstead ofbool. Passingnilomits thegracefullyquery parameter entirely (letting the server apply its default, immediate abort), matching the reference client's optionalgracefullyoption; pass a pointer totrue/falseto request a graceful/immediate abort explicitly.
- Intentionally unimplemented endpoints (a deliberate, parity-driven decision matching the
JavaScript reference and the Rust sibling — not an accidental gap):
- The synchronous run endpoints (
run-sync,run-sync-get-dataset-items). - The keyed-
POSTrecord aliases. - The cryptographic tools
POST /v2/tools/encode-and-signandPOST /v2/tools/decode-and-verify. These are server-side conveniences for the same HMAC-SHA256 signing this client already performs locally insignature.go; the reference clients do not expose them, so the Go client omits them for cross-client parity. They can be added alongsidesignature.goif a future requirement needs them. /v2/browser-info. Not exposed by the reference clients; omitted for parity. Only documented endpoints are implemented; the omissions above are the conscious exceptions.
- The synchronous run endpoints (
- User-Agent
isAtHomeflag: the canonical reference (JS) reads theAPIFY_IS_AT_HOMEenvironment variable, whileclient_requirements.md's worked example uses the bare nameisAtHome. These two same-priority requirements conflict, so the client honours both variable names (either being set marks the client "at home"). The flag is rendered lowercase (true/false) to stay byte-consistent with the JS reference; the requirements'True/Falsecapitalisation is treated as a cosmetic example, with JS consistency winning. Dataset/KeyValueStoreGetOrCreatetake only a name: this spec version's create endpoints declare no request body orschemaparameter, so a schema argument would be an undocumented extension. Theruns/lastendpoints accept onlystatus(noorigin) in this spec version. These choices favour strict OpenAPI compliance over the JS superset.- CI runs
golangci-lint(default high-signal analyzers — errcheck, govet, ineffassign, staticcheck, unused — plusmisspell) in addition togofmt,go vet, andgo build, satisfying the coding-rule mandate that linting run in CI. Config in.golangci.yml.