Developer
SDKs & Code Examples
Get up and running in under 2 minutes — no SDK needed, plain HTTP works everywhere.
✓The examples below are ready to use right now — just copy, paste, and swap in your API key. No installation required. Installable packages (
@dummify/sdk on npm, PyPI, and Go) are coming soon.cURL
terminal
# Set your key once export DUMMIFY_KEY="sk_live_..." # Stock quotes curl "https://api.dummifai.com/api/v1/stock?count=10" \ -H "Authorization: Bearer $DUMMIFY_KEY" # French person profiles (deterministic with seed) curl "https://api.dummifai.com/api/v1/person?count=5&locale=fr&seed=my-project" \ -H "Authorization: Bearer $DUMMIFY_KEY" # E-commerce orders + bank accounts curl "https://api.dummifai.com/api/v1/order?count=20" \ -H "Authorization: Bearer $DUMMIFY_KEY" curl "https://api.dummifai.com/api/v1/bank?count=5&seed=fintech" \ -H "Authorization: Bearer $DUMMIFY_KEY" # Filter by level/rating curl "https://api.dummifai.com/api/v1/logs?level=ERROR&count=50" \ -H "Authorization: Bearer $DUMMIFY_KEY" curl "https://api.dummifai.com/api/v1/reviews?rating=5&count=10" \ -H "Authorization: Bearer $DUMMIFY_KEY" # Live SSE stream (10 price ticks) curl -N "https://api.dummifai.com/api/v1/stream?count=10" \ -H "Authorization: Bearer $DUMMIFY_KEY" \ -H "Accept: text/event-stream"
JavaScript
dummify.mjs
// npm install @dummify/sdk (coming soon)
// For now, use fetch directly:
const DUMMIFY_KEY = process.env.DUMMIFY_API_KEY;
async function dummify(endpoint, params = {}) {
const qs = new URLSearchParams(params).toString();
const url = `https://api.dummifai.com/api/v1/${endpoint}${qs ? '?' + qs : ''}`;
const res = await fetch(url, {
headers: { Authorization: `Bearer ${DUMMIFY_KEY}` }
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
return res.json();
}
// Data endpoints
const { data: stocks } = await dummify('stock', { count: 10 });
const { data: people } = await dummify('person', { count: 5, locale: 'fr', seed: 'my-app' });
const { data: orders } = await dummify('order', { count: 20, seed: 'checkout-demo' });
const { data: bank } = await dummify('bank', { count: 3, seed: 'fintech' });
const { data: reviews } = await dummify('reviews', { count: 10, rating: 5 });
const { data: logs } = await dummify('logs', { count: 50, level: 'ERROR', service: 'auth' });
// SSE streaming (EventSource)
const source = new EventSource(
`https://api.dummifai.com/api/v1/stream?count=20`,
// Note: EventSource doesn't support custom headers in browsers.
// Use a proxy or the playground for browser-based SSE.
);
source.onmessage = (e) => {
const tick = JSON.parse(e.data);
if (tick.event === 'done') { source.close(); return; }
console.log(tick.data.symbol, tick.data.price);
};Python
dummify.py
# pip install requests
import os, requests
DUMMIFY_KEY = os.environ["DUMMIFY_API_KEY"]
def dummify(endpoint: str, **params) -> list:
url = f"https://api.dummifai.com/api/v1/{endpoint}"
resp = requests.get(
url,
headers={"Authorization": f"Bearer {DUMMIFY_KEY}"},
params=params,
timeout=10,
)
resp.raise_for_status()
return resp.json()["data"]
# Examples
stocks = dummify("stock", count=10)
people = dummify("person", count=5, locale="de", seed="my-app")
orders = dummify("order", count=20, seed="checkout-demo")
bank = dummify("bank", count=5, seed="fintech")
reviews = dummify("reviews", count=30, rating=5)
logs = dummify("logs", count=50, level="ERROR", service="api-gateway")
# SSE streaming
import sseclient # pip install sseclient-py
with requests.get(
"https://api.dummifai.com/api/v1/stream?count=10",
headers={"Authorization": f"Bearer {DUMMIFY_KEY}"},
stream=True,
) as resp:
client = sseclient.SSEClient(resp)
for event in client.events():
import json
data = json.loads(event.data)
if data.get("event") == "done":
break
print(data["data"]["symbol"], data["data"]["price"])Go
main.go
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
)
const baseURL = "https://api.dummifai.com/api/v1"
func dummify(endpoint string, params url.Values) ([]interface{}, error) {
req, _ := http.NewRequest("GET", baseURL+"/"+endpoint+"?"+params.Encode(), nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("DUMMIFY_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil { return nil, err }
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
var out struct{ Data []interface{} }
json.Unmarshal(body, &out)
return out.Data, nil
}
func main() {
stocks, _ := dummify("stock", url.Values{"count": {"10"}})
fmt.Printf("Got %d stocks\n", len(stocks))
bank, _ := dummify("bank", url.Values{"count": {"5"}, "seed": {"fintech"}})
fmt.Printf("Got %d bank accounts\n", len(bank))
reviews, _ := dummify("reviews", url.Values{"count": {"10"}, "rating": {"5"}})
fmt.Printf("Got %d 5-star reviews\n", len(reviews))
logs, _ := dummify("logs", url.Values{"count": {"50"}, "level": {"ERROR"}})
fmt.Printf("Got %d error logs\n", len(logs))
}WebhooksHMAC-SHA256 · Stripe-compatible
webhook-handler.mjs
// 1. Register an endpoint (requires user session)
const res = await fetch('/api/webhooks/subscriptions', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
url: 'https://your-server.com/webhook',
eventType: 'order.created',
}),
});
const { webhook } = await res.json();
// Save webhook.secret — you'll need it to verify payloads
// Fire a burst of mock events at it (API key auth, counts toward quota)
await fetch(`/api/v1/webhooks/${webhook.id}/fire?count=10&spread=30`, {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
// 2. Verify incoming webhook payloads
import crypto from 'crypto';
function verifyWebhook(secret, rawBody, timestamp, signature) {
const age = Math.abs(Date.now() / 1000 - Number(timestamp));
if (age > 300) throw new Error('Stale timestamp');
const expected = crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(expected, 'hex'),
Buffer.from(signature.replace('v1=', ''), 'hex')
);
}
// 3. Express handler
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const ok = verifyWebhook(
process.env.WEBHOOK_SECRET,
req.body.toString(),
req.headers['x-dummify-timestamp'],
req.headers['x-dummify-signature'],
);
if (!ok) return res.status(401).send('Bad signature');
const event = JSON.parse(req.body);
// event.type → 'order.created'
// event.data → full Order object
console.log(event.type, event.data.id);
res.json({ received: true });
});All endpoints support the same query params
| Param | Type | Description |
|---|---|---|
| count | integer | Number of records (1–100). Default: 5. |
| seed | string | Deterministic seed. Same seed → same data every call. |
| locale | string | /person and /address only. en|fr|de|es|ja|pt|ar|zh |
| platform | string | /social only. twitter|linkedin|mastodon |
| rating | integer | /reviews only. 1–5 star filter |
| level | string | /logs only. DEBUG|INFO|WARN|ERROR filter |
| service | string | /logs only. Filter by service name (e.g. auth-service) |