1. Go to this page and download the library: Download opportify/opportify-sdk-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
opportify / opportify-sdk-php example snippets
use Opportify\Sdk\EmailInsights;
$emailInsights = new EmailInsights("YOUR-API-KEY-HERE");
$params = [
"email" => "[email protected]", // *gmial* - just an example to be auto-corrected
"enableAi" => true,
"enableAutoCorrection" => true,
"enableDomainEnrichment" => true // Optional:
use Opportify\Sdk\IpInsights;
$ipInsights = new IpInsights("<YOUR-KEY-HERE>");
$params = [
"ip" => "3.1.122.82",
"enableAi" => true
];
$result = $ipInsights->analyze($params);
use Opportify\Sdk\FraudProtection;
$fraudProtection = new FraudProtection("<YOUR-KEY-HERE>");
$params = [
// Identity
"email" => "[email protected]",
"firstName" => "Jane",
"lastName" => "Doe",
"username" => "jane_doe",
"companyName" => "Acme Corp",
// Network
"userIp" => "3.1.122.82",
// Contact details
"phone1" => "+1-800-555-0100",
"website" => "https://acme.example.com",
// Submission context
"subject" => "Contact form submission",
"message" => "Hello, I am interested in your service.",
"submissionType" => "contact", // e.g. "contact", "signup", "checkout"
"origin" => "yoursite.com", // hostname only — no protocol, path, or port
// Address (all optional)
"address1" => "123 Main St",
"city" => "Springfield",
"region" => "IL",
"country" => "US",
"postalCode" => "62701",
// Token & form tracking (optional)
"opportifyToken" => "opportify-generated-token",
"opportifyFormUUID" => "uuid-of-the-form",
// Raw form fields as key-value pairs (optional)
"formData" => ["custom_field" => "value"],
];
$result = $fraudProtection->analyze($params);
// $result->score — integer 200–1000 (higher = riskier)
// $result->level — "lowest" | "low" | "medium" | "high" | "highest"
// $result->factors — string[] of detected risk signals
// $result->sources — per-signal breakdown (email, IP, geo, session, velocity)
use Opportify\Sdk\EmailInsights;
$emailInsights = new EmailInsights("<YOUR-KEY-HERE>");
$params = [
'emails' => [
'[email protected]',
'[email protected]'
],
'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);