Public API FraudHunt
FraudHunt Public API is used to receive information about your users in real time. Using an API allows you to choose an appropriate line of action for each and every user of your system as they enter your website. All you need to do is set up your server or a web page to call the API and get the response.
Public API Flow
To enable access to our Public API send an email to info@fraudhunt.net from your registered email address.Script integration
The script is to be integrated into the head tag of your page.
<script async
src="https://dlqe6njq49pwj.cloudfront.net/fp/Scripts/ffp-aws.js" data-cid="yourcid">
</script>
Global callback integration
The callback function fpiCb: grabs the key once it is generated by the script. The function is activated the moment a key appears in the script.
< script>
var fhcnt = 0;
function send() {
fhcnt++;
var fpk = window.fppixel && fppixel.fpk;
if (fpk) {
handleFpKey(fpk);
} else {
__fpiGlobalVariables = {
__fpiCb: handleFpKey
}
if (fhcnt <= 20) {
setTimeout(send, 700);
}
}
return fpk;
}
send();
</script>
FPkey handle function
The handle function writes the FPkey in upper case and creates the API call. It can also be used to save the key on your server, etc.
< script>
function handleFpKey(fpKey) {
urlArgs = '?fpkey=' + fpKey;
var xhr = new XMLHttpRequest();
xhr.open("GET", apiHost + 'GET/' + fpKey.toUpperCase() + '?type=json&token=yourcid', true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status < 400 && xhr.responseText) {
var actual_JSON = JSON.parse(xhr.responseText);
var score = actual_JSON ? actual_JSON.fraudScore : 0;
// Insert your code here (Once the API response is received you have to specify how to process it further)
}
};
xhr.send();
}
</script>
API call and response
The completed API call has the following format: http://api.fraudhunt.net/GET/BBBW507B2B6F83A88E5EC4BD0B9F37F7?type=json&token=yourcid The API returns data in the json format:
{
"fingerprintKey": "BBBW507B2B6F83A88E5EC4BD0B9F37F7",
"httpInfo": {
"refererUrl": "http:\/\/clientdemo.fraudhunt.net\/ok.html",
"originUrl": "http:\/\/clientdemo.fraudhunt.net",
"publicIp": " 88.190.229.170"
},
"location": {
"city": "Paris",
"country": "France",
"region": "Ile-de-France'"
},
"fraudScore": 7
}
API response options
Depending on your exact case you may wish to receive specific API responses, at the moment we offer 4 types of API responses in addition to our standard one.Standard API response
{
"fingerprintKey": "BCCWNED2A557D2B157261D5867752B13"
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
"language": "en-US"
"doNotTrack": false
"cookies": true
"timeZone": 2
"ipList":
0: "192.168.109.110"
"plugins":
0: "Chrome PDF Plugin"
1: "Chrome PDF Viewer"
2: "Native Client"
3: "Widevine Content Decryption Module"
"deviceInfo":
"browser": "Chrome"
"browserVersion": "63.0.3239.132"
"OS": "Windows 10"
"deviceModel": ""
"screenInfo":
"screen": "1920x1080"
"client": "1097x557"
"customerInfo": {}
"httpInfo":
"refererUrl": "http://clientdemo.fraudhunt.net/demo.html?clickid=5"
"originUrl": "http://clientdemo.fraudhunt.net"
"publicIp": "207.244.77.175"
"location":
city: "Manassas"
country: "United States"
region: "Virginia"
"fraudScore": 72
}
Type One - Score Only
{
"fingerprintKey": "BBBW507B2B6F83A88E5EC4BD0B9F37F7",
"fraudScore": 7
}
Type Two - Fake User Agent
{
"fingerprintKey": "BBBW507B2B6F83A88E5EC4BD0B9F37F7",
"BadUA": true
"fraudScore": 72
}
Type Three - All fields
Type 3 provides a list of all fields in our database, including true or false on all triggers (the same system full Custom API uses)
{
"fingerprintKey": "BBBW507B2B6F83A88E5EC4BD0B9F37F7"
"httpInfo":
"refererUrl":
"originUrl":
"publicIp":
"location":
"user Agent":
"language":
"timezone":
"cookies":
"plugins":
"browser":
"broswerVersion":
"OS":
"deviceModel":
"screenInfo":
"triggers": true or false on chosen triggers
"fraudScore": 30
}
Type Four - Chosen triggers
Type four API returns true or false on chosen triggers only
{
"fingerprintKey": "BBBW507B2B6F83A88E5EC4BD0B9F37F7"
"AdBlock": false
"Anonymous": false
"Do not track": false
"Emulation": true
"Bad user agent": true
"Different language": false
"Old browser": true
"Proxy": false
"Different timezone": false
"Bot": true
"fraudScore": 100
}
Type Five - Networks format
Type Five format is best suited for Ad networks and other companies that require split second decisions as well as additional reporting features on each individual visit
{
"fingerprintKey": "C7TA2AD85A3EGGEE8924549A3C38A80B6"
"httpInfo":
"refererUrl":
"originUrl":
"publicIp":
"location":
"city":
"country":
"region":
"userAgent":
"Timestamp":
"Triggers":
"AdBlock": false
"Anonymous": false
"DoNotTrack": false
"Emulation": true
"BadUA": false
"DifferentLanguage": false
"OldBrowser": true
"Proxy": false
"Tor": false
"DiffTimezone": false
"Bot": false
"fraudScore": 95
}
URL Parameters
You have two options when dealing with your visitor URL parameters, you can either parse them on the page with the initial tracking script and save them together with the FPkey or you can simply add them to the API response. Every API type described above can include up to 5 URL parameters. To add them to the API you need to contact us and state what parameters to pass (utms, click id's or any other specific parameter)
{
"URLparameters":
"utm_source": 2462346
"publisherID": id4254626
"myUniqueParameter": 245234
}