Skip to content

Faker Reference v3.10.0

The built-in faker generates values inside stub templates. Keys are written faker.DOMAIN.METHOD and used as {{faker.DOMAIN.METHOD}}. Each evaluation produces a new value.

1. Person

KeyExample
faker.Person.FirstNameEmma
faker.Person.LastNameJohnson
faker.Person.NameDr. Emma Johnson
faker.Person.PrefixDr.
faker.Person.SuffixJr.
faker.Person.Genderfemale
faker.Person.Age34
yaml
output:
  data:
    first_name: "{{faker.Person.FirstName}}"
    last_name: "{{faker.Person.LastName}}"
    full_name: "{{faker.Person.Name}}"
    age: "{{faker.Person.Age}}"

2. Contact

KeyExample
faker.Contact.Emailjohn.smith@example.org
faker.Contact.Phone+1 202-555-0141
faker.Contact.Usernamesilent-river-42
faker.Contact.URLhttps://api.demo-app.io/users/42
yaml
output:
  data:
    email: "{{faker.Contact.Email}}"
    phone: "{{faker.Contact.Phone}}"
    username: "{{faker.Contact.Username}}"
    website: "{{faker.Contact.URL}}"

3. Geo

KeyExample
faker.Geo.CountryUnited States
faker.Geo.CountryCodeUS
faker.Geo.CitySan Francisco
faker.Geo.StateCalifornia
faker.Geo.StateCodeCA
faker.Geo.Zip94107
faker.Geo.Street127 Market St
faker.Geo.Latitude37.7749
faker.Geo.Longitude-122.4194
faker.Geo.TimeZoneAmerica/Los_Angeles
yaml
output:
  data:
    country: "{{faker.Geo.Country}}"
    city: "{{faker.Geo.City}}"
    lat: "{{faker.Geo.Latitude}}"
    lon: "{{faker.Geo.Longitude}}"

4. Network

KeyExample
faker.Network.DomainNamecustomer-api.example.net
faker.Network.DomainSuffixnet
faker.Network.IPv4192.168.14.22
faker.Network.IPv62001:db8:85a3::8a2e:370:7334
faker.Network.MAC3a:8f:52:9d:11:be
faker.Network.UserAgentMozilla/5.0 (...)
faker.Network.HTTPMethodPATCH
faker.Network.HTTPStatusCode409
yaml
output:
  data:
    ipv4: "{{faker.Network.IPv4}}"
    ua: "{{faker.Network.UserAgent}}"
    status: "{{faker.Network.HTTPStatusCode}}"

5. Company

KeyExample
faker.Company.CompanyAcme Digital Labs
faker.Company.CompanySuffixLLC
faker.Company.JobTitleSenior Platform Engineer
faker.Company.JobLevelSenior
faker.Company.JobDescriptorLead
yaml
output:
  data:
    company: "{{faker.Company.Company}}"
    company_suffix: "{{faker.Company.CompanySuffix}}"
    title: "{{faker.Company.JobTitle}}"

6. Commerce

KeyExample
faker.Commerce.ProductNameWireless Noise-Canceling Headphones
faker.Commerce.ProductCategoryElectronics
faker.Commerce.ProductDescriptionCompact over-ear headphones with active noise cancellation.
faker.Commerce.CurrencyLongUS Dollar
faker.Commerce.CurrencyShortUSD
faker.Commerce.Price 10 500249.99
yaml
output:
  data:
    product: "{{faker.Commerce.ProductName}}"
    currency: "{{faker.Commerce.CurrencyShort}}"
    price: "{{faker.Commerce.Price 10 500}}"

7. Text

KeyExample
faker.Text.Wordspectrum
faker.Text.Sentence 8Service health remains stable under peak request load.
faker.Text.Paragraph 2Two short random paragraphs for testing long fields.
faker.Text.Phraseblue horizon
faker.Text.QuoteSmall steps every day build strong systems.
faker.Text.QuestionCan we safely retry this request?
yaml
output:
  data:
    title: "{{faker.Text.Phrase}}"
    summary: "{{faker.Text.Sentence 10}}"
    quote: "{{faker.Text.Quote}}"

8. DateTime

KeyExample
faker.DateTime.Date2026-02-17T10:24:51.123456789Z
faker.DateTime.PastDate2021-08-03T14:12:11.987654321Z
faker.DateTime.FutureDate2028-11-29T07:53:02.456789012Z
faker.DateTime.Year2027
faker.DateTime.Month9
faker.DateTime.Day18
faker.DateTime.Hour16
faker.DateTime.Minute42
faker.DateTime.Second5
faker.DateTime.WeekDayTuesday
yaml
output:
  data:
    created_at: "{{faker.DateTime.PastDate}}"
    expires_at: "{{faker.DateTime.FutureDate}}"
    weekday: "{{faker.DateTime.WeekDay}}"

9. Number v3.16.1

KeyExample
faker.Number.Int7249581
faker.Number.IntN 10073
faker.Number.IntRange 10 5027
faker.Number.Int3217249581
faker.Number.Int6438942174958123
faker.Number.Float320.7425
faker.Number.Float32Range 1.5 9.54.23
faker.Number.Float640.123456789
faker.Number.Float64Range 100.0 999.0567.89
yaml
output:
  data:
    score: "{{faker.Number.IntN 100}}"
    rating: "{{faker.Number.Float32}}"
    max_users: "{{faker.Number.IntRange 10 100}}"
    price: "{{faker.Number.Float64Range 9.99 999.99}}"

10. Identity

KeyExample
faker.Identity.UUID3f8b6a6e-3f34-41e2-a06f-e6a8b8db7a4d
faker.Identity.SSN513-84-3901
faker.Identity.EIN26-9182736

SSN is a US Social Security Number, EIN a US Employer Identification Number. Both are synthetic here — never treat a generated value as a real identifier.

yaml
output:
  data:
    user_id: "{{faker.Identity.UUID}}"
    ssn: "{{faker.Identity.SSN}}"
    ein: "{{faker.Identity.EIN}}"

Assertions

Faker values change on every evaluation, so assert on format or range rather than on an exact value. Where a test needs to trace a response back to its request, mix in a request-bound field: {{.Request.id}}.

Full Stub Example

yaml
- service: example.UserService
  method: GetProfile
  input:
    matches:
      id: "\\d+"
  output:
    data:
      id: "{{.Request.id}}"
      first_name: "{{faker.Person.FirstName}}"
      last_name: "{{faker.Person.LastName}}"
      full_name: "{{faker.Person.Name}}"
      email: "{{faker.Contact.Email}}"
      phone: "{{faker.Contact.Phone}}"
      city: "{{faker.Geo.City}}"
      country: "{{faker.Geo.Country}}"
      lat: "{{faker.Geo.Latitude}}"
      lon: "{{faker.Geo.Longitude}}"
      ip: "{{faker.Network.IPv4}}"
      user_agent: "{{faker.Network.UserAgent}}"
      company: "{{faker.Company.Company}}"
      product: "{{faker.Commerce.ProductName}}"
      price: "{{faker.Commerce.Price 10 500}}"
      bio: "{{faker.Text.Paragraph 1}}"
      created_at: "{{faker.DateTime.PastDate}}"
      score: "{{faker.Number.IntN 100}}"
      account_id: "{{faker.Identity.UUID}}"

Values come from github.com/brianvoe/gofakeit/v7.