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.
Documentation and CI compliance with the updated client requirements. No changes to the
public API or to the OpenAPI spec version (v2-2026-06-18T095846Z), so there are no breaking
changes.
- CI: a standalone
Test examplesstep in the Go integration workflow that actually runs the documentation example code end-to-end. It executes the example programs inexamples/against the live API (theTestExample*smoke tests, each runninggo run ./examples/<name>) and validates that every in-documentationgosnippet is valid, runnable, and gofmt-formatted (the newTestDocSnippets*tests, which extract every ```go block from the README anddocs/and compile each one). The `Integration tests` step now skips these so the two concerns stay separate, mirroring the Rust sibling client. - Tests:
tests/docs_snippets_test.go, an offline doc-snippet harness (Go has no Markdown doctest equivalent) that enforces the requirement that each in-documentation code snippet is valid, runnable, and properly formatted.
- Workflow now also triggers on
docs/**andREADME.mdchanges, so documentation edits re-run the snippet validation.
- Reformatted all
docs/and README code snippets to canonical gofmt output (one-lineif err != nil { ... }blocks expanded, tab indentation, aligned trailing comments) and made the custom-HTTP-transport snippet a complete, compilable program. - Corrected the README versioning note, which referenced the older spec version
v2-2026-06-16T064758Zinstead of the currentv2-2026-06-18T095846Z.
- Documented the shared
ListOptionstype (fields + example) indocs/README.md, which several resource pages reference as a method argument but which was previously undefined in the docs. - Documented the
apify.ListDatasetItems[T]generic helper's argument types and added a runnable typed-decoding example indocs/storages.md. - Added explicit field listings for the
ActorRun,Build,User, andActorStoreListItemresponse models todocs/runs.md,docs/builds.md, anddocs/misc.md. - Added full field listings in
docs/storages.mdfor the storage option/parameter structs that were previously named in method tables but not enumerated:DatasetListItemsOptions,DatasetDownloadOptions,ListKeysOptions,GetRecordOptions,GetRecordsOptions,ListRequestsOptions, and theRequestQueueRequestpayload. - Documented the storage return types that examples dereference:
KeyValueStoreRecord,KeyValueStoreKeysPage(andKeyValueStoreKey),RequestQueueHead,RequestQueueOperationInfo, andBatchAddResultindocs/storages.md. - Added field tables for the remaining response models (
Actor,Task,Schedule,Webhook,WebhookDispatch) to their resource pages, matching the treatment ofActorRun/Build. - Documented the accepted values / details of the enum-like parameters
RunListOptions.Status,ListRequestsOptions.Filter("locked"/"pending"),DatasetListItemsOptions.View, and the fullStorageListOptionsfield table; and clarified indocs/README.mdthat the within-storage listers (ListKeys,ListHead) return their own page/head containers rather thanPaginationList[T]. - Expanded the run/Actor/store input option structs from bare name lists into full
field/type/meaning tables:
ActorStartOptions(including the nested ad-hocWebhookselement shape andForcePermissionLevel),ActorBuildOptions,ActorListOptions,StoreListOptions(with enum values forSortBy/PricingModel),RunResurrectOptions,MetamorphOptions, andLogOptions; and madeStorageListOptions.Ownershipstate its accepted values definitively. - Documented the schedule
actionspayload shape with a runnableRUN_ACTORaction example indocs/schedules.md, replacing the empty[]any{}placeholder. - Stated the closed enum sets definitively (verified against the OpenAPI spec) instead of hedging
with "e.g.":
StoreListOptions.PricingModel(FREE,FLAT_PRICE_PER_MONTH,PRICE_PER_DATASET_ITEM,PAY_PER_EVENT— previously omittedPAY_PER_EVENT),StoreListOptions.ResponseFormat(full,agent— previously unspecified),ActorStartOptions.ForcePermissionLevel(LIMITED_PERMISSIONS,FULL_PERMISSIONS), andActorListOptions.SortBy(createdAt,stats.lastRunStartedAt). - Corrected and completed the run/build status enum documentation: the canonical
ActorJobStatusenum has eight values, but the docs (and theActorRun.Statusin-code comment) listed only six for runs and four for builds. NowActorRun.Status,RunListOptions.Status, andBuild.Statusall document the full setREADY,RUNNING,SUCCEEDED,FAILED,TIMING-OUT,TIMED-OUT,ABORTING,ABORTED. (Behavior unchanged:IsTerminalstill treats only the four terminal states as finished, which is correct.) - Documented the closed enums in the actor/version
Createdefinition (sourceType=VersionSourceType:SOURCE_FILES/GIT_REPO/TARBALL/GITHUB_GIST/SOURCE_CODE; source-fileformat=TEXT/BASE64) with a runnableSOURCE_FILESexample indocs/actors.md. - Enumerated the closed 12-value
WebhookEventTypeset indocs/webhooks.mdand cross-referenced it from theActorStartOptions.Webhooksnote.
Verified against OpenAPI specification version v2-2026-06-18T095846Z (bumped from
v2-2026-06-16T064758Z). The spec delta is purely additive — two optional query
parameters — so there are no breaking changes.
ActorClient.ValidateInputForBuild(ctx, input, build)exposes the new optionalbuildquery parameter onPOST /v2/actors/{actorId}/validate-input, validating input against the input schema of a specific Actor build (tag or number).ValidateInputis unchanged and now delegates with an empty build (omitting the parameter, so the API validates against the build taggedlatest, per the OpenAPI specification).UserClient.MonthlyUsageForDate(ctx, date)exposes the new optionaldatequery parameter (YYYY-MM-DD) onGET /v2/users/me/usage/monthly, selecting the month to report usage for.MonthlyUsageis unchanged and now delegates with an empty date (omitting the parameter, so the current month is reported).
API_SPEC_VERSIONbumped tov2-2026-06-18T095846Z.
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.