POST /ip/check) classifies an IP address by network type (hosting, residential, mobile, VPN, TOR, proxy, unknown) and returns signals, network, and geo data. Below are common use cases.
Block or limit datacenter traffic
Use case: Restrict access from datacenter/hosting IPs (e.g. scrapers, bots, bulk signups).- When: On login, signup, or sensitive actions; or at the edge for high-traffic endpoints.
- Flow: Call the API with the client IP; if
signals.is_hostingis true (orclassification === "hosting"), block, rate-limit, or require a challenge. - Benefit: Fewer bots and automated abuse while allowing real users.
Example
Get the client IP from your request (e.g.
X-Forwarded-For or connection IP). Call client.ip.check(ip). If result.signals.isHosting (or result.classification === "hosting"), return 403 or show a CAPTCHA.VPN and proxy detection
Use case: Detect VPN or proxy usage for risk scoring or policy (e.g. block VPN for certain services or regions).- When: On login, checkout, or account changes.
- Flow: Check the IP; use
signals.is_vpn,signals.is_proxy, orclassificationto flag or block. - Benefit: Better fraud and abuse detection; enforce “no VPN” policies when needed.
TOR exit node detection
Use case: Block or flag traffic from TOR exit nodes when it is not allowed.- When: On sensitive or high-risk actions.
- Flow: If
signals.is_toris true, block or require extra verification. - Benefit: Reduce anonymous abuse and comply with policies that restrict TOR.
Prioritize residential users
Use case: Give better treatment (e.g. higher limits, fewer challenges) to residential traffic.- When: When applying rate limits, CAPTCHAs, or eligibility rules.
- Flow: If
signals.is_residentialis true, apply a more permissive policy. - Benefit: Better UX for real users while still protecting against bots and abuse.
Mobile vs fixed network
Use case: Use mobile vs non-mobile classification for analytics, routing, or product features.- When: On each request or when logging analytics.
- Flow: Use
signals.is_mobileandclassificationto tag or route traffic. - Benefit: Better insights and mobile-specific logic.
Enrichment (provider and geo)
Use case: Usenetwork (ASN, org, provider) and geo (country, region) for logging, analytics, or support.
- When: On signup, login, or critical events.
- Flow: Store or log
result.network.provider,result.geo.country, etc., alongside the request. - Benefit: Richer context for debugging, analytics, and fraud review.
Implementation tips
- Respect client IP: Use the real client IP (e.g. from
X-Forwarded-Foror your proxy), not your server’s IP. - Use helpers: SDKs provide
is_hosting(ip),is_vpn(ip),is_tor(ip),is_residential(ip),is_mobile(ip)for boolean checks. - Combine with other signals: Use IP classification together with rate limits, device fingerprinting, and behavior for stronger protection.