- About the IPQS APIs
- Proxy & VPN Detection API
- Email Verification API
- Phone Number Validation API
- Malicious URL Scanner API
- Device Fingerprint API
- Mobile Device Fingerprinting SDK
- Gaming Fraud Detection SDK
- Dark Web Leak API
- Malware File Scanner API
- Request List API
- Fraud Reporting API
- Account Management APIs
- Bulk Validation CSV
- Allowlist Blocklist APIs
- Plugins Platforms Integrations
- IP Reputation Database
- IP Address Abuse Feed
- Email Verification Database
-
Custom Integrations
- Getting Started
- Authentication
- Refresh Secret
- IP & Proxy Checks
- Email Verification Checks
- Phone Number Validity Checks
- Device Tracker
- List Device Trackers
- Device Tracker Statistics
- Login Tokens
- Overview Statistics
- Recent Proxy Statistics
- Recent Email Statistics
- Fraud Reporting
- Retrieve Requests by ID
- Country List API Documentation
- Release Notes
About the Login History API
The IPQS Login History API provides detailed insights into recent and historical login events and authentication attempts on your IPQS account, enabling you to track unauthorized access attempts, detect suspicious activity, and conduct thorough security audits. By integrating this solution, you gain improved visibility into account authentication patterns, enhance compliance with cybersecurity standards, and reduce the risk of account compromise through monitoring, analytics, and actionable data.
Note
The Login History API is not currently enabled for all customers. To opt-in to this API, reach out to our Support team.
API Request URLs
JSON
https://www.ipqualityscore.com/api/json/loginhistory/YOUR_API_KEY_HERE
XML
https://www.ipqualityscore.com/api/xml/loginhistory/YOUR_API_KEY_HERE
Example Response
This is an example success response in JSON format. Responses are also available in XML format.
{'message': 'Success', 'success': True, 'login_logs': [
{'ID': '31656582', 'UserID': '123456', 'IP': '192.0.2.55', 'Hostname': 'syn-096-041-136-092.res.spectrum.com', 'Browser': 'Mozilla/5.0', 'FraudScore': '7.00', 'CountryCode': 'US', 'OrgISP': 'Spectrum', 'LoginSuccess': True, 'Validated': True, 'Deleted': False, 'Genesis': {'date': '2024-07-11 10: 35: 25.000000', 'timezone_type': 3, 'timezone': 'America/New_York'
}
},
{'ID': '36206472', 'UserID': '123456', 'IP': '192.0.2.55', 'Hostname': 'syn-047-224-131-099.res.spectrum.com', 'Browser': 'Mozilla/5.0', 'FraudScore': '7.00', 'CountryCode': 'US', 'OrgISP': 'Spectrum', 'LoginSuccess': True, 'Validated': True, 'Deleted': False, 'Genesis': {'date': '2024-07-11 10: 35: 25.000000', 'timezone_type': 3, 'timezone': 'America/New_York'
}
},
{'ID': '42275562', 'UserID': '123456', 'IP': '192.0.2.55', 'Hostname': 'syn-047-224-131-099.res.spectrum.com', 'Browser': 'Mozilla/5.0', 'FraudScore': '7.00', 'CountryCode': 'US', 'OrgISP': 'Spectrum', 'LoginSuccess': True, 'Validated': True, 'Deleted': False, 'Genesis': {'date': '2024-07-11 10: 35: 25.000000', 'timezone_type': 3, 'timezone': 'America/New_York'
}
}
], 'total_logins': 3, 'request_id': 'T2SKxvCdvB'
}
<?php
// Replace this with your API Key
$api_key = "YOUR_API_KEY_HERE";
// Construct the API endpoint
$url = "https://www.ipqualityscore.com/api/json/loginhistory/" . $api_key . "/";
// Suppress errors with @ and attempt to get the content
$response = @file_get_contents($url);
if ($response === false) {
echo "Request failed: Unable to fetch the URL.\n";
exit;
}
// Decode the JSON response
$data = json_decode($response, true);
// Check for any JSON parsing errors
if (json_last_error() !== JSON_ERROR_NONE) {
echo "Failed to parse JSON response.\n";
exit;
}
// Print the results
echo "Response JSON:\n";
print_r($data);
import requests
# Replace this with your API Key
api_key = "YOUR_API_KEY_HERE"
# Construct the API endpoint
url = f"https://www.ipqualityscore.com/api/json/loginhistory/{api_key}/"
try:
# Send a GET request with only the api_key in the URL
response = requests.get(url, timeout=10)
response.raise_for_status() ## Raise an error if the response was not successful
data = response.json()
# Print the results
print("Response JSON:")
print(data)
except requests.exceptions.RequestException as e:
print("Request failed:", e)