Integrations

Add IP-FD.net to your site or server in a few minutes. Every integration calls the API with your key, answers from a cache for five minutes, and lets visitors through if IP-FD.net cannot be reached.

You need an API key and, to decide by your own rules, the switches on your Access rules page. Or decide by the risk score (0 to 100) instead.

WordPress

The plugin IP-FD Guard checks logins, registrations and comments before they are accepted.

  1. Download ip-fd-guard.php and put it in wp-content/plugins/ip-fd-guard/.
  2. Activate it under Plugins, then open Settings, IP-FD Guard and enter your API key.
  3. Behind Cloudflare or another proxy, choose where the visitor address comes from.

Cloudflare Worker

Answers 403 for blocked addresses before they reach your site. Verdicts are cached at Cloudflare for five minutes.

  1. Create a Worker and paste worker.js.
  2. Add the secret IPFD_API_KEY. Optional variables: IPFD_MODE (block or monitor) and IPFD_SKIP (paths that are never checked).
  3. Attach the Worker to a route, for example example.com/login*.

nginx

Uses auth_request with GET /api/v1/check/{address}?status=1, which answers HTTP 200 (allow) or 403 (block).

Copy the snippet from ip-fd.conf, add your key, and put auth_request /_ipfd; into the locations you want to protect.

Node.js

One file, Node.js 18 or newer, no dependencies: ipfd.js.

const { IpFd } = require('./ipfd');
const ipfd = new IpFd({ apiKey: process.env.IPFD_API_KEY });

app.use(ipfd.middleware());                       // 403 for addresses your rules block
// or decide by risk:
app.use(ipfd.middleware({ mode: 'risk', maxRisk: 70 }));

const risk = await ipfd.risk('203.0.113.7');      // { score, level, signals }

Python

Standard library only, Python 3.8 or newer: ipfd.py.

from ipfd import IpFd
ipfd = IpFd(api_key="your key")

if ipfd.is_blocked(request_ip):                   # your access rules
    abort(403)
if ipfd.is_blocked(request_ip, max_risk=70):      # or by risk score
    abort(403)

PHP

One class, PHP 7.4 or newer, no dependencies: IpFd.php.

require 'IpFd.php';
$ipfd = new IpFd(getenv('IPFD_API_KEY'));

if ($ipfd->isBlocked($_SERVER['REMOTE_ADDR'])) {   // or isBlocked($ip, 70) for a risk score from 70
    http_response_code(403);
    exit;
}

Everything else

Any language works with two calls: GET /api/v1/check/{address} (allow or block by your rules) and GET /api/v1/ip/{address}/risk (score and level). Send your key in the X-API-Key header. To hear about changes, watch addresses and AS numbers and poll GET /api/v1/account/changes or use a webhook channel. See the API documentation.