Proxy Detection Legacy Web Service
To learn more about the risk associated with a particular IP address, use the
minFraud Score service. This service provides the IP Risk Score, a
replacement for the proxyScore. To identify anonymous IP addresses in support
of geotargeting and ad serving environments, we recommend using the
GeoIP2 Anonymous IP database.
The proxy detection web service provides a score measuring the risk associated
with an IP address. It is called the IP risk score in our current minFraud
services.
Learn more about the IP risk score on our knowledge base.
Changes to the proxy detection web service are documented in our
release notes.
You may optionally include in your site
some JavaScript that helps us identify the device
your customer is using to determine whether it has been used in previous
fraudulent transactions. The device information passed to MaxMind via the Device
Tracking Add-on is factored into the proxyScore returned when you query the HTTP
API.
This web service uses the same hostnames as our minFraud web
service. Its URI is https://minfraud.maxmind.com/app/ipauth_http
The minfraud.maxmind.com
hostname automatically picks the data center
geographically closest to you.
The API is only available via HTTPS. If you attempt to access this service via
HTTP, you will receive a 403 Forbidden
HTTP response.
We require TLS 1.2 or greater for all requests to our servers to keep your data
secure.
The API requires you to pass a set of parameters as an HTTP GET or POST. Results
are returned in a simple text format documented below.
The three parameters that this service takes are the IP address to look up, the
shopID and
your MaxMind license key.
The shopID is your internal ID for the shop, affiliate, or merchant this order
is coming from, and is required for customers who are resellers, payment
providers, gateways and affiliate networks.
The parameters should be passed in a query string or as a form post
(application/x-www-form-urlencoded). The IP address parameter should be named
i
(lower case “I”), the shopID parameter should be named shopID
and the
license key should be named l
(lower case “L”).
The IP address should be passed as a string like “44.55.66.77”.
This service returns data as a set of comma-separated fields. The individual
fields are not escaped or quoted, but they will never contain a comma.
All strings are returned as ASCII.
Name | Type (length) | Description |
---|
proxyScore | decimal | A score from 0.00-4.00 indicating the likelihood that the user's IP address is
an anonymous proxy, open proxy, or VPN.proxyScore | Likelihood of fraud |
---|
0.5 | 15% | 1.0 | 30% | 2.0 | 60% | 3.0+ | 90% | A proxyScore of 0.00 will be returned for a corporate proxy or private IP and an empty
string will be returned for an invalid IP. |
err | enum | If there was an error or warning with this request, this field
contains an error code string. The possible error codes are: - `PERMISSION_REQUIRED` – You do not have permission to use the service. Please contact our support team for more information.
- `LICENSE_REQUIRED` – You must provide a license key.
- `INVALID_LICENSE_KEY` – The license key provided is invalid.
- `MAX_REQUESTS_REACHED` – This error will be returned
if your account is out of queries or if an invalid license key is
provided.
|
Below are some sample clients for this web service.
1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5
6use Encode qw( decode );
7use Getopt::Long;
8use LWP::UserAgent;
9use URI;
10use URI::QueryParam;
11
12my $license_key = 'YOUR_LICENSE_KEY';
13my $ip_address = '24.24.24.24';
14
15GetOptions(
16 'license:s' => \$license_key,
17 'ip:s' => \$ip_address,
18);
19
20my $uri = URI->new('https://minfraud.maxmind.com/app/ipauth_http');
21$uri->query_param( l => $license_key );
22$uri->query_param( i => $ip_address );
23
24my $ua = LWP::UserAgent->new( timeout => 5 );
25my $response = $ua->get($uri);
26
27die 'Request failed with status ' . $response->code()
28 unless $response->is_success();
29
30my %proxy = map { split /=/, $_ } split /;/, $response->content();
31
32if ( defined $proxy{err} && length $proxy{err} ) {
33 die "MaxMind returned an error code for the request: $proxy{err}\n";
34}
35else {
36 print "\nMaxMind Proxy data for $ip_address\n\n";
37 for my $field ( sort keys %proxy ) {
38 print sprintf( " %-20s %s\n", $field, $proxy{$field} );
39 }
40 print "\n";
41}
1#!/usr/bin/env python
2
3import argparse
4import requests
5import sys
6
7parser = argparse.ArgumentParser(description='MaxMind Proxy Detection web service client')
8parser.add_argument('--license', default='YOUR_LICENSE_KEY')
9parser.add_argument('--ip', default='24.24.24.24')
10
11args = parser.parse_args()
12
13payload = {'l': args.license, 'i': args.ip};
14response = requests.get('https://minfraud.maxmind.com/app/ipauth_http', params=payload)
15
16if response.status_code != requests.codes.ok:
17 sys.stderr.write("Request failed with status %s\n" % response.status_code)
18 sys.exit(1)
19
20proxy = dict( f.split('=') for f in response.text.split(';') )
21
22if 'err' in proxy and len(proxy['err']):
23 sys.stderr.write("MaxMind returned an error code for the request: %s\n" % proxy['err'])
24 sys.exit(1)
25else:
26 print "\nMaxMind Proxy data for %s\n\n" % args.ip
27 for (key, val) in proxy.items():
28 print " %-20s %s" % (key, val)
29 print "\n"
1#!/usr/bin/php
2
3<?php
4$license_key = 'LICENSE_KEY_HERE';
5$ipaddress = 'IP_ADDRESS_HERE';
6$query = "https://minfraud.maxmind.com/app/ipauth_http?l=" . $license_key
7 . "&i=" . $ipaddress;
8$score = file_get_contents($query);
9echo $score;
1Dim objHttp, strQuery
2strQuery = "https://minfraud.maxmind.com/app/ipauth_http?l=" & license_key & _
3 "&i=" & ipaddress
4set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
5objHttp.open "GET", strQuery, false
6objHttp.send
7Response.Write objHttp.ResponseText
8Set objHttp = Nothing