social template

Tweet Mockup Card API

Send display name, handle, and tweet body as JSON, get back a 1200x800 PNG styled like a tweet card.

Tweet Mockup Card template preview, a social image generated by the HTML to Image API

Marketing teams and presentation builders use the tweet mockup image API to display real customer tweets and quotes in branded artwork rather than embedding the live tweet. The 1200x800 layout reads as familiar but lives on your domain, so the page does not load tracking pixels or stutter on the Twitter widget. You post the display name, handle, body, and optional metrics as JSON, and the response holds a PNG that drops cleanly into a slide deck, newsletter, or blog post.

API reference

View the Tweet Mockup Card API reference

Inputs, defaults, error responses and cURL, PHP, Node and Python code samples.

Read the docs →

Use cases

Marketing teams sharing real tweets in newsletters

Showing real social proof in a newsletter beats writing testimonials yourself. Render the customer's actual tweet (handle, body, timestamp, metrics) as a card, embed in the email body, and the newsletter shows lived feedback rather than corporate prose. The artwork stays consistent across many tweets because the styling is yours, not Twitter's. Halberd Software pulls 6 to 8 customer tweets per month into its weekly newsletter through this template.

Presentations illustrating social proof

Sales decks and conference talks benefit from screenshots of customer tweets, but live screenshots have inconsistent styling and resolution. Render with the actual handle and body, set theme to "light" or "dark" to match your slide template, and every customer quote in the deck looks uniform. Wren Analytics' enterprise sales deck includes 12 customer tweet cards rendered through this exact pattern.

Blog posts quoting tweets without Twitter's embed

The Twitter embed widget loads JavaScript, sets cookies, and slows page load. Render the tweet you want to quote as a static PNG, embed via a regular <img> tag, and the page stays fast and tracker-free. Northwind Studio's tutorial blog uses this for every tweet quoted in long-form content, and the page weight dropped 380 KB on average.

Legal-safe testimonial styling

Some industries (finance, healthcare) require testimonial usage approval before display. Render approved tweets with consistent styling that includes any mandated disclaimers in a footer slot, and the testimonial display stays compliant across every channel where the tweet card appears. Linden & Co's financial services clients run this pattern for tweet-style testimonial pages, and compliance review time dropped from two weeks to two days because the visual treatment is fully repeatable.

Internal recognition cards

HR and people teams collect kind words from peer recognition channels and surface them on internal Slack or town-hall slides. Render with the colleague's name and the message body, and the recognition feels weighted in a way a chat screenshot cannot match. Riverside Bakery recognizes one team member each Friday this way.

Output specifications

Dimensions
1200x800
Color space
sRGB
Transparency
Not supported
File size range
70 KB to 220 KB

Matches the spec at Tweet card visual styling reference.

How it works

1

Send a JSON payload

POST to the template endpoint with the values you want rendered. Authenticate with your API key.

2

We render the image

The template is rendered server-side as a 1200x800 PNG.

3

You get back a URL

Cache it, embed it in your page, attach it to an email.

Quick example

A single cURL call to render a Tweet Mockup Card as a PNG:

curl -X POST https://app.html2img.com/api/v1/templates/tweet-mockup-card \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"display_name":"Jordan Whitfield","handle":"@jwhitfield","body":"shipped a tiny side project this weekend and it already has more users than my last YC company\n\nfunny how that works","avatar_url":"https://i.pravatar.cc/160?img=15","verified":"blue","timestamp":"8:14 AM \u00b7 Apr 30, 2026","replies":"124","retweets":"512","likes":"4.2K","views":"182K","theme":"light"}'

For the full PHP, Node and Python equivalents, plus every input the template accepts, see the Tweet Mockup Card API reference. Setting up your key is covered in the authentication guide.

Common pitfalls

Putting words in real people's mouths

A fabricated quote rendered with a real handle is a legal and ethical problem regardless of intent. Always use this template with content the named author actually posted, or with consenting in-house participants in the case of internal recognition cards.

Live tweet capture is the wrong tool here

For genuine quotes from existing tweets, screenshotting the live tweet via the Screenshot API is more accurate because it captures the actual published timestamp and metrics. Use this template only when you need consistent custom styling across many sources.

Avatar URL fallbacks look generic

A 404 on avatar_url falls back to a placeholder shape that may not match your brand. Validate the avatar URL before posting, or supply a fallback host image that does match your design language so the failure case stays branded.

Inputs at a glance

A quick summary of what the Tweet Mockup Card template accepts. The full reference, with example values and array shapes, is in the docs.

Name Type Required
display_name string Required
handle string Required
body string Required
avatar_url url Optional
verified enum Optional
image_url url Optional
timestamp string Optional
replies string Optional
retweets string Optional
likes string Optional
views string Optional
theme enum Optional

See the full inputs reference for descriptions, examples and validation rules.

Related templates

Other templates in the social media category.

Browse by category

A starting point from each of the other two template categories.

Content and marketing

See the full template gallery for every design grouped by category.

Related guides

FAQ

Try it free

25 renders a month on the free tier. See the pricing page for higher-volume plans.