Real-Time Proxy & VPN Detection Documentation
Overview
Detect VPNs, proxies and residential proxies live in the browser, at the moment a user acts. Your backend can fetch each result by its session_id. See what the service does and try it on the Real-Time Proxy & VPN Detection product page.
Setup
The script carries no API key. Requests are authorized by origin, so register your domain before your first call.
- Sign up for your IPGeolocation.io account.
- Add your origin as a Request Origin, for example
https://app.example.com. - Save.
Quick start
<script src="https://static.ipgeolocation.io/web-assets/static/security/session-analysis.js"></script>
<script>
Analysis
.startMonitoring()
.get()
.then(result => console.log(result))
.catch(error => console.error(error instanceof Error ? error.message : String(error)));
</script>Response for a clean connection:
{
"public_ip": "119.156.x.x",
"public_ip_country_code": "PK",
"live_vpn_proxy_detection": {
"is_anonymous": false,
"confidence_score": 100,
"proxy_score": 0,
"vpn_score": 0
},
"visitor_actual_location": {
"actual_ip": "119.156.x.x",
"actual_country_code": "PK",
"confidence_score": 100
},
"session_id": "e3a17c5b8f2d4a6b9c0e1f7d2b5a8c4e"
}In plain words: this connection is not anonymized, the service is certain about it, and the visitor is where the request says they are. The session_id identifies this check; your backend uses it to fetch the result from our API.
1. Optional objects
Pass an include string to startMonitoring() to attach extra data about the public IP. Separate several names with commas, or pass all for everything.
| Value | Adds |
|---|---|
security | ip_security |
location | ip_location |
asn | ip_asn |
company | ip_company |
all | All four objects |
const include = "security,location";
Analysis
.startMonitoring(include)
.get()
.then(result => console.log(result));A check costs 3 credits. Adding security costs 2 extra credits. Adding any combination of location, asn, and company costs 1 extra credit total. Including all four objects costs 6 credits. See Credits.
Response fields
1. The IP address the request comes from
Two top-level fields, describing the IP address the user appears to be on:
| Field | Type | Meaning |
|---|---|---|
public_ip | string | The IP address your server sees on the request. Behind a VPN or proxy this is the exit node's IP address, not the user's. |
public_ip_country_code | string | Two-letter ISO country code for that IP address. Behind a VPN or proxy, this is the exit node's country, not the user's. |
2. The live verdict: live_vpn_proxy_detection
Four fields, meant to be read together:
| Field | Type | Meaning |
|---|---|---|
is_anonymous | boolean | The headline answer. true means the connection is anonymized through a VPN or a proxy. It does not say which; the two scores below do. |
confidence_score | up to 100 | How much to trust that yes or no. 100 with is_anonymous: false means confidently clean; a low value is weak evidence either way. |
proxy_score | 0 to 100 | Looks like a proxy, including residential and rotating proxies. |
vpn_score | 0 to 100 | Looks like a VPN. |
3. Where the visitor really is: visitor_actual_location
Where the user actually is, recovered by the live tests:
| Field | Type | Meaning |
|---|---|---|
actual_ip | string | The visitor's real IP address behind the VPN or proxy. Falls back to public_ip when nothing is hidden, or when the real IP cannot be detected. |
actual_country_code | string | Two-letter ISO country code of the visitor's actual location. |
confidence_score | up to 100 | Certainty about that actual country. Gate on it before acting on a country mismatch. |
4. The check itself: session_id
Top-level fields that identify the check. The browser result carries session_id; when your backend fetches the session, the response adds origin and session_ts:
| Field | Type | Returned In | Meaning |
|---|---|---|---|
session_id | string | Browser and backend | Unique ID of the check. Use it to fetch the result from your backend. |
origin | string | Backend only | Origin of the page that ran the check, for example https://app.example.com. Confirm it matches your own domain. |
session_ts | number | Backend only | Time of the session, as Unix epoch time in milliseconds (UTC). |
5. Optional objects about the public IP
Each appears only when its name, or all, is in include. They describe the public IP, so behind a VPN or proxy they refer to the exit node, not the visitor.
| Object | Include Value | What It Tells You | Field Reference |
|---|---|---|---|
ip_security | security | What is already known about the IP: VPN, proxy, Tor, bot, and threat signals | IP Security API response reference |
ip_location | location | Where the IP is: country, state, city, coordinates | Location object reference |
ip_asn | asn | Who routes the IP: AS number, organization, type | ASN object reference |
ip_company | company | Who owns the IP: company name, type, domain | Company object reference |
Response with include: "all":
{
"public_ip": "94.237.x.x",
"public_ip_country_code": "DE",
"live_vpn_proxy_detection": {
"is_anonymous": true,
"confidence_score": 90,
"proxy_score": 90,
"vpn_score": 10
},
"visitor_actual_location": {
"actual_ip": "119.156.x.x",
"actual_country_code": "PK",
"confidence_score": 80
},
"ip_security": {
"threat_score": 50,
"is_tor": false,
"is_proxy": true,
"proxy_provider_names": [],
"proxy_confidence_score": 99,
"proxy_last_seen": "",
"is_residential_proxy": false,
"is_vpn": true,
"vpn_provider_names": ["Browsec VPN"],
"vpn_confidence_score": 99,
"vpn_last_seen": "2026-08-27",
"is_relay": false,
"relay_provider_name": "",
"is_anonymous": true,
"is_known_attacker": false,
"is_bot": false,
"bot_confidence_score": 0,
"bot_operator_name": "",
"bot_type": "",
"is_known_good_bot": false,
"bot_last_seen": "",
"is_spam": false,
"is_cloud_provider": true,
"cloud_provider_name": "UpCloud Ltd",
"is_corporate_gateway": false,
"corporate_gateway_type": "",
"corporate_gateway_provider_name": ""
},
"ip_location": {
"continent_code": "EU",
"continent_name": "Europe",
"country_code2": "DE",
"country_code3": "DEU",
"country_name": "Germany",
"country_name_official": "Federal Republic of Germany",
"country_capital": "Berlin",
"state_prov": "Hesse",
"state_code": "DE-HE",
"district": "Frankfurt",
"city": "Frankfurt",
"locality": "Frankfurt",
"accuracy_radius": "8.588",
"confidence": "medium",
"dma_code": "",
"zipcode": "60311",
"latitude": "50.11208",
"longitude": "8.68341",
"is_eu": true,
"country_flag": "https://ipgeolocation.io/static/flags/de_64.png",
"geoname_id": "6463469",
"country_emoji": "🇩🇪"
},
"ip_asn": {
"as_number": "AS202053",
"organization": "UpCloud Ltd",
"country": "FI",
"type": "BUSINESS",
"domain": "upcloud.com",
"date_allocated": "2014-04-24",
"rir": "RIPE"
},
"ip_company": {
"name": "UpCloud Cloud Servers",
"type": "HOSTING",
"domain": "upcloud.com"
},
"session_id": "4f1c2a7e9d0b4e3a8c6f5b2d1e7a9c30"
}Reading it in code:
const liveDetection = result.live_vpn_proxy_detection;
const actualLocation = result.visitor_actual_location;
const ipSecurity = result.ip_security;
liveDetection.confidence_score; // 90
actualLocation.actual_country_code; // "PK"
actualLocation.actual_country_code !== result.public_ip_country_code; // true: presenting DE, actually in PK
ipSecurity.vpn_provider_names; // ["Browsec VPN"]
ipSecurity.threat_score; // 50
result.ip_location.city; // "Frankfurt": the exit node, not the visitor
result.ip_asn.organization; // "UpCloud Ltd"
result.ip_company.type; // "HOSTING"
result.session_id; // "4f1c2a7e9d0b4e3a8c6f5b2d1e7a9c30": send this to your backendFetching results from your backend
Send the session_id from the browser result to your backend, then fetch the session from our API:
GET https://api.ipgeolocation.io/session?sessionId=SESSION_IDAuthenticate with apiKey=YOUR_API_KEY in the query string, or with an Origin header set to a domain registered as a Request Origin in your account.
1. With an API key
curl 'https://api.ipgeolocation.io/session?sessionId=SESSION_ID&apiKey=YOUR_API_KEY'2. With Request Origin
curl 'https://api.ipgeolocation.io/session?sessionId=SESSION_ID' \
--header 'Origin: https://app.example.com'3. Response
The response is the check's result plus origin and session_ts:
{
"public_ip": "203.0.x.x",
"public_ip_country_code": "PK",
"live_vpn_proxy_detection": {
"is_anonymous": false,
"confidence_score": 100,
"proxy_score": 0,
"vpn_score": 0
},
"visitor_actual_location": {
"actual_ip": "203.0.x.x",
"actual_country_code": "PK",
"confidence_score": 100
},
"session_id": "9b49ebc2393e4f7d900938d5496c0963",
"origin": "https://app.example.com",
"session_ts": 1793304897382
}Errors carry a message: 400 for a missing or malformed sessionId, 401 for an invalid API key, and 404 when the session has expired or belongs to another account.
Acting on the verdict
When is_anonymous is true, confidence_score decides how much friction the session deserves. Blocking everything the service flags costs real customers; ignoring the flag defeats the check. Work in bands, and tune the cutoffs against your own confirmed fraud outcomes:
| confidence_score | What It Means | Recommended Action |
|---|---|---|
| Below 30 | Very weak signal. Expect false positives. | Allow. Log the result, add nothing to the user's path. |
| 30 to 50 | Uncertain. Could be an unusual network, a mobile carrier, or a corporate gateway. | Allow and monitor. Feed it into your wider risk score; add friction only if another signal agrees. |
| 51 to 80 | Likely anonymized. Enough for friction, not for a hard denial alone. | Challenge. MFA, email or SMS verification, or a CAPTCHA. Hold payouts and first orders for review. |
| 81 and above | Confidently anonymized. | Block or restrict. High proxy_score: block or hold for review. High vpn_score: prefer a hard challenge, since many ordinary people browse through VPNs. |
These bands apply only when is_anonymous is true. High confidence with is_anonymous: false is a clean visitor, not a risky one.
Credits
| Include | Credits Per Call |
|---|---|
| Default | 3 |
security | +2 |
Any or all of location, asn, company | +1 |
all | 6 |
The three objects location, asn, and company share a single credit, whether you include one or all of them. For example, security alone costs 5, location, costs 4, and security, costs 6.
Fetching a session from your backend costs no extra credits. Credits are charged once, for the check itself.
FAQs
session_id; see Fetching results from your backend. For backend-only, mobile, or bulk checks with no browser involved, use the IP Security API, which returns only the reputation data through a key-authenticated API call.404.visitor_actual_location returns the actual_ip and actual_country_code recovered by the live tests, with its own confidence_score. Use that country for fraud and compliance rules, and gate on the confidence before acting on a mismatch.ip_security.is_vpn and is_proxy come from our IP intelligence database, updated daily: they tell you an IP address is known to be associated with VPN or proxy infrastructure. The live vpn_score and proxy_score come from inspecting the current connection, so they describe this session rather than the address's history.security simply attaches the database view next to the live one.confidence_score, so you can judge each result individually. A high value is strong evidence; a low value is weak evidence either way, so log those sessions rather than acting on them alone. Results also depend on your traffic, so treat the bands under "Acting on the verdict" as a starting point and tune the cutoffs against your own confirmed cases.100 with is_anonymous: false means confidently clean. Risk lives in proxy_score, vpn_score, and ip_security.threat_score.security included, and 1 more for any of location, asn, or company, so all costs 6. Fetching the result from your backend by session_id costs nothing extra. Credits come from your plan's normal credit pool. It is a paid plan feature; contact our support team for a free trial.Looking for features, modules, and use cases? Visit the Real-Time Proxy & VPN Detection page.
Explore Real-Time Proxy & VPN Detection