jeffersongoncalves / laravel-apollo
PHP/Laravel client for the Apollo.io REST API: people and organization search, enrichment, and bulk enrichment.
Package info
github.com/jeffersongoncalves/laravel-apollo
pkg:composer/jeffersongoncalves/laravel-apollo
Fund package maintenance!
Requires
- php: ^8.2
- illuminate/http: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.21
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel Apollo
A PHP/Laravel client for the Apollo.io REST API. Covers people search, organization search, and enrichment (single, bulk, and organization) through a simple, typed API built on Laravel's Http client.
Features
- People: search with title/location/seniority/employee-range/keyword filters, enrich by email/LinkedIn/name+domain, bulk enrich by email
- Organizations: search with location/employee-range/keyword filters, enrich by domain
- Throws
ApolloException(with the original API error body) on any non-2xx response - Throws
InvalidArgumentExceptionbefore hitting the API when required criteria are missing
Installation
You can install the package via composer:
composer require jeffersongoncalves/laravel-apollo
Publish the config file:
php artisan vendor:publish --tag=apollo-config
Set your Apollo.io API key in .env:
APOLLO_API_KEY=your-api-key
Find it under Settings > Integrations > API in your Apollo.io account.
Configuration
// config/apollo.php return [ 'api_key' => env('APOLLO_API_KEY', ''), 'default_per_page' => env('APOLLO_DEFAULT_PER_PAGE', 25), ];
Usage
The package is resolved via the Apollo facade or by injecting JeffersonGoncalves\Apollo\Apollo. Each resource is exposed as a method returning a dedicated resource class.
People
use JeffersonGoncalves\Apollo\Facades\Apollo; // Search (supports titles, locations, seniorities, employee_ranges, keywords, page, per_page) $people = Apollo::people()->search([ 'titles' => 'CEO,CTO', 'locations' => 'United States,Canada', 'seniorities' => 'founder,c_suite', 'employee_ranges' => '1-10,11-50', 'keywords' => 'fintech', 'page' => 1, ]); // Enrich by email, by LinkedIn URL, or by first name + domain $person = Apollo::people()->enrich(['email' => 'jane@example.com']); $person = Apollo::people()->enrich(['linkedin' => 'https://linkedin.com/in/janedoe']); $person = Apollo::people()->enrich(['first_name' => 'Jane', 'domain' => 'example.com']); // Bulk enrich by email $matches = Apollo::people()->bulkEnrich(['jane@example.com', 'john@example.com']);
Organizations
$organizations = Apollo::organizations()->search([ 'locations' => 'United States,Canada', 'employee_ranges' => '1-10,11-50', 'keywords' => 'fintech', 'page' => 1, ]); $organization = Apollo::organizations()->enrich('example.com');
Error handling
Any non-2xx API response throws JeffersonGoncalves\Apollo\Exceptions\ApolloException, which exposes the decoded error body:
use JeffersonGoncalves\Apollo\Exceptions\ApolloException; try { Apollo::people()->enrich(['email' => 'unknown@example.com']); } catch (ApolloException $e) { logger()->error($e->getMessage(), $e->errorBody()); }
Missing required criteria (e.g. no email, linkedin, or first_name + domain on people()->enrich(); an empty domain on organizations()->enrich()) throw InvalidArgumentException before any HTTP call is made.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
