Download the PHP package cotizave/sdk without Composer
On this page you can find all versions of the php package cotizave/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package sdk
Short Description Official PHP SDK for the Cotizave API v2 — multi-country exchange-rate references, conversions, history, banks and calendars.
License MIT
Homepage https://github.com/cotizave/cotizave-php
Informations about the package sdk
Install
Requires PHP 8.3+. The HTTP engine is Guzzle; a custom Guzzle handler can be supplied (e.g. for testing or instrumentation).
Quick start
Keep your API key server-side. It is sent only as the
X-API-Keyheader. Never ship it in client-side code.
Authentication
What you can do
| Area | Call |
|---|---|
| Rates of a country | $client->rates->list('CO') |
| One rate by id | $client->rates->get('CO', 'co-trm') |
| Past board of a country | $client->rates->snapshot('AR', '2026-10-01') |
| Official rate of every country | $client->rates->global(['symbols' => ['BRL', 'EUR']]) |
| Convert one amount | $client->convert(['from' => 'USD', 'to' => 'BRL', 'amount' => 100]) |
| Convert up to 50 amounts | $client->convertBulk([...]) |
| Point-in-time history | $client->history->get('CO', 'co-trm', '2026-10-01') |
| Daily history series | $client->history->daily('AR', 'ar-official', ['from' => '...', 'to' => '...']) |
| Period statistics | $client->history->stats('AR', 'ar-official', ['from' => '...', 'to' => '...', 'movingAverage' => 7]) |
| Raw captures (paginated) | $client->history->raw(...) / $client->history->iterate(...) |
| History coverage | $client->history->limits() |
| Rate catalog | $client->markets('VE') |
| Spread vs another market | $client->spread('VE', ['against' => 've-paralelo']) |
| Best executable route | $client->route('VE', ['from' => 'USD', 'to' => 'VES', 'amount' => 100]) |
| Bank-published rates | $client->bankRates('VE') |
| Countries / currencies | $client->countries->list() · $client->currencies->list() |
| Banks / issuers | $client->banks->list('VE') · $client->issuers->list() |
| Holidays & business days | $client->holidays->list('AR') · $client->holidays->businessDays('VE', ['from' => '2026-10-01', 'days' => 5]) |
| Stablecoins (USD) | $client->crypto->list() · $client->crypto->get('usdt-usd') |
Responses are plain associative arrays, annotated with PHPStan array shapes for
static analysis. The fields present depend on your plan, the country and the
market — read them defensively and check the
API reference.
Iterating raw history safely
iterate follows the server's cursors for you and stops at maxPages
(default 50) so it never silently downloads an entire history.
Errors
Every failure throws a subclass of Cotizave\Exception\CotizaveException:
| Exception | HTTP |
|---|---|
BadRequestException |
400 |
AuthenticationException |
401 |
FeatureNotInPlanException |
402 |
ForbiddenException |
403 |
NotFoundException |
404 |
NotAcceptableException |
406 |
UnprocessableException |
422 |
RateLimitException |
429 |
ServerException |
5xx |
ConnectionException / TimeoutException |
no response (network/timeout) |
Each exception carries status, errorCode, getMessage(), optional
field/details, and rateLimit() / headers() / requestId().
Configuration
Everything has a production-safe default; override only what you need:
Per-call overrides are accepted as the last argument of every method
(timeout, maxRetries, headers, language):
Retry policy
Only idempotent (GET) requests are retried. A 429 is retried only when it is a
burst (per-minute) limit, honoring the server's Retry-After; a 429 from an
exhausted monthly quota is never retried. Connection and timeout errors, and the
configured 5xx statuses, are retried with exponential backoff and full jitter,
bounded by maxRetries and the maxRetryDelay budget.
Exporting CSV / XML
Low-level requests
Customising the HTTP handler
The transport builds its own Guzzle client (with the SDK's retry middleware on
the handler stack). To customise the underlying transport — for tests,
instrumentation, or a bespoke handler — pass a Guzzle handler callable:
The SDK always sends with redirects disabled and the key as a header, so a custom handler can never be made to follow a redirect or leak your API key.
Security
- The API key is sent only as the
X-API-Keyheader and is never exposed on$client->config, in exception messages, or in a query string. - Every request is pinned to the configured origin; a path that resolves to a different host is refused, and redirects are never followed.
- Response bodies are capped at
maxResponseBytesto guard against an oversized or decompression-bomb response.
Found a security issue? See SECURITY.md.
License
MIT
All versions of sdk with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.8
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0