Konvertiert Markdown-Inhalte in ein Bild. Gibt je nach mode-Parameter eine Bild-URL oder Binärdaten zurück.
Bearer-Token erforderlich
Parameter
markdownstringErforderlich- Der Markdown-Inhalt, der in ein Bild konvertiert werden soll
widthnumberStandard: 800- Bildbreite in Pixeln (200-2560)
formatstringStandard: png- Ausgabeformat: png, jpeg, webp oder pdf. Bei pdf wird ein A4-formatiertes PDF-Dokument mit Kopf-/Fusszeile zuruckgegeben
qualitynumberStandard: 2.0- Geräteskalierungsfaktor für das Rendering (1.0-3.0)
themestring- Visuelles Thema für das gerenderte Bild
lightdarknordgithubmonokaisolarized codeStylestring- Syntaxhervorhebungsstil für Codeblöcke
defaultgithubvsxcodeatom-one-lightgooglecode fontFamilystring- Schriftfamilie für den gerenderten Inhalt
sansintermodernarticledocsroboto modestringStandard: url- Antwortmodus: 'url' gibt eine temporäre Bild-URL zurück (24 Stunden gültig), 'binary' gibt rohe Bilddaten zurück. Für dauerhafte Speicherung laden Sie das Bild bitte rechtzeitig herunter
curl -X POST https://markdowntoimage.com/api/v1/images/generate \
-H "Authorization: Bearer mti_your_token" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello\n\n- Item 1\n- Item 2",
"width": 800,
"format": "png",
"theme": "github-dark"
}'Antwort
{
"success": true,
"data": {
"imageUrl": "https://markdowntoimage.com/api-temp/uuid.png",
"imageId": "550e8400-e29b-41d4-a716-446655440000",
"format": "png",
"width": 800
},
"meta": {
"quota": {
"freeRemaining": 48,
"creditBalance": 200,
"usedFreeQuota": true
}
}
}