Mockaroo API
api.mockaroo.com · Developer Tools
Generate realistic test data — names, addresses, emails, phone numbers, UUIDs, and 100+ other data types. Export as JSON, CSV, SQL, Excel. Free tier: 200 records/request.
Authentication
API Key
Free API key at mockaroo.com. Pass as ?key= query parameter.
Sample Requests
GET
Generate users
Generate 5 fake user records.
https://api.mockaroo.com/api/generate.json?id=integer|1|100&key=YOUR_KEY&count=5&email=email&country=country&last_name=last_name&first_name=first_name
Hover any highlighted part to learn what it does
curl -X GET "https://api.mockaroo.com/api/generate.json?id=integer%7C1%7C100&key=YOUR_KEY&count=5&email=email&country=country&last_name=last_name&first_name=first_name"
import requests
params = {
"id": "integer|1|100",
"key": "YOUR_KEY",
"count": "5",
"email": "email",
"country": "country",
"last_name": "last_name",
"first_name": "first_name"
}
response = requests.get(
"https://api.mockaroo.com/api/generate.json",
params=params,
)
print(response.json())const url = new URL('https://api.mockaroo.com/api/generate.json');
url.searchParams.set('id', 'integer|1|100');
url.searchParams.set('key', 'YOUR_KEY');
url.searchParams.set('count', '5');
url.searchParams.set('email', 'email');
url.searchParams.set('country', 'country');
url.searchParams.set('last_name', 'last_name');
url.searchParams.set('first_name', 'first_name');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.mockaroo.com/api/generate.json")
q := baseURL.Query()
q.Set("id", "integer|1|100")
q.Set("key", "YOUR_KEY")
q.Set("count", "5")
q.Set("email", "email")
q.Set("country", "country")
q.Set("last_name", "last_name")
q.Set("first_name", "first_name")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.mockaroo.com/api/generate.json")
uri.query = URI.encode_www_form({
"id" => "integer|1|100",
"key" => "YOUR_KEY",
"count" => "5",
"email" => "email",
"country" => "country",
"last_name" => "last_name",
"first_name" => "first_name"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.mockaroo.com/api/generate.json?" . http_build_query([
"id" => "integer|1|100",
"key" => "YOUR_KEY",
"count" => "5",
"email" => "email",
"country" => "country",
"last_name" => "last_name",
"first_name" => "first_name"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Get a free API key at mockaroo.com
- Build schemas visually at mockaroo.com, then use the API
- GET /api/generate.json?count=10&key=YOUR_KEY&{field}={type}
- Types: first_name, last_name, email, phone, address, city, state, country, uuid, integer, date
- Save schemas as datasets and reference by ID for reuse