Download the PHP package xratesapi/php-sdk without Composer
On this page you can find all versions of the php package xratesapi/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xratesapi/php-sdk
More information about xratesapi/php-sdk
Files in xratesapi/php-sdk
Package php-sdk
Short Description Official PHP SDK for the XRates exchange rate API — multi-source FX rates with a single REST endpoint.
License MIT
Homepage https://xratesapi.com
Informations about the package php-sdk
XRates PHP SDK
Official PHP client for the XRates exchange rate API. Multi-source FX rates aggregated from ECB, CBR, FloatRates, fawazahmed0 and IMF, served via a single REST endpoint.
- Documentation: https://xratesapi.com/docs
- Free tier: 100 requests/month, no credit card — sign up
- Status: https://xratesapi.com/status
Requirements
- PHP 8.1+
- Guzzle 7.5+ (or any PSR-compatible HTTP client)
Installation
Quick start
Error handling
Every HTTP error maps to one of four exception types, all extending XRatesApi\Exceptions\ApiException:
| HTTP | Exception | When |
|---|---|---|
| 401 / 403 | AuthenticationException |
Missing or invalid API key |
| 422 | ValidationException |
Bad request parameters; ->payload() has the full error array |
| 429 | RateLimitException |
Hit the per-plan rate limit |
| other | ApiException |
Network errors, 5xx, unexpected responses |
Custom HTTP client
The constructor accepts any \GuzzleHttp\ClientInterface, so you can plug in your own configured client (timeouts, retry middleware, proxy, etc.):
Custom base URL
Useful for tests or self-hosted deployments:
Versioning
This SDK follows semver. The Client::VERSION constant is sent in the User-Agent header on every request, which helps us debug integration issues if you contact support.
Contributing
PRs welcome. Run the tests:
License
MIT — see LICENSE file.