Version 1.0.0
The Fake Address Generator API allows developers to programmatically generate fake addresses and related data for testing purposes. This documentation provides information on how to use our API endpoints, request formats, and response structures.
https://api.fakeaddressgenerator.com/v1
All API requests require an API key. You can obtain an API key by registering for a developer account.
Include your API key in the request header:
X-API-Key: your_api_key_here
Free tier accounts are limited to 100 requests per day. Premium accounts have higher limits based on the subscription plan.
Check the status of the API.
Request:
GET /api.php?endpoint=status
Response:
{ "status": "active", "version": "1.0.0", "timestamp": 1672531200 }
Generate a fake address.
Request:
{ "endpoint": "generate", "country": "US", "include_phone": true, "include_email": true }
Response:
{ "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "name": "John Smith", "street": "123 Main St", "city": "Anytown", "state": "CA", "zip": "90210", "country": "US", "phone": "+1 555-123-4567", "email": "john.smith@example.com" }
Generate multiple fake addresses in a single request.
Request:
{ "endpoint": "generate/bulk", "count": 5, "country": "UK", "include_phone": true, "include_email": false }
Response:
{ "addresses": [ { "id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890", "name": "Emma Wilson", "street": "45 Park Lane", "city": "London", "state": "", "zip": "SW1A 1AA", "country": "UK", "phone": "+44 20 1234 5678" }, // Additional addresses... ], "count": 5 }
The API uses standard HTTP status codes to indicate the success or failure of a request.
Error responses will include a JSON object with an error message:
{ "error": "Invalid country code", "code": "INVALID_PARAMETER" }
fetch('https://api.fakeaddressgenerator.com/v1/generate', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'your_api_key_here' }, body: JSON.stringify({ endpoint: 'generate', country: 'US', include_phone: true, include_email: true }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
$url = 'https://api.fakeaddressgenerator.com/v1/generate'; $data = array( 'endpoint' => 'generate', 'country' => 'US', 'include_phone' => true, 'include_email' => true ); $options = array( 'http' => array( 'header' => "Content-type: application/json\r\nX-API-Key: your_api_key_here\r\n", 'method' => 'POST', 'content' => json_encode($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { /* Handle error */ } var_dump(json_decode($result));
If you encounter any issues or have questions about the API, please contact our support team at api-support@fakeaddressgenerator.com or visit our Help Center.