Everything you need to integrate IM18+ age verification into your website. Simple APIs, comprehensive documentation, and ready-to-use code examples.
Add IM18+ to your site in under 5 minutes with this simple iframe integration:
<iframe id="age-check"
src="https://verify.im18.app/api/check-anonymous.php"
style="display:none;"></iframe>
window.addEventListener('message', function(event) {
if (event.origin === 'https://verify.im18.app') {
if (event.data.verified === true) {
// Show adult content
showContent();
} else {
// Show verification prompt
showVerificationPrompt();
}
}
});
GET /api/check-anonymous.php
Cross-domain age verification check via iframe. Returns verification status through postMessage.
{ "verified": true, "source": "im18plus", "timestamp": 1704067200, "expires": 1706659200 }
GET /api/ip.php?ip=x.x.x.x
Country detection with our best-in-class detection system for compliance and analytics.
{ "success": true, "ip": "8.8.8.8", "country_code": "US", "country_name": "United States", "continent": "North America", "is_eu": false, "method": "best_in_class_detection" }
// Complete IM18+ integration
class IM18Verification {
constructor() {
this.iframe = this.createIframe();
this.setupMessageListener();
}
createIframe() {
const iframe = document.createElement('iframe');
iframe.src = 'https://verify.im18.app/api/check-anonymous.php';
iframe.style.display = 'none';
document.body.appendChild(iframe);
return iframe;
}
setupMessageListener() {
window.addEventListener('message', (event) => {
if (event.origin === 'https://verify.im18.app') {
this.handleVerificationResult(event.data);
}
});
}
handleVerificationResult(data) {
if (data.verified === true) {
this.showContent();
} else {
this.showVerificationPrompt();
}
}
showContent() {
document.getElementById('adult-content').style.display = 'block';
document.getElementById('age-gate').style.display = 'none';
}
showVerificationPrompt() {
document.getElementById('age-gate').style.display = 'block';
document.getElementById('adult-content').style.display = 'none';
}
}
// Initialize verification
new IM18Verification();
<?php
// IM18+ PHP Integration
class IM18Verification {
public static function isVerified() {
return isset($_COOKIE['age_verified']) &&
$_COOKIE['age_verified'] === 'true';
}
public static function requireVerification() {
if (!self::isVerified()) {
self::showVerificationForm();
exit;
}
}
public static function showVerificationForm() {
echo '<div id="age-gate">';
echo '<iframe src="https://verify.im18.app/api/check-anonymous.php" style="display:none;"></iframe>';
echo '<script>
window.addEventListener("message", function(event) {
if (event.origin === "https://verify.im18.app") {
if (event.data.verified === true) {
location.reload();
} else {
window.open("https://verify.im18.app/verify.php", "_blank");
}
}
});
</script>';
echo '</div>';
}
}
// Usage in your content pages
IM18Verification::requireVerification();
// Your adult content here
?>
// WordPress functions.php integration
function im18_age_verification() {
?>
<script>
// Check for age verification on page load
document.addEventListener('DOMContentLoaded', function() {
const iframe = document.createElement('iframe');
iframe.src = 'https://verify.im18.app/api/check-anonymous.php';
iframe.style.display = 'none';
document.body.appendChild(iframe);
window.addEventListener('message', function(event) {
if (event.origin === 'https://verify.im18.app') {
if (event.data.verified !== true) {
// Show verification overlay
document.body.innerHTML = `
<div style="position:fixed;top:0;left:0;width:100%;height:100%;
background:rgba(0,0,0,0.9);z-index:999999;
display:flex;align-items:center;justify-content:center;">
<div style="background:white;padding:2rem;border-radius:8px;text-align:center;">
<h2>Age Verification Required</h2>
<p>You must be 18+ to access this content</p>
<button onclick="window.open('https://verify.im18.app/verify.php', '_blank')">
Verify My Age
</button>
</div>
</div>`;
}
}
});
});
</script>
<?php
}
add_action('wp_footer', 'im18_age_verification');
import { useEffect, useState } from 'react';
export default function AgeVerification({ children }) {
const [isVerified, setIsVerified] = useState(null);
useEffect(() => {
// Create verification iframe
const iframe = document.createElement('iframe');
iframe.src = 'https://verify.im18.app/api/check-anonymous.php';
iframe.style.display = 'none';
document.body.appendChild(iframe);
// Listen for verification result
const handleMessage = (event) => {
if (event.origin === 'https://verify.im18.app') {
setIsVerified(event.data.verified === true);
}
};
window.addEventListener('message', handleMessage);
return () => {
window.removeEventListener('message', handleMessage);
document.body.removeChild(iframe);
};
}, []);
if (isVerified === null) {
return <div>Checking age verification...</div>;
}
if (!isVerified) {
return (
<div className="age-gate">
<h2>Age Verification Required</h2>
<button onClick={() => {
window.open('https://verify.im18.app/verify.php', '_blank');
}}>
Verify My Age
</button>
</div>
);
}
return children;
}
Test your current verification status:
Test IP geolocation with any IP address: