address()

Faker.address()

Generate one or more fake addresses for a given country (synchronous).

Parameters:
  • country_code – ISO 3166-1 alpha-2 country code (case-insensitive), e.g. "us", "GB", "fr".

  • amount – Number of addresses to generate. Defaults to 1. Capped at the number of records available for the country.

  • fields – If given, only these keys are kept in each returned address dictionary.

  • locale – If given, prefixes the person_name field with "<locale>_".

Returns:

A single address dict when amount=1, otherwise a list of address dicts. Every dict carries api_owner, api_updates and country_flag metadata.

Raises:

ValueError – If country_code is empty, unknown, or has no bundled records.

Example:

addr = faker.address("us")
five = faker.address("fr", amount=5, fields=["city", "zip"])