Loading...
Generate random addresses, phone numbers, and more programmatically. Integrate test data directly into your applications with our RESTful API.
Include your API key in the header of every request:
Authorization: Bearer YOUR_API_KEYYou can find your API key in your account dashboard after subscribing.
https://addressgenerator.org/api/v1const res = await fetch(
'https://addressgenerator.org/api/v1/address?country=US&count=10',
{ headers: { Authorization: 'Bearer YOUR_API_KEY' } }
);
const data = await res.json();import requests
res = requests.get(
"https://addressgenerator.org/api/v1/address",
params={"country": "US", "count": 10},
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
data = res.json()/api/v1/addressGenerate one or more random addresses for a given country and optional region.
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | Yes | ISO 3166-1 alpha-2 country code (e.g. US, GB, DE) |
region | string | No | State, province, or region code (e.g. CA, TX, ON) |
count | integer | No | Number of addresses to generate (1-100, default: 1) |
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://addressgenerator.org/api/v1/address?country=US®ion=CA&count=10"
{
"success": true,
"count": 10,
"country": "US",
"region": "CA",
"addresses": [
{
"street": "4521 Maple Drive",
"city": "San Francisco",
"state": "California",
"stateCode": "CA",
"zipCode": "94102",
"country": "United States",
"countryCode": "US",
"phone": "+1 (415) 555-0192",
"latitude": 37.7749,
"longitude": -122.4194
}
]
}/api/v1/countriesRetrieve a list of all countries supported by the address generator, including their available regions.
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://addressgenerator.org/api/v1/countries"
{
"success": true,
"count": 120,
"countries": [
{
"code": "US",
"name": "United States",
"regions": ["AL", "AK", "AZ", "AR", "CA", "..."]
},
{
"code": "GB",
"name": "United Kingdom",
"regions": ["ENG", "SCT", "WLS", "NIR"]
},
{
"code": "DE",
"name": "Germany",
"regions": ["BW", "BY", "BE", "BB", "..."]
}
]
}/api/v1/phoneGenerate random phone numbers in the correct format for a given country.
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | Yes | ISO 3166-1 alpha-2 country code (e.g. US, GB, JP) |
count | integer | No | Number of phone numbers to generate (1-100, default: 1) |
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://addressgenerator.org/api/v1/phone?country=US&count=5"
{
"success": true,
"count": 5,
"country": "US",
"phones": [
{ "number": "+1 (212) 555-0147", "formatted": "(212) 555-0147" },
{ "number": "+1 (310) 555-0283", "formatted": "(310) 555-0283" },
{ "number": "+1 (415) 555-0391", "formatted": "(415) 555-0391" },
{ "number": "+1 (512) 555-0064", "formatted": "(512) 555-0064" },
{ "number": "+1 (718) 555-0512", "formatted": "(718) 555-0512" }
]
}| Plan | API Access | Rate Limit |
|---|---|---|
| Free | No API access | — |
| Pro | Basic access | 500 requests / day |
| Pro Plus | Full access | 5,000 requests / day |
Need higher-volume API usage? Contact support so we can review the workflow and recommend the right setup.
X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. When a daily limit is exceeded, the API returns 429 with resetAt in the JSON body and a Retry-After header.Success:
{
"success": true,
"count": 10,
"country": "US",
"region": "CA",
"addresses": [{ "street": "...", "city": "...", "zipCode": "..." }]
}
Error:
{
"success": false,
"error": "Daily API rate limit exceeded",
"limit": 500,
"remaining": 0,
"resetAt": "2026-06-13T00:00:00.000Z"
}OPTIONS preflight requests and return permissive CORS headers for read-only GET usage. For production apps, keep API keys on your server whenever possible so keys are not exposed in public browser code.| Status | Meaning |
|---|---|
200 OK | Request succeeded |
400 Bad Request | Invalid or missing query parameters |
401 Unauthorized | Missing or invalid API key |
429 Too Many Requests | Daily rate limit exceeded; check resetAt or Retry-After |
500 Server Error | Something went wrong on our end |
Get your API key with a paid subscription and start generating test data programmatically in minutes.
Get API Access