Download the PHP package truelist/truelist-php without Composer
On this page you can find all versions of the php package truelist/truelist-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download truelist/truelist-php
More information about truelist/truelist-php
Files in truelist/truelist-php
Package truelist-php
Short Description PHP SDK for the Truelist email validation API
License MIT
Homepage https://truelist.io
Informations about the package truelist-php
Truelist PHP SDK
PHP SDK for the Truelist email validation API.
Requirements
- PHP 8.1+
- Guzzle 7.0+
Start free — 100 validations + 10 enhanced credits, no credit card required. Get your API key →
Installation
Quick Start
Configuration
| Option | Default | Description |
|---|---|---|
base_url |
https://api.truelist.io |
API base URL |
timeout |
10 |
Request timeout in seconds |
max_retries |
2 |
Number of retries on 429/5xx errors (with exponential backoff) |
raise_on_error |
false |
When false, transient errors return an unknown result. When true, they throw. |
Methods
validate(string $email): ValidationResult
Validates an email address. Sends a POST to /api/v1/verify_inline with the email as a query parameter.
account(): AccountInfo
Retrieves account information from GET /me.
Result Predicates
Response States
| State | Description |
|---|---|
ok |
Email is valid and deliverable |
email_invalid |
Email is not deliverable |
accept_all |
Domain accepts all emails (catch-all) |
unknown |
Could not determine validity |
Response Sub-States
| Sub-State | Description |
|---|---|
email_ok |
Email is valid |
is_disposable |
Disposable/temporary email |
is_role |
Role-based address (info@, admin@) |
failed_smtp_check |
SMTP check failed |
unknown_error |
Could not determine |
Error Handling
The SDK uses a hierarchy of exceptions:
TruelistException-- base exceptionAuthenticationException-- invalid API key (401). Always thrown, never suppressed.RateLimitException-- rate limit exceeded (429)ApiException-- server errors (5xx), connection errors
Auth Errors Always Throw
Authentication errors (HTTP 401) always throw an AuthenticationException, regardless of the raise_on_error setting.
Transient Error Behavior
For transient errors (429, 5xx, timeouts), behavior depends on raise_on_error:
Retry Behavior
The SDK automatically retries on 429 and 5xx errors with exponential backoff. Configure with max_retries (default: 2). Auth errors (401) are never retried.
Testing
Getting Started
Sign up for a free Truelist account to get your API key. The free plan includes 100 validations and 10 enhanced credits — no credit card required.
License
MIT