API Documentation
Complete reference for the Fraud Check API
Contents
Getting Started
Welcome to the Fraud Check API! This powerful API helps you validate and verify various types of data including emails, domains, IP addresses, and phone numbers.
Quick Start
- Get your API key from the API Keys page
- Make your first request to the
/api/query
endpoint - Review the response and integrate into your application
Base URL
Authentication
Authentication is required for all API endpoints. Include your API key in the request header:
curl -X POST "https://api.fraudcheck.com/api/query" \ -H "Content-Type: application/json" \ -H "X-API-Key: your-api-key-here" \ -d '{"type": "email", "value": "test@example.com"}'
Security Note
Never expose your API key in client-side code. Always make requests from your server.
API Reference
/api/query
Perform fraud checks on various data types including emails, domains, IPs, and phone numbers.
Request Body
{ "type": "email", "value": "test@example.com", "options": { "detailed": true } }
Response
{ "success": true, "data": { "type": "email", "value": "test@example.com", "valid": true, "risk_score": 0.2, "checks": { "domain_valid": true, "mx_record": true, "disposable": false, "blacklisted": false } }, "metadata": { "request_id": "req_123456", "timestamp": "2023-12-01T10:00:00Z" } }
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
type | string | Required | The type of data to check (email, domain, ip, phone) |
value | string | Required | The value to check |
options | object | Optional | Additional options for the check |
metadata | object | Optional | Custom metadata to include in the response |
/api/stats
Get usage statistics for your API key.
Request
curl -X GET "https://api.fraudcheck.com/api/stats" \ -H "X-API-Key: your-api-key-here"
Response
{ "success": true, "data": { "total_requests": 1250, "successful_requests": 1200, "failed_requests": 50, "rate_limit": { "limit": 1000, "remaining": 850, "reset": 1701432000 } } }
Supported Data Types
Email Address
Validate and check email addresses for fraud indicators
user@example.com
Domain Name
Check domain reputation and validity
example.com
IP Address
Analyze IP addresses for suspicious activity
192.168.1.1
Phone Number
Validate phone numbers and detect fraud patterns
+1234567890
Code Examples
Basic Email Check
const FraudCheck = require('fraudcheck-js'); const client = new FraudCheck('your-api-key'); async function checkEmail(email) { try { const result = await client.query({ type: 'email', value: email }); console.log('Result:', result); return result; } catch (error) { console.error('Error:', error); } } checkEmail('test@example.com');
Batch Processing
const emails = ['user1@example.com', 'user2@example.com']; const results = await Promise.all( emails.map(email => client.query({ type: 'email', value: email }) ) ); console.log('Batch results:', results);
Error Handling
The API uses standard HTTP status codes to indicate success or failure of requests.
Bad Request
The request was invalid or missing required parameters.
{ "error": "Bad Request", "message": "Missing required field: type", "code": "MISSING_FIELD" }
Unauthorized
Authentication failed or API key is invalid.
{ "error": "Unauthorized", "message": "Invalid API key", "code": "INVALID_API_KEY" }
Rate Limit Exceeded
Too many requests were made within the allowed time frame.
{ "error": "Rate Limit Exceeded", "message": "Too many requests, please try again later", "code": "RATE_LIMIT_EXCEEDED", "retryAfter": 3600 }
Internal Server Error
An unexpected error occurred on the server.
{ "error": "Internal Server Error", "message": "An unexpected error occurred", "code": "INTERNAL_ERROR" }
Rate Limits
API requests are subject to rate limits to ensure fair usage and system stability.
Rate Limit Headers
X-RateLimit-Limit
: Requests per hourX-RateLimit-Remaining
: Remaining requestsX-RateLimit-Reset
: Reset time (Unix timestamp)Rate Limit Exceeded
429
status code. Implement exponential backoff in your retry logic. SDKs & Libraries
JavaScript/Node.js
Official JavaScript SDK
npm install fraudcheck-js
Python
Official Python SDK
pip install fraudcheck-python
PHP
Official PHP SDK
composer require fraudcheck/php-sdk
Go
Official Go SDK
go get github.com/fraudcheck/go-sdk
Ruby
Official Ruby SDK
gem install fraudcheck-ruby
Java
Official Java SDK
implementation "com.fraudcheck:java-sdk:1.0"