Download the PHP package apify/apify-client without Composer

On this page you can find all versions of the php package apify/apify-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package apify-client

Apify API client for PHP

Official, but experimental — AI-generated and AI-maintained. This is an official Apify client, but it is experimental: it is generated and maintained by AI. Review the code before relying on it in production and report issues on the repository.

A resource-oriented PHP client for the Apify API, mirroring the official JavaScript reference client: start from an ApifyClient, then drill down into resources (Actors, runs, datasets, key-value stores, request queues, tasks, schedules, webhooks, the store, users and logs).

Requirements

Installation

Quick start

All snippets assume the client types are imported from their namespaces, e.g. use Apify\Client\ApifyClient;.

new ApifyClient('my-api-token') takes the token as an explicit argument — it does not read APIFY_TOKEN (or any other environment variable) automatically. Read it yourself if you want that, e.g. new ApifyClient(getenv('APIFY_TOKEN')).

Get your API token from the Apify Console → Settings → API & Integrations.

Configuration

The constructor accepts named arguments for non-default settings:

Argument Default Meaning
token null API token, sent as a Bearer token.
baseUrl https://api.apify.com API base URL; the /v2 suffix is appended automatically.
publicBaseUrl baseUrl Base URL used when building public, shareable resource URLs.
maxRetries 8 Maximum retries for failed requests.
minDelayBetweenRetriesMillis 500 Minimum delay between retries (exponential backoff).
maxDelayBetweenRetriesMillis timeoutSecs × 1000 (360000) Upper bound (milliseconds) on the growing inter-retry delay; defaults to the request timeout expressed in milliseconds.
timeoutSecs 360 Overall per-request timeout.
userAgentSuffix null Custom suffix appended to the User-Agent header.
httpClient Guzzle The replaceable transport (Apify\Client\Http\HttpClientInterface).

Requests are retried on network errors, HTTP 429 (rate limit) and 5xx responses, with exponential backoff and jitter. Other 4xx responses are thrown immediately as ApifyApiException, with one exception: a resource-not-found 404 (the API's record-not-found / record-or-token-not-found error type) on a single-resource fetch is not thrown — get() returns null and delete() is treated as a successful no-op (see Error handling).

Replaceable HTTP transport

The transport is the Apify\Client\Http\HttpClientInterface. The default is GuzzleHttpClient; you can wrap any PSR-18 client with Psr18HttpClient, or provide your own implementation:

Error handling

Methods that fetch a single resource return null when the resource does not exist (rather than throwing). Other API failures are thrown as Apify\Client\Exception\ApifyApiException:

ApifyApiException extends RuntimeException and exposes:

Accessor Returns
getStatusCode(): int HTTP status code of the error response.
getType(): ?string Machine-readable API error type (e.g. "record-not-found").
getApiMessage(): string Raw API error message, without the status/type prefix.
getMessage(): string Formatted message (apify API error (status …, type …): …), from Throwable.
getAttempt(): int 1-based number of the request attempt that produced the error.
getHttpMethod(): string HTTP method of the failed call (e.g. "GET").
getPath(): string Path of the API endpoint (URL excluding origin).
getData(): ?array Additional structured error data provided by the API, if any.

Transport-level failures (network errors, timeouts) are retried internally; only if every retry is exhausted does the underlying error surface, as an Apify\Client\Exception\TransportException (a RuntimeException; isTimeout() reports whether a request timed out). In short: ApifyApiException means the server returned an error response (a 4xx/5xx with a body), whereas TransportException means the request never produced a usable response (network failure or timeout) after all retries. Requests are retried on network errors, HTTP 429 and 5xx.

Versioning

Documentation

Full documentation lives in docs/, organized by resource, with runnable examples.

License

Apache-2.0.


All versions of apify-client with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
ext-mbstring Version *
ext-hash Version *
psr/http-message Version ^1.1 || ^2.0
psr/http-factory Version ^1.0
psr/http-client Version ^1.0
guzzlehttp/guzzle Version ^7.5
guzzlehttp/psr7 Version ^2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package apify/apify-client contains the following files

Loading the files please wait ...