Most image generation APIs break when you throw Arabic text at them. Diacritics end up in the wrong place, ligatures don't connect, and RTL layout is an afterthought. Mirqam is built Arabic-first — correct shaping, diacritics, and OpenType rendering out of the box.
This guide shows you how to generate personalized Arabic images via the Mirqam API.
Quick Start
1. Get an API Key
Sign up at mirqam.net/sign-up and create an API key from your dashboard. Keys start with ak_... and are passed as Bearer tokens.
You get 100 free credits on signup (1 credit = 5 API renders).
2. Create a Template
Open the template editor and design your card:
- Upload a background image
- Add dynamic text fields (name, title, date, etc.)
- Choose your Arabic fonts and adjust sizing
- Save — you'll get a
template_id
3. Render via API
Send a POST request with your template ID and data:
cURL:
curl -X POST https://app.mirqam.net/v1/render \
-H "Authorization: Bearer ak_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"template_id": "tpl_abc123",
"data": {
"name": "عبدالرحمٰن"
},
"options": {
"format": "png"
}
}'
Python:
import requests
response = requests.post(
"https://app.mirqam.net/v1/render",
headers={"Authorization": "Bearer ak_your_key_here"},
json={
"template_id": "tpl_abc123",
"data": {"name": "عبدالرحمٰن"},
"options": {"format": "png"},
},
)
with open("card.png", "wb") as f:
f.write(response.content)
Node.js:
const response = await fetch("https://app.mirqam.net/v1/render", {
method: "POST",
headers: {
"Authorization": "Bearer ak_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
template_id: "tpl_abc123",
data: { name: "عبدالرحمٰن" },
options: { format: "png" },
}),
});
const buffer = await response.arrayBuffer();
fs.writeFileSync("card.png", Buffer.from(buffer));
The response is the raw image bytes — PNG or JPG, depending on your options.format.
Why Not Use Generic Image APIs?
If you've tried generating Arabic text images with Puppeteer, wkhtmltoimage, or Cloudinary, you've probably hit these problems:
Puppeteer / HTML Screenshots
- Diacritics (tashkeel) often render in the wrong position
- Font fallback chains produce inconsistent results
- Headless Chrome adds overhead and non-determinism
- Memory-hungry for batch processing
Cloudinary Text Overlays
- Limited Arabic font support
- No OpenType shaping for complex ligatures
- Diacritics positioning is unreliable
- No RTL-aware text wrapping
Mirqam's Approach
- Server-side raster rendering — no browser, no DOM
- Arabic-first shaping engine — correct ligatures, diacritics, and RTL
- Deterministic output — same input always produces the same image
- Fast — ~1 second per render
- Custom fonts — upload any TTF/OTF font
Key API Features
| Feature | Details |
|---|---|
| Formats | PNG, JPG (optionally wrapped in PDF) |
| Authentication | Bearer token (ak_...) |
| Dynamic fields | Text and image fields per template |
| Diacritics | Full tashkeel support (fatha, kasra, shadda, etc.) |
| Custom fonts | Upload TTF/OTF via /v1/fonts |
| Batch processing | Loop over names — each render is independent |
| Deterministic | Same data = same output, every time |
Pricing
- 0.2 SAR per image via API (~$0.05 USD)
- 100 free credits on signup (= 500 API renders)
- No subscriptions, no monthly fees
- Pay as you go
Common Use Cases
- HR campaigns: Generate Eid greeting cards for 500+ employees
- E-commerce: Auto-generate thank-you cards with customer names (Salla integration)
- Certificates: Course completion or appreciation certificates
- Invitations: Wedding or event invitations personalized by name
- Marketing: Personalized social media images at scale
Next Steps
- Sign up for free — 100 credits included
- Read the API docs — full endpoint reference
- Try the render playground — test renders in-browser
- Browse AI prompts — prompt templates for LLM integration
Need help integrating? Contact our team for developer support.