Template Syntax Reference
Complete reference for all template functions, variables, and Faker generators
On This Page
Template Variables
Capture data from incoming HTTP requests
get
Query ParameterExtracts a value from URL query parameters
Syntax:
{{get 'parameterName'}}Example:
// Request: GET /api/users?id=123&name=John
// Template:
{
"userId": {{get 'id'}},
"userName": {{get 'name'}}
}
// Response:
{
"userId": 123,
"userName": "John"
}post
POST Form DataExtracts a value from POST form data (application/x-www-form-urlencoded)
Syntax:
{{post 'fieldName'}}Example:
// Request: POST /api/login
// Body: username=alice&password=secret
// Template:
{
"loggedInUser": {{post 'username'}},
"status": "success"
}
// Response:
{
"loggedInUser": "alice",
"status": "success"
}json
JSON BodyExtracts a value from JSON request body (application/json)
Syntax:
{{json 'propertyName'}}Example:
// Request: POST /api/users
// Body: {"name": "Bob", "age": 25}
// Template:
{
"created": true,
"user": {
"name": {{json 'name'}},
"age": {{json 'age'}}
}
}
// Response:
{
"created": true,
"user": {
"name": "Bob",
"age": 25
}
}path
Path SegmentExtracts a path segment from the request URL by index (1-based)
Syntax:
{{path $index}}Example:
// Request: GET /users/123/profile
// Template:
{
"resource": {{path $1}},
"userId": {{path $2}},
"action": {{path $3}}
}
// Response:
{
"resource": "users",
"userId": "123",
"action": "profile"
}Note:
Path segments are indexed starting from 1 (not 0). The first segment after the domain is $1.
path.regex
Regex Capture GroupExtracts a captured group from a regular expression path pattern. Requires the Response path to use regex: prefix.
Syntax:
{{path.regex $index}}Example:
// Response Path: regex:/users/(\d+)/posts/(\d+)
// Request: GET /users/456/posts/789
// Template:
{
"userId": {{path.regex $1}},
"postId": {{path.regex $2}},
"title": {{faker 'lorem.sentence'}}
}
// Response:
{
"userId": "456",
"postId": "789",
"title": "Lorem ipsum dolor sit amet."
}π‘ Using Regex Paths
To use path.regex, set your Response path to a regex pattern starting with regex:/. Use parentheses () to create capture groups.
Example paths: regex:/users/(\d+), regex:/api/v(\d+)/products/([a-z]+)
Control Structures
Create loops and dynamic data structures
{{#repeat N}}
LoopRepeats the enclosed content N times
Syntax:
{{#repeat count}}
// Content to repeat
{{/repeat}}Example:
{
"users": [
{{#repeat 3}}
{
"id": {{@index}},
"name": {{faker 'person.name'}}
}
{{/repeat}}
]
}
// Generates 3 user objects with auto-incremented IDs@index
IteratorCurrent iteration index with optional start and step values
Syntax Variants:
{{@index}} // 0, 1, 2, 3, 4...
{{@index 1}} // 1, 2, 3, 4, 5...
{{@index 100}} // 100, 101, 102, 103...
{{@index 0 2}} // 0, 2, 4, 6, 8...
{{@index 1 10}} // 1, 11, 21, 31, 41...Parameters:
- start (optional): Starting value (default: 0)
- step (optional): Increment value (default: 1)
Special Functions
jwt
AuthenticationGenerates a JWT (JSON Web Token) with specified expiration time
Syntax:
{{jwt expirationSeconds}}Example:
{
"token": {{jwt 3600}}, // Expires in 1 hour
"refreshToken": {{jwt 86400}} // Expires in 24 hours
}Common Expiration Times:
3600= 1 hour86400= 24 hours (1 day)604800= 7 days2592000= 30 days
Faker Functions (20+)
Generate realistic fake data for various domains
General Syntax
{{faker 'category.function'}}All Faker functions follow this pattern. Some functions don't require a category (e.g., email).
Locale Support
Specify a locale using a colon (:) to generate data in different languages.
Syntax:
{{faker 'function:locale'}}
{{faker 'function(args):locale'}}Examples:
{{faker 'person.name'}} // Default: en_US
{{faker 'person.name:en_US'}} // English
{{faker 'person.name:ko_KR'}} // Korean
{{faker 'person.name:ja_JP'}} // Japanese
{{faker 'address.city:fr_FR'}} // French
{{faker 'sentence(5):en_US'}} // English sentence (5 words)Supported Locales:
Common Locales:
en_US- English (US) - Defaultko_KR- Koreanja_JP- Japanesefr_FR- Frenchde_DE- Germanes_ES- Spanishit_IT- Italianpt_BR- Portuguese (Brazil)zh_CN- Chinese (Simplified)ru_RU- Russian
Locale-Dependent Functions:
person.*- Names, first names, last namesaddress.*- Cities, states, streets, etc.company.*- Company names, job titlesphone.*- Phone numbersword- Single wordssentence- Sentencesparagraph- Paragraphstext- Text blocks
Note: All locale-dependent functions are fully supported in ko_KR locale, including company functions (company, companySuffix, bs, jobTitle) and text functions (word, sentence, paragraph, text) with native Korean content. Text functions support arguments with maximum limits (sentence: 100 words, paragraph: 20 sentences, text: 5,000 characters).
Person
Generate person-related data
{{faker 'person.name'}}
John Doe{{faker 'person.name:ko_KR'}}
κΉμ² μ{{faker 'person.firstName'}}
Jane{{faker 'person.firstNameMale'}}
John{{faker 'person.firstNameFemale'}}
Jane{{faker 'person.lastName'}}
SmithInternet
Generate internet and web-related data
{{faker 'email'}}
user@example.com{{faker 'safeEmail'}}
user@example.org{{faker 'userName'}}
john_doe123{{faker 'password'}}
P@ssw0rd123!{{faker 'domainName'}}
example.com{{faker 'url'}}
https://example.com{{faker 'ipv4'}}
192.168.1.1{{faker 'ipv6'}}
2001:0db8:85a3::8a2e:0370:7334Address
Generate address and location data
{{faker 'address.city'}}
New York{{faker 'address.city:ko_KR'}}
μμΈ{{faker 'address.state'}}
California{{faker 'address.country'}}
United States{{faker 'address.postcode'}}
90210{{faker 'address.streetAddress'}}
123 Main St{{faker 'address.streetName'}}
Main Street{{faker 'address.latitude'}}
34.0522{{faker 'address.longitude'}}
-118.2437Company
Generate company and business data
{{faker 'company.company'}}
Acme Corporation{{faker 'company.company:ko_KR'}}
ν
ν¬μ루μ
{{faker 'company.companySuffix'}}
Inc{{faker 'company.companySuffix:ko_KR'}}
μ£Όμνμ¬{{faker 'company.bs'}}
synergize markets{{faker 'company.bs:ko_KR'}}
νμ μ μΈ μ루μ
μ μ 곡ν©λλ€{{faker 'company.jobTitle'}}
Software Engineer{{faker 'company.jobTitle:ko_KR'}}
μννΈμ¨μ΄ μμ§λμ΄Text
Generate placeholder text
Korean Support: Text functions (word, sentence, paragraph, text) are now fully supported in ko_KR locale with native Korean content.
{{faker 'word'}}
ipsum{{faker 'word:ko_KR'}}
μ¬κ³Ό{{faker 'sentence'}}
Lorem ipsum dolor sit amet.{{faker 'sentence:ko_KR'}}
μ€λμ μ λ§ μ’μ λ μ¨μ
λλ€.{{faker 'sentence(10):ko_KR'}}
10κ° λ¨μ΄λ‘ ꡬμ±λ λ¬Έμ₯ (μ΅λ 100λ¨μ΄){{faker 'paragraph'}}
Lorem ipsum dolor...{{faker 'paragraph:ko_KR'}}
λμ§νΈ μλκ° λλνλ©΄μ...{{faker 'paragraph(5):ko_KR'}}
5κ° λ¬Έμ₯μΌλ‘ ꡬμ±λ λ¬Έλ¨ (μ΅λ 20λ¬Έμ₯){{faker 'text'}}
Long text content...{{faker 'text:ko_KR'}}
νκ΅μ΄ κΈ΄ ν
μ€νΈ...{{faker 'text(500):ko_KR'}}
500μ ν
μ€νΈ (μ΅λ 5,000μ)Function Arguments & Limits:
sentence(n)- Generate sentence with n words (max: 100 words)paragraph(n)- Generate paragraph with n sentences (max: 20 sentences)text(n)- Generate text with n characters (max: 5,000 characters)
Number & String
Generate random numbers and values
{{faker 'randomNumber'}}
12345{{faker 'randomDigit'}}
7{{faker 'randomFloat'}}
123.45{{faker 'boolean'}}
true{{faker 'randomLetter'}}
aDate & Time
Generate date and time values
{{faker 'unixTime'}}
1609459200{{faker 'dateTime'}}
2024-01-15 14:30:00{{faker 'iso8601'}}
2024-01-15T14:30:00Z{{faker 'date'}}
2024-01-15{{faker 'time'}}
14:30:00Payment
Generate payment and card data
{{faker 'creditCardType'}}
Visa{{faker 'creditCardNumber'}}
4111111111111111{{faker 'iban'}}
GB29 NWBK 6016 1331 9268 19{{faker 'swiftBicNumber'}}
NWBKGB2LPhone
Generate phone numbers
{{faker 'phone.phoneNumber'}}
(555) 123-4567{{faker 'phone.phoneNumber:ko_KR'}}
010-1234-5678{{faker 'phone.e164PhoneNumber'}}
+15551234567Color
Generate color values
{{faker 'hexColor'}}
#3B82F6{{faker 'rgbColor'}}
59,130,246{{faker 'colorName'}}
blueImage
Generate image URLs
{{faker 'imageUrl'}}
https://picsum.photos/640/480{{faker 'imageUrl(500,500)'}}
https://picsum.photos/500/500{{faker 'gravatarUrl'}}
https://www.gravatar.com/avatar/...UUID & Barcode
Generate unique identifiers and barcodes
{{faker 'uuid'}}
550e8400-e29b-41d4-a716-446655440000{{faker 'ean13'}}
1234567890123{{faker 'isbn13'}}
978-1234567890User Agent
Generate browser user agent strings
{{faker 'userAgent'}}
Mozilla/5.0...{{faker 'chrome'}}
Chrome user agent{{faker 'firefox'}}
Firefox user agentMiscellaneous
Hashes, emojis, and more
{{faker 'md5'}}
5d41402abc4b2a76b9719d911017c592{{faker 'sha256'}}
2c26b46b68...{{faker 'emoji'}}
πValidation Rules
Template syntax is validated in real-time in the editor
Common Validation Errors
β Unclosed template tag
{
"name": {{faker 'person.name'
}Missing closing }
β Unclosed repeat block
{{#repeat 10}}
{"id": {{@index}}}
// Missing {{/repeat}}β Invalid argument type
{{get id}} // Missing quotes for string argument
{{jwt "3600"}} // Should be number, not stringβ Correct syntax
{
"name": {{faker 'person.name'}},
"id": {{get 'userId'}},
"token": {{jwt 3600}}
}Validation Features
- Real-time syntax checking as you type
- Inline error markers with line and column numbers
- Auto-completion for template functions
- Validation of template function names and arguments
- JSON structure validation (after template processing)
- Bracket and parenthesis matching