Apicat Docs
  1. Dynamic values Modules
Apicat Docs
  • What is Apicat?
  • Send requests
    • Create requests
      • Request basics
      • Parameters and body
      • Request headers
      • Request settings
      • Dynamic values
      • HTTP/2
      • SOAP/WebService
    • Authentication and authorization
      • Overview
      • CA and client certificates
      • Authorization types supported by Apidog
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
    • Response and cookies
      • Overview
      • API response in Apidog
      • Create and send cookies
      • Debug requests
    • Dynamic values Modules
      • Airline
      • Animal
      • Color
      • Commerce
      • Company
      • Database
      • Datatype
      • Date
      • Finance
      • Food
      • Git
      • Hacker
      • Helpers
      • Image
      • Internet
      • Location
      • Lorem
      • Music
      • Number
      • Person
      • Phone
      • Science
      • String
      • System
      • Vehicle
      • Word
  • Environments & variables
    • Overview
    • Using variables
    • Environments & services
  • Pre/Post processors
    • Overview
    • Assertion
    • Extract variable
    • Wait
    • Database operations
      • Overview
      • MySQL
      • MongoDB
      • Redis
      • Oracle Client
    • Using scripts
      • Overview
      • Pre processor scripts
      • Post processor scripts
      • Public scripts
      • Postman scripts reference
      • Calling other programming languages
      • Using JS libraries
      • Visualizing responses
      • Script examples
        • Assertion scripts
        • Using variables in scripts
        • Using scripts to modify request messages
        • Other examples
  • Best practices
    • How to handle API signatures
    • How to access OAuth 2.0 protected APIs
    • Apidog collaboration workflow
    • Managing authentication state in Apidog
  • Account & preferences
    • Account settings
    • Generate OpenAPI access token
    • Language settings
    • Hot keys
    • Network proxy configuration
    • Data backup
    • Updating Apidog
    • Deleting account
    • Experimental Features
  • References
    • API-Design First Approach
    • Apidog OpenAPI/Swagger Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Install Java Environment
    • Runner deployment environment
    • Apidog flavored Markdown
  1. Dynamic values Modules

Location

Module to generate addresses and locations.
Overview
For a typical street address for a locale, use {{$location.streetAddress}}, {{$location.city}}, {{$location.state}}, and {{$location.zipCode}}. Most locales provide localized versions for a specific country.
If you need latitude and longitude coordinates, use {{$location.latitude}} and {{$location.longitude}}, or {{$location.nearbyGPSCoordinateLatitude}} for a latitude/longitude near a given location.
For a random country, you can use {{$location.country}} or {{$location.countryCode}}.

buildingNumber#

Generates a random building number.
Returns: string
Examples

cardinalDirection#

Returns a random cardinal direction.
Parameters
NameTypeDefaultDescription
abbreviatedbooleanfalseIf true this will return abbreviated directions (N, E, etc). Otherwise this will return the long name.
Returns: string
Examples

city#

Generates a random localized city name.
Returns: string
Examples

country#

Returns a random country name.
Returns: string
Examples

countryCode#

Returns a random country name.
Parameters
NameTypeDefaultDescription
variant'alpha-2' |'alpha-3' | 'numeric''alpha-2'The code to return. Can be either 'alpha-2' (two-letter code), 'alpha-3' (three-letter code) or 'numeric' (numeric code).
Returns: string
Examples

direction#

Returns a random direction .
Parameters
NameTypeDefaultDescription
abbreviatedbooleanfalseIf true this will return abbreviated directions (NW, E, etc). Otherwise this will return the long name.
Returns: string
Examples

latitude#

Generates a random latitude.
Parameters
NameTypeDefaultDescription
maxnumber90The upper bound for the latitude to generate.
minnumber-90The lower bound for the latitude to generate.
precisionnumber4The number of decimal points of precision for the latitude.
Returns: number
Examples

longitude#

Generates a random longitude.
Parameters
NameTypeDefaultDescription
maxnumber90The upper bound for the longitude to generate.
minnumber-90The lower bound for the longitude to generate.
precisionnumber4The number of decimal points of precision for the longitude.
Returns: number
Examples

nearbyGPSCoordinate#

Generates a random GPS coordinate within the specified radius from the given coordinate.
The original faker.location.nearbyGPSCoordinate() method has been refined into two more precise variables:
{{$location.nearbyGPSCoordinateLatitude}}: Generates an Latitude within the specified radius from the given coordinate.
{{$location.nearbyGPSCoordinateLongitude}}: Generates an Longitude within the specified radius from the given coordinate.
Parameters
NameTypeDefaultDescription
isMetricbooleanfalseIf true assume the radius to be in kilometers. If false for miles.
latitudenumberThe original latitude to get a new coordinate close to.
longitudenumberThe original longitude to get a new coordinate close to.
radiusnumber10The maximum distance from the given coordinate to the new coordinate.
Returns: [latitude: number, longitude: number]
Examples

ordinalDirection#

Returns a random ordinal direction (northwest, southeast, etc).
Parameters
NameTypeDefaultDescription
abbreviatedbooleanfalseIf true this will return abbreviated directions (NW, SE, etc). Otherwise this will return the long name.
Returns: string
Examples

secondaryAddress#

Generates a random localized secondary address. This refers to a specific location at a given address such as an apartment or room number.
Returns: string
Examples

state#

Returns a random localized state, or other equivalent first-level administrative entity for the locale's country such as a province or region. Generally, these are the ISO 3166-2 subdivisions for a country. If a locale doesn't correspond to one specific country, the method may return ISO 3166-2 subdivisions from one or more countries that uses that language. For example, the ar locale includes subdivisions from Arabic-speaking countries, such as Tunisia, Algeria, Syria, Lebanon, etc. For historical compatibility reasons, the default en locale only includes states in the United States (identical to en_US). However, you can use other English locales, such as en_IN, en_GB, and en_AU, if needed.
Parameters
NameTypeDefaultDescription
abbreviatedbooleanfalseIf true this will return abbreviated first-level administrative entity names. Otherwise this will return the long name.
Returns: string
Examples

street#

Generates a random localized street name.
Returns: string
Examples

streetAddress#

Generates a random localized street address.
Parameters
NameTypeDefaultDescription
useFullAddressbooleanWhen true this will generate a full address. Otherwise it will just generate a street address.
Returns: string
Examples

timeZone#

Returns a random IANA time zone relevant to this locale.
The returned time zone is tied to the current locale.
Returns: string
Examples

zipCode#

Generates random zip code from specified format. If format is not specified, the locale's zip format is used.
Parameters
NameTypeDefaultDescription
formatstringWThe optional format used to generate the zip code. This won't be used if the state option is specified.
Returns: string
Examples

Modified at 2025-06-25 07:57:16
Previous
Internet
Next
Lorem
Built with