Migrate from IPinfo
Move from IPinfo to VPNDetection: change the request, map each IPinfo field to its VPNDetection field, and compare the answers before you switch.
This guide moves an integration from IPinfo's privacy detection to VPNDetection. It shows how the request changes, which VPNDetection field answers each of IPinfo's, how rules that read them change, and how to compare the two services on your own traffic before you switch.
Before you begin
- A VPNDetection API key, if you need more than the free plan's fields. Without a key, a lookup answers the free plan's fields:
is_vpn,is_tor,is_relay, and the address's country and network. See Plans and fields. - A sample of a few hundred addresses from your own traffic, one per line in
sample.txt, for the comparison in step 4.
1. Change the request
IPinfo's lookup API takes your token in the token query parameter, a bearer header or Basic auth:
curl "https://api.ipinfo.io/lookup/8.8.8.8?token=$IPINFO_TOKEN"VPNDetection takes the address as the path and your key in the Authorization header:
curl -H "Authorization: Bearer $VPNDETECTION_API_KEY" https://api.vpndetection.io/8.8.8.8If your code can't set a header, send the key in the apikey query parameter instead; see Authentication. To make the request from your code with an official library, see Use an SDK.
2. Map the fields
IPinfo answers is_anonymous and is_hosting at the top level, and the detail in its anonymous object, which Core doesn't include. VPNDetection answers one top-level flag for each kind of address, with a detail object beside it. Fields after Paid plan: come with a paid plan; the rest come with every plan, the free plan included.
| IPinfo | VPNDetection | Notes |
|---|---|---|
is_anonymous | is_vpn, is_tor, is_relay; Paid plan: is_resproxy | One flag for each kind, instead of one combined flag. |
anonymous.is_vpn, anonymous.name | is_vpn; Paid plan: vpn.provider | vpn.provider is a stable ID; vpn.provider_name carries the display name. |
anonymous.is_res_proxy, anonymous.last_seen, anonymous.percent_days_seen | Paid plan: is_resproxy, resproxy.last_seen, resproxy.hits_days_pct | resproxy.hits_days_pct is the share of days seen over 90 days, where percent_days_seen covers 7. |
anonymous.is_proxy | Paid plan: is_dcproxy, is_mobproxy, is_pubproxy | One flag for each kind. |
anonymous.is_tor | is_tor | |
anonymous.is_relay | is_relay, relay.provider | relay.provider names the relay operator. |
is_hosting | Paid plan: is_hosting, hosting.provider | hosting.provider names the hosting company. |
The IP lookup reference documents every VPNDetection field.
3. Update your rules
Most rules move field for field. Three things change how a rule reads:
is_anonymouscombines VPNs, proxies, Tor and relays. Read the kinds you act on instead, and leave privacy relays out of most rules: iCloud Private Relay carries many ordinary Apple users. See Handle privacy relays.resproxy.hits_days_pctcovers 90 days, so a threshold you tuned on IPinfo's 7-daypercent_days_seenneeds tuning again.- A field your plan doesn't include is absent rather than
false, so a rule checks that a paid field is present before it acts on the value. See Plans and fields.
The equivalent of is_anonymous, without relays, is:
const r = await client.lookup(ip);
const anonymous = r.isVpn || r.isTor || r.isResproxy === true || r.isDcproxy === true
|| r.isMobproxy === true || r.isPubproxy === true;4. Compare the answers
Before you switch, run both services on your sample and review the addresses where they disagree. This script prints each address where IPinfo's VPN flag and VPNDetection's differ. Save it as compare.mjs beside sample.txt, install the library with npm install vpndetection, and run node compare.mjs:
import { readFileSync } from 'node:fs';
import { VPNDetection } from 'vpndetection';
const client = new VPNDetection({ apiKey: process.env.VPNDETECTION_API_KEY });
const ips = readFileSync('sample.txt', 'utf8').split('\n').filter(Boolean);
for (const ip of ips) {
const res = await fetch(`https://api.ipinfo.io/lookup/${ip}?token=${process.env.IPINFO_TOKEN}`);
const theirs = await res.json();
const ours = await client.lookup(ip);
const theirFlag = theirs.anonymous?.is_vpn === true;
const ourFlag = ours.isVpn;
if (theirFlag !== ourFlag) {
console.log(ip, 'IPinfo:', theirFlag, 'VPNDetection:', ourFlag);
}
}On Core, which answers no anonymous object, compare theirs.is_anonymous with the combined flag from step 3 instead.
Every provider builds its own data, so some disagreement is expected. Look up a few of the addresses on both sides. If you believe VPNDetection's answer is wrong, send us the address.
5. Switch over
Once the comparison looks right, switch in stages, so you can stop at any point without affecting your users:
- Run both side by side. Keep deciding with IPinfo, and log VPNDetection's answer beside it for a few days of real traffic.
- Switch the decisions. Decide with VPNDetection, and keep logging IPinfo's answer while you watch for surprises.
- Remove IPinfo. Once your logs are clean, delete the old client from your code and revoke its key.
Next steps
When the answers suit your rules, switch your code to VPNDetection. Protect a web app applies rules in middleware, and the guides cover sign-ups, logins, payments and country rules. Before you launch, review the go-live checklist.