jeka-bit/hunterio

Laravel 对 Hunter.io API 的封装,用于发现电子邮件地址

3.0.0 2023-03-14 14:43 UTC

This package is not auto-updated.

Last update: 2024-09-25 20:32:39 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

使用此包,您可以轻松查询 Hunter.io API。

以下是一些提供的示例方法

use Hunter;

// Retrieve email addresses at a given domain
Hunter::domainSearch('ghost.org')

// Retrieve email addresses of people with a marketing title from ghost.org
Hunter::domainSearch()->domain('ghost.org')->department('marketing')->get();

// Find an email address belonging to John Doe working at Ghost
Hunter::emailFinder()->company('Ghost')->name('John Doe')->get();

安装

需要 Laravel 8+ 和 PHP 7.4+

对于 Laravel 7 使用 messerli90/hunter@1.1.0

您可以通过 composer 安装此包

composer require jeka-bit/hunterio

您需要从 Hunter.io 获取一个 API 密钥

可选地,您可以使用此命令发布此包的配置文件

php artisan vendor:publish --provider="Messerli90\Hunterio\HunterServiceProvider"

或者,手动将其添加到您的 config/services.php 文件中

[
    ...
    'hunter' => [
        'key' => env('HUNTER_API_KEY')
    ]
]

用法

阅读 Hunter.io API 文档 了解如何处理每个端点的响应。

域名搜索

搜索与一个网站对应的全部电子邮件地址。

// Shortcut to search by domain
Hunter::domainSearch('ghost.org')

// Specify searching by company name or domain
Hunter::domainSearch()->company('Ghost')->get();
Hunter::domainSearch()->domain('ghost.org')->get();

// Narrow your search by chaining attributes
$query = Hunter::domainSearch()->company('Ghost')->domain('ghost.org')
    ->seniority(['senior', 'executive'])->department('marketing')
    ->limit(5)->skip(5)->type('personal')
    ->get();

电子邮件查找器

此 API 端点根据域名、名和姓生成或检索最可能的电子邮件地址。

// Shortcut assumes searching by domain
Hunter::emailFinder('ghost.org')->name('John', 'Doe')->get();

// Search by first and last name
Hunter::emailFinder()->domain('ghost.org')->name('John', 'Doe')->get();

// or use a single string to search by 'full name'
Hunter::emailFinder()->company('Ghost')->name('John Doe')->get();

电子邮件计数

此 API 端点允许您知道我们为一个域名或一家公司拥有多少个电子邮件地址。这是免费的,不需要认证。

此端点是公开的,不需要 API 密钥

// Passing argument assumes searching by domain
Hunter::emailCount('ghost.org');

// Or specify domain or company name
Hunter::emailCount()->company('Ghost')->get();

// Narrow search to only 'personal' addresses
Hunter::emailCount()->domain('ghost.org')->type('personal')->get();

电子邮件验证器

此 API 端点允许您验证电子邮件地址的投递性。

Hunter::verifyEmail('steli@close.io');

账户

此 API 端点允许您在任何时候获取有关您 Hunter 账户的信息。

Hunter::account();

测试

./vendor/bin/phpunit

路线图

  • 域名搜索
  • 电子邮件查找器
  • 电子邮件验证器
  • 电子邮件计数
  • 账户信息
  • 潜在客户
  • 潜在客户列表

变更日志

请参阅 CHANGELOG 了解最近更改的更多信息。

贡献

请参阅 CONTRIBUTING 了解详情。

安全

如果您发现任何与安全相关的问题,请通过 @michaelmesserli 在推特上联系我,而不是使用问题跟踪器。

鸣谢

许可证

MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。