PHPackages                             opportify/opportify-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. opportify/opportify-sdk-php

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

opportify/opportify-sdk-php
===========================

Opportify Insights PHP SDK

v0.7.0(6mo ago)02.1k↓50%[1 PRs](https://github.com/opportify/opportify-sdk-php/pulls)MITPHPPHP &gt;=8.1.0CI passing

Since Dec 20Pushed 2mo agoCompare

[ Source](https://github.com/opportify/opportify-sdk-php)[ Packagist](https://packagist.org/packages/opportify/opportify-sdk-php)[ RSS](/packages/opportify-opportify-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (22)Used By (0)

[![Tests](https://camo.githubusercontent.com/bca543439d9be896d8e165fd6636a8f180a1943d5ecf138f7abccc4001010d20/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f70706f72746966792f6f70706f72746966792d73646b2d7068702f706870756e69742e796d6c3f6c6162656c3d7465737473267374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d313135653563)](https://github.com/opportify/opportify-sdk-php/actions/workflows/phpunit.yml)[![Packagist Downloads](https://camo.githubusercontent.com/329a17858f0435aeff7483d97923dd7f95dee9ed21b26ddd119cf71e2fb947f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70706f72746966792f6f70706f72746966792d73646b2d7068703f7374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d313135653563)](https://packagist.org/packages/opportify/opportify-sdk-php)[![Packagist Version](https://camo.githubusercontent.com/9d12090d9300ae8175cef1525641e7dfc0a4b1bd145156b4bd08fae52e256a0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70706f72746966792f6f70706f72746966792d73646b2d7068703f7374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d313135653563)](https://packagist.org/packages/opportify/opportify-sdk-php)[![License](https://camo.githubusercontent.com/efadaaf8d578f1fc39ac3d9dcbb3447f95d4c14f3b7559ca3d026589471eba57/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f70706f72746966792f6f70706f72746966792d73646b2d7068703f636f6c6f723d396366267374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d313135653563)](https://github.com/opportify/opportify-sdk-php/blob/main/LICENSE)

Opportify-SDK-PHP
=================

[](#opportify-sdk-php)

Table of Contents
-----------------

[](#table-of-contents)

- [Overview](#overview)
- [Requirements](#requirements)
- [Getting Started](#getting-started)
    - [Calling Email Insights](#calling-email-insights)
    - [Calling IP Insights](#calling-ip-insights)
- [Batch Analysis (Email &amp; IP)](#batch-analysis-email--ip)
    - [Batch Email Analysis (JSON)](#1-batch-email-analysis-json)
    - [Batch Email Analysis (Plain Text)](#2-batch-email-analysis-plain-text)
    - [Batch Email Analysis (File Upload)](#3-batch-email-analysis-file-upload)
    - [Batch IP Analysis (JSON)](#4-batch-ip-analysis-json)
    - [Batch IP Analysis (Plain Text)](#5-batch-ip-analysis-plain-text)
    - [Batch IP Analysis (File Upload)](#6-batch-ip-analysis-file-upload)
- [Batch Export Jobs](#batch-export-jobs)
    - [Email Batch Exports](#email-batch-exports)
    - [IP Batch Exports](#ip-batch-exports)
- [Enabling Debug Mode](#enabling-debug-mode)
- [Handling Error](#handling-error)
- [About this package](#about-this-package)

Overview
--------

[](#overview)

The **Opportify Insights API** provides access to a powerful and up-to-date platform. With advanced data warehousing and AI-driven capabilities, this API is designed to empower your business to make informed, data-driven decisions and effectively assess potential risks.

[Sign Up Free](https://www.opportify.ai)

### Base URL

[](#base-url)

Use the following base URL for all API requests:

```
https://api.opportify.ai/insights/v1//

```

Requirements
------------

[](#requirements)

Requires PHP [v8.1 or later](https://www.php.net/releases).

Getting Started
---------------

[](#getting-started)

First, install Opportify via the Composer package manager:

```
composer require opportify/opportify-sdk-php
```

### Calling Email Insights

[](#calling-email-insights)

```
use Opportify\Sdk\EmailInsights;

$emailInsights = new EmailInsights("YOUR-API-KEY-HERE");

$params = [
    "email" => "test@gmial.com", // *gmial* - just an example to be auto-corrected
    "enableAi" => true,
    "enableAutoCorrection" => true,
    "enableDomainEnrichment" => true // Optional: include domain enrichment block
];

$result = $emailInsights->analyze($params);
```

### Calling IP Insights

[](#calling-ip-insights)

```
use Opportify\Sdk\IpInsights;

$ipInsights = new IpInsights("");

$params = [
    "ip" => "3.1.122.82",
    "enableAi" => true
];

$result = $ipInsights->analyze($params);
```

### Batch Analysis (Email &amp; IP)

[](#batch-analysis-email--ip)

You can submit multiple emails or IPs in a single request. Batch jobs are processed asynchronously; the response returns a job identifier (`jobId`) you can poll for status.

#### 1. Batch Email Analysis (JSON)

[](#1-batch-email-analysis-json)

```
use Opportify\Sdk\EmailInsights;

$emailInsights = new EmailInsights("");

$params = [
    'emails' => [
        'one@example.com',
        'two@example.org'
    ],
    'name' => 'Customer Email Validation', // Optional: descriptive name for the job
    'enableAi' => true,
    'enableAutoCorrection' => true
];

// Default content type is application/json
$batch = $emailInsights->batchAnalyze($params);

// Optional: poll status later
$status = $emailInsights->getBatchStatus($batch->jobId);
```

#### 2. Batch Email Analysis (Plain Text)

[](#2-batch-email-analysis-plain-text)

Provide one email per line and set the content type to `text/plain`.

```
$content = "one@example.com\nTwo.User@example.org"; // newline-delimited emails
$batch = $emailInsights->batchAnalyze(['text' => $content], 'text/plain');
$status = $emailInsights->getBatchStatus($batch->jobId);
```

#### 3. Batch Email Analysis (File Upload)

[](#3-batch-email-analysis-file-upload)

Supply a `.csv` (one email per row; header optional) via `batchAnalyzeFile()`. A `.csv` triggers `multipart/form-data`; other extensions fall back to `text/plain` (newline-delimited body).

```
$batch = $emailInsights->batchAnalyzeFile(__DIR__.'/emails.csv', [
    'name' => 'Monthly Email Cleanup', // Optional: descriptive name for the job
    'enableAi' => true,
    'enableAutoCorrection' => true
]);
$status = $emailInsights->getBatchStatus($batch->jobId);
```

#### 4. Batch IP Analysis (JSON)

[](#4-batch-ip-analysis-json)

```
use Opportify\Sdk\IpInsights;

$ipInsights = new IpInsights("");

$params = [
    'ips' => [
        '1.1.1.1',
        '8.8.8.8'
    ],
    'name' => 'Network Security Scan', // Optional: descriptive name for the job
    'enableAi' => true
];

$batch = $ipInsights->batchAnalyze($params); // application/json
$status = $ipInsights->getBatchStatus($batch->jobId);
```

#### 5. Batch IP Analysis (Plain Text)

[](#5-batch-ip-analysis-plain-text)

```
$content = "1.1.1.1\n8.8.8.8"; // newline-delimited IPs
$batch = $ipInsights->batchAnalyze(['text' => $content], 'text/plain');
$status = $ipInsights->getBatchStatus($batch->jobId);
```

#### 6. Batch IP Analysis (File Upload)

[](#6-batch-ip-analysis-file-upload)

```
$batch = $ipInsights->batchAnalyzeFile(__DIR__.'/ips.csv', [
    'name' => 'Firewall IP Assessment', // Optional: descriptive name for the job
    'enableAi' => true
]);
$status = $ipInsights->getBatchStatus($batch->jobId);
```

#### Convenience &amp; Notes

[](#convenience--notes)

- `batchAnalyzeFile()` auto-selects content type: `.csv` -&gt; `multipart/form-data`; otherwise `text/plain`.
- For `text/plain`, pass newline-delimited values via the `text` key.
- For `multipart/form-data`, pass a readable file path via the `file` key (handled internally by `batchAnalyzeFile()`).
- The `name` parameter is optional for all batch operations and helps with job identification and tracking.
- `enableAutoCorrection` applies only to Email Insights.
- Always wrap calls in a try-catch (see Error Handling) to capture API errors.
- Polling cadence depends on payload size; a short delay (1–3s) between status checks is recommended.

Batch Export Jobs
-----------------

[](#batch-export-jobs)

Use batch exports to materialize filtered results from completed jobs. Exports run asynchronously and expose polling helpers similar to batch status checks.

### Email Batch Exports

[](#email-batch-exports)

```
$emailInsights = new EmailInsights('');

// Trigger a new export for a completed batch job
$export = $emailInsights->createBatchExport('job-uuid-here', [
    'exportType' => 'csv',
    'columns' => [
        'emailAddress',
        'emailProvider',
        'riskReport.score',
        'isDeliverable'
    ],
    'filters' => [
        'isDeliverable' => 'true',
        'riskReport.score' => ['min' => 400]
    ]
]);

// Poll until the export is ready
$status = $emailInsights->getBatchExportStatus('job-uuid-here', $export->exportId);

if ($status->status === 'COMPLETED') {
    // Use $status->downloadUrl for the pre-signed file link
}
```

### IP Batch Exports

[](#ip-batch-exports)

```
$ipInsights = new IpInsights('');

$export = $ipInsights->createBatchExport('job-uuid-here', [
    'exportType' => 'json',
    'columns' => [
        'result.ipAddress',
        'result.connectionType',
        'result.riskReport.score'
    ],
    'filters' => [
        'result.riskReport.level' => ['low', 'medium']
    ]
]);

$status = $ipInsights->getBatchExportStatus('job-uuid-here', $export->exportId);

if ($status->status === 'COMPLETED') {
    // Use $status->downloadUrl to retrieve the generated export
} elseif ($status->status === 'FAILED') {
    // Review $status->errorCode and $status->errorMessage for remediation guidance
}
```

### Enabling Debug Mode

[](#enabling-debug-mode)

```
$clientInsights->setDebugMode(true);
```

### Handling Error

[](#handling-error)

We strongly recommend that any usage of this SDK happens within a try-catch to properly handle any exceptions or errors.

```
use OpenAPI\Client\ApiException;

try {

    // Email or IP Insights usage...

} catch (ApiException $e) {
    throw new \Exception($e->getResponseBody());
}
```

Below are the `ApiException` functions available:

FunctionTypeValue Sample`$e->getMessage();`string`"[403] Client error: POST https://api.opportify.ai/insights/v1/... resulted in a 403 Forbidden"``$e->getResponseBody();`string`"{"errorMessage":"Your plan does not support AI features, please upgrade your plan or set enableAI as false.","errorCode":"INVALID_PLAN"}"``$e->getCode();`integer`403`About this package
------------------

[](#about-this-package)

This PHP package is a customization of the base generated by:

- [OpenAPI Generator](https://openapi-generator.tech) project.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance78

Regular maintenance activity

Popularity22

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Recently: every ~10 days

Total

19

Last Release

189d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.4

v0.2.2PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3472b0f4175ee7bcc269b8634bd9b79d4b7a401a4afa13f53de71711569e231d?d=identicon)[opportify](/maintainers/opportify)

---

Top Contributors

[![opportify-bb](https://avatars.githubusercontent.com/u/191276444?v=4)](https://github.com/opportify-bb "opportify-bb (33 commits)")

---

Tags

phpapiclientvalidationsdkemailInsightsIPverificationopportify

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/opportify-opportify-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/opportify-opportify-sdk-php/health.svg)](https://phpackages.com/packages/opportify-opportify-sdk-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[mailjet/mailjet-apiv3-php

PHP wrapper for the Mailjet API

27411.4M77](/packages/mailjet-mailjet-apiv3-php)[resend/resend-php

Resend PHP library.

574.7M21](/packages/resend-resend-php)[hafael/azure-mailer-driver

Supercharge your Laravel or Symfony app with Microsoft Azure Communication Services (ACS)! Effortlessly add email, chat, voice, video, and telephony-over-IP for next-level communication. 🚀

14109.2k](/packages/hafael-azure-mailer-driver)[kickbox/kickbox

Official kickbox API library client for PHP

591.0M4](/packages/kickbox-kickbox)[verifalia/sdk

Verifalia provides a simple HTTPS-based API for validating email addresses and checking whether they are deliverable or not. This library allows to easily integrate with Verifalia and verify email addresses in real-time.

4349.8k](/packages/verifalia-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
