Mock Data API
The Mock Data API allows developers to generate realistic random data from a JSON Schema. Each request returns a share link that can be used directly in your frontend applications to fetch consistent mock data for prototyping or testing.
POST
https://jsontoall-tools.vercel.app/mock-api/generate
Generates random data from a JSON schema and returns a share link with a preview of the generated records.
Parameters
Field | Type | Required | Description |
---|---|---|---|
jsonSchema | object | Yes | The schema definition. Keys are field names, values are generators like "uuid" , "firstName" , "email" , etc. |
records | integer | No (default = 1) | Number of records to generate. |
Request Example
curl -X POST hthttps://jsontoall-tools.vercel.app/mock-api/generate
-H "Content-Type: application/json" \
-d '{
"jsonSchema": {
"id": "uuid",
"firstName": "firstName",
"lastName": "lastName",
"email": "email",
"username": "username",
"password": "password",
"phone": "phone",
"company": "company",
"jobTitle": "jobTitle",
"price": "price",
"coordinates": "coordinates",
"createdAt": "date"
},
"records": 2
}'
200 Successful
{
"apiUrl": "/mock-api/share/3d08bb76-0041-44dd-95bb-a19e9c173b29",
"preview": [
{
"id": "24059a6d-4370-4ea3-95fa-c89c1c4a289b",
"firstName": "Cody",
"lastName": "Abernathy",
"email": "Sterling_Crona-Will@yahoo.com",
"username": "Gail_Dooley",
"password": "Apv1gpK_FMwZtsd",
"phone": "(335) 730-3808 x778",
"company": "Koepp, Hagenes and Stroman",
"jobTitle": "Forward Configuration Developer",
"price": "583.77",
"coordinates": { "lat": -57.6762, "lng": 153.3869 },
"createdAt": "2025-12-21T20:06:46.652Z"
}
]
}
GET
https://jsontoall-tools.vercel.app/mock-api/share/:shareId
Retrieves the previously generated mock data using the share ID. This endpoint is ideal for embedding directly in your frontend application.
Parameters
Field | Type | Required | Description |
---|---|---|---|
shareId | string | Yes | The ID returned in apiUrl from /mock-api/generate . |
Request Example
curl -X GET https://jsontoall-tools.vercel.app/mock-api/share/d6e6e81c-59f4-4b4f-a464-68e253a85328"
200 Successful
{
"status": "success",
"data": [ ...same as preview above... ]
}
Error Responses
400 Bad Request
{
"status": "error",
"message": "Invalid schema format"
}
Supported Schema Properties
Use the following property keys in jsonSchema
. Each key maps to a generator powered by faker.js.
Schema Property | Type | Example Value | Notes |
---|---|---|---|
Identity / User | |||
firstName | string | Sourav | Generates a random first name, useful for mocking data. |
lastName | string | Halder | Generates a random last name, useful for mocking data. |
middleName | string | James | Generates a random middle name. This is useful for creating realistic mock data |
fullName | string | John James Doe | Useful when both first + last are needed together |
gender | string | Male | Returns "male" or "female" randomly |
jobTitle | string | Software Engineer | Generates a random professional title |
jobType | string | Full-time | Random job type (e.g., Full-time, Contract, Part-time) |
bio | string | Passionate developer with 5+ years in frontend | Generates a short random biography text |
Address / Location | |||
street | string | 42 Street | Generates a street address |
secondaryAddress | string | Apt. 12BDX | Adds extra info (apartment, suite, etc.) |
buildingNumber | string | 221B | Building / house number |
city | string | Kolkata | Random city name |
state | string | West Bengal | Full state/region name |
stateAbbr | string | WB | Abbreviated state code |
country | string | India | Random country |
countryCode | string | IN | ISO 2-letter country code |
zip | string | 700***** | Postal / ZIP code |
direction | string | North-East | Random compass direction |
timezone | string | Asia/**** | Valid IANA timezone string |
coordinates | object | { "lat": -57.6762, "lng": 153.3869 } | Returns numeric lat /lng |
Commerce / Business | |||
product | string | Shoes | Generates a simple product type |
productName | string | Ergonomic Wooden Chair | Generates a full product name |
productDescription | string | "Stylish chair with comfort" | Generates a marketing-like description |
department | string | Electronics | Random commerce department |
price | string | 199.99 | Random price as string |
priceRange | string | 349.50 | Price with custom range |
currency | string | USD | ISO 4217 currency code |
creditCardNumber | string | 4111-1111-1111-1111 | Generates a fake credit card number |
iban | string | DE89370400440532013000 | Generates an International Bank Account Number |
bic | string | DEUTDEFF | Bank Identifier Code (SWIFT) |
transactionDescription | string | Payment for invoice #12345 | Random financial transaction description |
Tech / Internet | |||
email | string | john.doe@example.com | Generates a random but valid-looking email address |
username | string | johndoe92 | Generates a random username |
password | string | passW0rd! | Generates a random password with mixed characters |
url | string | https://example.com | Generates a random URL |
domain | string | example.org | Generates a domain name |
ip | string | 192.168.1.10 | Generates a random IPv4 address |
ipv6 | string | 2001:0db8:85a3:0000:0000:8a2e:0370:7334 | Generates a random IPv6 address |
mac | string | 00:1B:44:11:3A:B7 | Generates a random MAC address |
emoji | string | 🚀 | Generates a random emoji character |
Date & Time | |||
date | string (ISO) | 2025-08-20T14:32:00.000Z | Generates a random date-time anytime |
pastDate | string (ISO) | 2021-05-14T09:22:00.000Z | Generates a random date in the past |
futureDate | string (ISO) | 2026-03-02T18:45:00.000Z | Generates a random date in the future |
recentDate | string (ISO) | 2025-08-18T07:12:00.000Z | Generates a date from the recent past |
birthdate | string (ISO) | 1993-04-25T00:00:00.000Z | Generates a plausible birthdate |
soonDate | string (ISO) | 2025-08-25T11:15:00.000Z | Generates a date in the near future |
month | string | August | Generates a random month name |
weekday | string | Wednesday | Generates a random day of the week |
Text / Content | |||
word | string | innovation | Generates a single random word |
words | string | creative smart design | Generates multiple random words |
sentence | string | The quick brown fox jumps. | Generates a single sentence |
sentences | string | The sun is shining. Birds are singing. | Generates multiple sentences |
paragraph | string | Lorem ipsum dolor sit amet... | Generates a single paragraph |
paragraphs | string | Lorem ipsum dolor sit amet... Sed ut perspiciatis unde omnis... | Generates multiple paragraphs |
slug | string | creative-design-ideas | Generates a URL-friendly slug |
System / Misc | |||
uuid | string | "7c9e6679-7425-40de-944b-e07fc1f90ae7" | Universally unique identifier (UUID v4) |
nanoid | string | "V1StGXR8_Z5jdHi6B-myT" | Random NanoID string (secure, URL-friendly) |
fileName | string | "document_report.pdf" | Random file name with extension |
fileType | string | "image" | File type (like image , video , application ) |
mimeType | string | "application/json" | MIME type of a file |
semver | string | "1.4.2" | Semantic version string |
color | string | "orchid" | Human-readable color name |
rgb | string | "rgb(255, 99, 71)" | RGB color string |
hex | string | "#ff6347" | Hexadecimal color code |
Communication / Company | |||
phone | string | "+1-202-555-0198" | Generates a random phone number |
phoneIMEI | string | "356938035643809" | Generates a random phone IMEI number |
company | string | "Globex Corporation" | Generates a company name |
catchPhrase | string | "Empowering next-gen solutions" | Generates a company catch phrase |
buzzword | string | "synergy" | Generates a company buzzword |
Media | |||
imageUrl | string (URL) | "https://loremflickr.com/640/480" | Generates a random image URL |
avatar | string (URL) | "https://avatars.githubusercontent.com/u/9919?v=4" | Generates a random avatar image URL |
abstractImage | string (URL) | "https://loremflickr.com/640/480/abstract" | Generates a random abstract category image URL |
Numbers & Boolean | |||
number | integer | 42 | Generates a random integer between 1 and 100 |
float | float | 57.34 | Generates a random floating-point number between 1 and 100 with 2 decimal places |
boolean | boolean | true | Generates a random true or false value |