#Location

#address

// usage {{address()}} {{address({short_suffix: true})}}

Generate a random street address

{{address()}}; => '5447 Bazpe Lane'

Optionally mandate that it return a short suffix

{{address({short_suffix: true})}}; => '536 Baner Rd'

#altitude

// usage {{altitude()}} {{altitude({ fixed: 7 })}} {{altitude({ max: 1000 })}}

Generate a random altitude, in meters.

{{altitude()}} => 1863.21417

By default, includes 5 digits of accuracy after the decimal. Can override with the fixed option.

{{altitude({ fixed: 7 })}} => 6897.8978386

By default, max of 8848m (height of Mount Everest), but this can be overridden with the max option.

{{altitude({ max: 1000 })}} => 890.20665

#areacode

// usage {{areacode()}}

Generate a random area code

{{areacode()}} => '(526)'

Note, this is a US area code, we have little support for internationalization at this time. Hope to fix that in the future!


#city

// usage {{city()}}

Generate a random city name

{{city()}}; => 'Cowotba'

#coordinates

// usage {{coordinates()}} {{coordinates({fixed: 2})}} {{coordinates({format: 'dms'})}}

Generate random coordinates, which are latitude and longitude, comma separated.

{{coordinates()}}; => "-29.52974, 24.52815"

By default includes 5 fixed digits after decimal, can specify otherwise.

{{coordinates({fixed: 2})}}; => "-49.16, 68.81"

By default cooridnates' format is dd, can specify otherwise.

{{coordinates({format: 'ddm'})}}; => "41°44.9592, 25°56.2622"
{{coordinates({format: 'dms'})}}; => "56°2’9.8187”, 79°55’40.6812”"

#country

// usage {{country()}} {{country({ full: true })}}

Return a random country.

{{country()}}; => 'LT'

By default, returns only the 2 letter ISO 3166-1 code for the country.

Optionally specify that it ought to return a full country name.

{{country({ full: true })}}; => 'Venezuela'

#depth

// usage {{depth()}} {{depth({ fixed: 2 })}} {{depth({ min: -1000 })}}

Generate a random depth, in meters. Depths are always negative

{{depth()}} => -2126.95039

By default, includes 5 digits of accuracy after the decimal. Can override with the fixed option.

{{depth({ fixed: 2 })}} => -1542.11

By default, maximum (or minimum depending on your frame of reference) depth of -2550 (depth of the Mariana Trench), but this can be overridden with the min option.

{{depth({ min: -1000 })}} => -718.41976

#geohash

// usage {{geohash()}} {{geohash({ length: 5 })}}

Generate a random geohash. More details on what a geohash is.

{{geohash()}} => 'h9xhn7y'

By default, includes 7 characters of accuracy. Can override with the length option.

{{geohash({ length: 5 })}} => 'dr0kr'

#latitude

// usage {{latitude()}} {{latitude({fixed: 7})}} {{latitude({format: 'dms'})}}

Generate a random latitude.

{{latitude()}}; => 57.99514

range: -90 to 90

By default includes 5 fixed digits after decimal, can specify otherwise.

{{latitude({fixed: 7})}}; => -29.6443133

By default includes entire range of allowed latitudes, can specify a min and/or max to bound it

{{latitude({min: 38.7, max: 38.9})}}; => 38.82358

By default latitudes' format is dd, can specify otherwise.

{{latitude({format: 'ddm'})}}; => "41°44.9592"
{{latitude({format: 'dms'})}}; => "56°2’9.8187”"

#locale

// usage {{locale()}} {{locale({region: true})}}

Generate a random ISO-639-1 language code

{{locale()}}; => 'ca'

Generate a random IETF region code

{{locale({region: true})}}; => 'es-EA'

Note, the language codes comes from the ISO-639-1 spec and the region codes come from IETF standard


#longitude

// usage {{longitude()}} {{longitude({fixed: 7})}} {{longitude({format: 'dms'})}}

Generate a random longitude.

{{longitude()}}; => 149.41549

range: -180 to 180

By default includes 5 fixed digits after decimal, can specify otherwise.

{{longitude({fixed: 7})}}; => 51.4549925

By default includes entire range of allowed longitudes, can specify a min and/or max to bound it

{{longitude({min: -78, max: -77})}}; => -77.22644

By default longitude' format is dd, can specify otherwise.

{{longitude({format: 'ddm'})}}; => "41°44.9592"
{{longitude({format: 'dms'})}}; => "56°2’9.8187”"

#phone

// usage {{phone()}} {{phone({ formatted: false })}} {{phone({ country: "fr" })}} {{phone({ country: "fr", mobile: true })}}

Generate a random phone

{{phone()}}; => '(494) 927-2152'

By default conforms to NANP for a proper US phone number.

Optionally disable formatting.

{{phone({ formatted: false })}}; => '2617613391'

Optionally specify a country.

{{phone({ country: 'fr' })}}; => '01 60 44 92 67'

Note, at current we only have support for 'us', 'uk', or 'fr' for countries.

For uk and fr, optionally specify a mobile phone.

{{phone({ country: 'uk', mobile: true })}}; => '07624 321221'

For us, optionally specify an exampleNumber for a '555' area code.

{{phone({ country: 'us', exampleNumber: true })}}; => '(555) 927-2152'

#postal

// usage {{postal()}}

Return a Canadian Postal code. Returned postal code is valid with respect to the Postal District (first character) and format only.

{{postal()}}; => 'R1S 3F4'

#postcode

// usage {{postcode()}}

Generate a random (U.K.) postcode. Returned postcode is valid with respect to the Postcode Area (first characters) and format only.

{{postcode()}}; => 'W6 9PF'

#province

// usage {{province()}} {{province({full: true})}} {{province({full: true})}}

Return a random province.

{{province()}}; => 'ON'

By default, returns only the 2 letter abbreviation for province.

Optionally specify that it ought to return a full province name.

{{province({full: true})}}; => 'Nova Scotia'

Optionally specify the country from which it should return the province name.

{{province({country: 'it', full: true})}}; => 'Vicenza'

Note, currently support for country is limited to: 'ca', 'it'.


#state

// usage {{state()}} {{state({ full: true })}} {{state({ territories: true })}} {{state({ armed_forces: true })}} {{state({ us_states_and_dc: false })}} {{state({ country: 'us' })}}

Return a random state.

{{state()}}; => 'AK'

By default, returns only the 2 letter abbreviation for state.

Optionally specify that it ought to return a full state name.

{{state({ full: true })}}; => 'Florida'

Optionally add U.S. Territories ('American Samoa', 'Federated States of Micronesia', 'Guam', 'Marshall Islands', 'Northern Mariana Islands', 'Puerto Rico', 'Virgin Islands, U.S.') to the mix of randomly selected items:

{{state({ territories: true, full: true })}} => 'Guam'

Optionally add Armed Forces to the list as well:

{{state({ armed_forces: true, full: true })}} => 'Armed Forces Pacific'

For all U.S. states, territories, and armed forces, specify all of them:

{{state({ armed_forces: true, territories: true })}} => 'NY'

For just territories or armed forces, specify that it ought not return U.S. states:

{{state({ territories: true, us_states_and_dc: false })}} => 'PR'

Optionally specify a country (US specific options are ignored if country is specified and different from 'us'):

{{state({ country: 'it', full: true })}} => 'Toscana'

#street

// usage {{street()}} {{street({country:it})}}

Generate a random street

{{street()}}; => 'Tesca Circle'

Optionally mandate that it returns a short suffix

{{street({short_suffix: true})}}; => 'Jiled St'

Optionally specify the number of syllables used to generate the street name

{{street({syllables: 8})}}; => 'Teniefitinusewjircor Junction'

Optionally specify a country to localize street prefixes

{{street({country: 'it'})}}; => 'Via Nefba'

Note, currently support for country is limited to: 'us', 'it'.


#zip

// usage {{zip()}} {{zip({plusfour: true})}}

Generate a random (U.S.) zip code.

{{zip()}}; => '90210'

Can optionally specify that it ought to return a Zip+4:

{{zip({plusfour: true})}}; => '01035-1838'