Country Generator
Generates country-related data including names, codes, capitals, and currencies.
Basic Usage
{
"country": {"gen": "country"}
}
Output: Returns an object with all country fields.
Available Fields
| Field | Description | Example |
|---|---|---|
name | Country name | United States |
countryCode | 2-letter country code | US |
capital | Capital city | Washington D.C. |
currency | Currency name | US Dollar |
currencyCode | Currency code | USD |
Options
This generator has no options.
Examples
Country Name
{
"country": {"gen": "country.name"}
}
Country Code
{
"code": {"gen": "country.countryCode"}
}
Capital City
{
"capital": {"gen": "country.capital"}
}
Currency
{
"currency": {"gen": "country.currency"},
"currencyCode": {"gen": "country.currencyCode"}
}
Common Patterns
International Addresses
{
"addresses": {
"count": 100,
"item": {
"id": {"gen": "uuid"},
"street": {"gen": "address.streetAddress"},
"city": {"gen": "address.city"},
"country": {"gen": "country.name"},
"countryCode": {"gen": "country.countryCode"}
}
}
}
Currency Exchange
{
"rates": {
"count": 50,
"item": {
"id": {"gen": "uuid"},
"fromCurrency": {"gen": "country.currencyCode"},
"toCurrency": {"gen": "country.currencyCode"},
"rate": {"gen": "float", "min": 0.1, "max": 10.0, "decimals": 4}
}
}
}
Travel Destinations
{
"destinations": {
"count": 30,
"item": {
"id": {"gen": "uuid"},
"country": {"gen": "country.name"},
"capital": {"gen": "country.capital"},
"description": {"gen": "lorem.paragraph"}
}
}
}
Next Steps
- Address Generator - For addresses
- Company Generator - For company data