All Integrations

PHP integration

Block disposable emails in PHP

You're running a PHP app and fake signups keep getting through. Add one request to your registration code and Fidro checks the email and IP before the account exists.

How it works

Send the user's email and IP to Fidro with Guzzle, or any PHP HTTP client. Fidro checks the address, the network and what it has already seen from them, then answers allow, challenge or block in a single JSON response. No SDK needed.

One fake signup can look perfectly normal. Five from the same IP in an hour don't. Send event and user_id with each call and Fidro remembers, so it catches the pattern as well as the person. You get a score from 0 to 100 and one answer: allow, challenge or block.

1. Install what you need

composer require guzzlehttp/guzzle

You'll also need an API key. Sign up free and you'll have one in a minute, no card needed.

2. Check every signup

Send the email and IP to POST /api/validate. Fidro checks for disposable domains, missing mail servers, VPNs, proxies and Tor, and answers allow, challenge or block. Let the allows straight in, ask the challenges to confirm their email, and turn the blocks away.

<?php

require_once 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

$client = new Client(['timeout' => 5]);

try {
    $response = $client->post('https://fidro.io/api/validate', [
        'headers' => ['Authorization' => 'Bearer ' . getenv('FIDRO_API_KEY')],
        'json' => [
            'email' => 'test@example.com',
            'ip'    => '8.8.8.8',
            'event' => 'signup',
        ],
    ]);

    $result = json_decode($response->getBody(), true);

    echo 'Risk score: ' . $result['risk_score'] . PHP_EOL;          // 0 to 100
    echo 'Recommendation: ' . $result['recommendation'] . PHP_EOL;  // allow, challenge or block

    if ($result['recommendation'] === 'block') {
        // Refuse the signup
    }
} catch (RequestException $e) {
    echo 'Error: ' . $e->getMessage() . PHP_EOL;
}

3. Look up an IP

Just want to know where a request came from? GET /api/ip/{ip} returns the country, city, ISP and network, without scoring. The VPN, proxy and Tor flags come from /api/validate, under data.checks.

<?php

require_once 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

$client = new Client(['timeout' => 5]);

try {
    $response = $client->get('https://fidro.io/api/ip/8.8.8.8', [
        'headers' => ['Authorization' => 'Bearer ' . getenv('FIDRO_API_KEY')],
    ]);

    $result = json_decode($response->getBody(), true);

    echo 'Country: ' . $result['location']['country_name'] . PHP_EOL;
    echo 'ISP: ' . $result['location']['isp'] . PHP_EOL;
} catch (RequestException $e) {
    echo 'Error: ' . $e->getMessage() . PHP_EOL;
}

Want to see real results first? Try any address in the free IP checker.

Next steps

The API reference has every field. The free checker shows you real results. And if you're weighing up alternatives, the comparisons are honest about where others fit.

Frequently Asked Questions

How do I add fraud detection to PHP?
Send a POST request to https://fidro.io/api/validate with the user's email and IP. Fidro returns a risk score from 0 to 100 and one recommendation: allow, challenge or block. With Guzzle or cURL it takes a few minutes.
Does Fidro have a PHP SDK?
You don't need one. Fidro is a plain REST API, so Guzzle, cURL or any other PHP HTTP client is all it takes: send JSON, decode JSON.
Is Fidro free to use with PHP?
Yes. The free plan covers 200 validations a month with no credit card, and it works with any PHP app, whether you use Laravel, Symfony, WordPress or plain PHP.
What should I do when Fidro says challenge?
Ask for something a real person will happily do and a script won't: confirm the email address, solve a CAPTCHA, or wait for a quick manual review. Save outright blocks for the clear cases.

Start catching bad signups in the next 5 minutes

Create your account, grab your API key, and send your first request. Free plan with 200 validations/month. No credit card. Cancel anytime.