Lorem Json

The Lorem Ipsum for Json

{ "name": "{{name()}}", "age": "{{int(25, 30)}}", "country": "{{country()}}" }

Easy to use, placeholder json data

Just create a template and generate placeholder JSON data for database population or api mocking. It's that easy.

https://lorem-json.com/api/json

Using our placeholder data generation API is free, and always will be.

Intuitive support for all data types

Generate simple or complex data structures to fit your needs. Combine any of the following and more:

  • Basic: strings, integers, floats, booleans

  • Advanced: dates, times

  • General Purpose: names, animals, colors, countries, languages

{ "border": "{{int(1, 5)}}px {{random(solid, dotted, dashed)}} {{color()}}", "coordinates": { "type": "array", "count": 2, "items": "{{float(0, 120, 5)}}" }, "password": "xX{{animal()}}-{{string(6, 10, *)}}" }

To use any of the available dynamic data modules simply enclose the module in double brackets {{int(20)}}.

"{{int(20)}}"

You can combine data modules into a single field as if they were template string values.

{ "age": "{{int(20)}} years old" }

You can generate nested objects and arrays using the same methods. There is a limit of 1000 array elements.

{ "age": "{{int(50)}} years old", "home": { "country": "{{country()}}", "address": "{{int(123, 456)}} example street" }, "friends": { "type": "array", "count": 5, "items": "{{name()}}, {{name()}}" } }

Reference Keys
NEW

Reference keys allow you to reuse the output of one module as an input to another, enabling dynamic data relationships. Define a key by appending a colon followed by the key name to the module name.

Note: keys may only contain letters, numbers dashes (-) and underscores (_)

Once a key is defined, it can be referenced in subsequent modules by using the syntax {{#keyName}}. This is particularly useful for creating dependent or related data values.

Example: Using a key to create a dependent relationship between the value of a dice roll and a subsequent action.

{ "dice": "d{{random:dmax(4, 6, 8, 10, 12, 20)}}", "roll": "{{int:roll(1, {{#dmax}})}}", "action": "{{name()}} rolled a d{{#dmax}} and got {{#roll}}" }

Dynamic Data Modules

int(max), int(min, max)

generates a random integer between min (inclusive) and max (exclusive). If only one argument is provided it will generate between 0 and the provided value.

{ "age": "{{int(50)}} years old", "age_older": "{{int(90, 100)}} mega old" }

string(length), string(minLength, maxLength), string(min, max, alphabet)

generates a random string of length between min (inclusive) and max (exclusive). You can provide a custom alphabet to use when generating the string. This can be used for generating hex values, password masks or really anything.

{ "random": "{{string(25)}}", "random_range": "{{string(2, 15)}}", "justBs": "{{string(25, 50, Bb)}}" }

bool()

generates a random boolean of true, or false with a 50% chance for either.

{ "lorem-json-is-great": "{{bool()}}" }

date/dateTime(start, end)

generates a random date/datetime between start(inclusive) and end(exclusive) dates. Ensure the dates are provided in ISO format.

start date must be greater than end date or an error will be returned instead

{ "birthday": "{{date(1980-01-01, 2022-01-01)}}", "birthTime": "{{dateTime(1980-01-01 4:00, 1980-01-01 6:00)}}" }

float(min), float(min, max), float(min, max, decimals)

generates a random floating point number between min and max. if no max is provided it will instead generate between 0 and the value provided.

the number will be rounded to decimals which, if not provided, defaults to 2.

{ "precision": "{{float(0, 1)}}", "pennies": "{{float(5.99, 12.99, 2)}}" }

random(*args)

Chooses one of the provided arguments at random. Useful for selecting from a set number of predetermined values.

Note: All data modules can accept the output of any other module as their input. This can best be seen here, we can use a combination of the int module to generate a special random dice option.

{ "choice": "{{random(yes, no)}}", "dice": "{{random(d4, d6, d8, d10, d12, d20, d{{int(21, 100)}})}}" }

color(), animal(), country(), name(), language()

All of these take no arguments and output a random value from their dictionaries. animals for animal(), colors for color(), etc.

{ "color": "{{color()}}", "animal": "{{animal()}}", "country": "{{country()}}", "name": "{{name()}}", "language": "{{language()}}" }

Arrays

You can either explicitly provide an array of data to be parsed or use the format seen on the right to generate a list of n length automatically using your provided template.

Count is limited to a length of 1000. If you need more than that just make more api calls

{ "explicit": [ "{{int(30)}}", "{{string(5)}}" ], "generated": { "type": "array", "count": 2, "items": { "name": "{{name()}}", "age": "{{int(20, 30)}}" } } }

Rate Limiting

This service is provided free and as-is. Please allow this to continue operating as a free service and limit your requests to 10/second.