---
title: "Facebook Post Image API: 1200x630 Feed Cards from JSON"
description: "Build feed posts with the Facebook post image API. POST title, eyebrow, and CTA copy as JSON, get back a 1200x630 PNG ready for the page or ad placement."
url: "https://html2img.com/templates/facebook-post/"
---

# Facebook Post Image Generator API

Send post title and CTA as JSON, get back a 1200x630 PNG sized for the Facebook feed.

Local businesses, e-commerce stores, and agencies running Facebook pages use the Facebook post image API to ship feed cards without designing each one in Canva. The 1200x630 ratio matches Facebook's feed share image recommendation, and the layout reads cleanly on both desktop and mobile feed views. You post the title, eyebrow, and CTA copy as JSON, and the response holds a PNG ready to attach to a page post, scheduled via Meta Business Suite or the Graph API.

## At a glance

- **Template slug:** `facebook-post`
- **Category:** social
- **Endpoint:** `POST https://app.html2img.com/api/v1/templates/facebook-post`
- **Authentication:** `X-API-Key` header
- **Cost:** one credit per render, PNG or PDF
- **Page:** https://html2img.com/templates/facebook-post/

## Fields

| Field | Type | Required | Example |
| --- | --- | --- | --- |
| `title` | string | Yes | Doors open Saturday — first 50 guests get a free print |
| `subtitle` | string | No | Join us at the studio launch from 11am to 6pm. |
| `eyebrow` | string | No | GRAND OPENING |
| `cta` | string | No | RSVP at studioink.co/launch |
| `logo_url` | url | No |  |
| `background_color` | string | No | #1E3A8A |
| `accent_color` | string | No | #F59E0B |

## Defaults

| Field | Default |
| --- | --- |
| `width` | 1200 |
| `height` | 630 |

## Example request

```bash
curl -X POST https://app.html2img.com/api/v1/templates/facebook-post \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Doors open Saturday \u2014 first 50 guests get a free print","subtitle":"Join us at the studio launch from 11am to 6pm.","eyebrow":"GRAND OPENING","cta":"RSVP at studioink.co/launch","background_color":"#1E3A8A","accent_color":"#F59E0B"}'
```

## In your language

### PHP

```php
<?php
$response = \Illuminate\Support\Facades\Http::withHeaders([
    'X-API-Key' => 'YOUR_API_KEY',
])->post('https://app.html2img.com/api/v1/templates/facebook-post', ['title' => 'Doors open Saturday — first 50 guests get a free print', 'subtitle' => 'Join us at the studio launch from 11am to 6pm.', 'eyebrow' => 'GRAND OPENING', 'cta' => 'RSVP at studioink.co/launch', 'background_color' => '#1E3A8A', 'accent_color' => '#F59E0B']);

$url = $response->json('url');
```

### Node.js

```javascript
const response = await fetch('https://app.html2img.com/api/v1/templates/facebook-post', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "title": "Doors open Saturday \u2014 first 50 guests get a free print",
    "subtitle": "Join us at the studio launch from 11am to 6pm.",
    "eyebrow": "GRAND OPENING",
    "cta": "RSVP at studioink.co/launch",
    "background_color": "#1E3A8A",
    "accent_color": "#F59E0B"
}),
});

const { url } = await response.json();
```

### Python

```python
import requests

response = requests.post(
    'https://app.html2img.com/api/v1/templates/facebook-post',
    headers={'X-API-Key': 'YOUR_API_KEY'},
    json={'title': 'Doors open Saturday — first 50 guests get a free print', 'subtitle': 'Join us at the studio launch from 11am to 6pm.', 'eyebrow': 'GRAND OPENING', 'cta': 'RSVP at studioink.co/launch', 'background_color': '#1E3A8A', 'accent_color': '#F59E0B'},
)

url = response.json()['url']
```

## What it is for

### E-commerce stores producing per-product feed images

Shopify and WooCommerce stores that promote individual products on Facebook benefit from per-SKU images rather than a stock store banner. Loop through your featured products, render a card for each with the product name and CTA, and queue the posts in Meta Business Suite. Riverside Bakery promotes 4 products per week through this flow, and each post performs better than the previous era of sharing the storefront photo with a generic caption.

### News outlets sharing articles to a Facebook page

Local news pages benefit from a clean editorial card per article in addition to the link unfurl. Render with the headline, byline, and section badge, attach to the page post, and the result reads as published journalism rather than a personal share. Northwind Weekly uses this for 12 articles per week and the engagement on the page has roughly doubled since the rollout.

### Event pages promoting upcoming dates

Community pages and venues promoting events publish reminder cards in the lead-up to each date. Render with the event title, the date, and a CTA to RSVP, schedule across the campaign window, and attendance climbs because supporters see the event multiple times before committing. The Type Conference posts 8 reminder cards across the 6 weeks before the event.

### Agencies running organic content for clients

Agencies managing 12+ client pages need a system that produces brand-consistent posts at scale. Use this endpoint with per-client accent colors, logos, and fonts, and the agency can ship a week's worth of posts for every client in a single afternoon. Halberd Software's social agency arm publishes 240 posts per week for 18 clients via this pipeline.

### Local businesses sharing offers

Coffee shops, salons, and small retailers can post offer cards without booking a designer for each promotion. Render with the offer headline, expiry, and CTA, attach to the page post, and the card carries enough information that interested customers can act without needing to message the page. Linden & Co's clients run promotions monthly through this flow.

## Output

- **Dimensions:** 1200x630
- **Colour space:** sRGB
- **Transparency:** Not supported
- **Typical file size:** 60 KB to 180 KB
- **Platform specification:** [Meta feed share image guidelines](https://www.facebook.com/business/help/103816146375741)

## Common mistakes

### High text density hurts ad delivery

Facebook removed the 20 percent text rule in 2020, but ad-delivery algorithms still favor images with less text. Keep on-image copy concise (under 30 words across title and CTA) so paid distribution stays cost-effective.

### Confusing post-attached images with link share previews

A link share unfurl reads the og:image of the destination URL, not the image attached to the post. For link previews, use the open-graph-image template and set og:image on the destination page, since post-attached images do not appear when a link is shared.

### Mobile and desktop crop slightly differently

Mobile feed crops at the top and bottom while desktop preserves the full 1.91:1. Keep the focal area centered vertically so both crops show the headline and brand mark. Test on both surfaces before scheduling a campaign.

## Questions

### What size should a Facebook post image be?

Use 1200x630 (1.91:1) for feed posts. The 1080x1080 size works for square posts, and 1080x1920 fits Stories. This template renders the 1200x630 size that performs well in the standard feed.

### Is there a 20 percent text rule?

Facebook removed the strict text-to-image rule in 2020. Ad delivery still favors images with less text, so keep on-image copy under 30 words for paid use. Organic posts have more flexibility but readability still matters.

### Should I use this for link share previews?

No, link previews read the og:image meta tag of the linked URL. Use the open-graph-image template for the destination page's share artwork, and reserve this template for images attached directly to a post.

### Will it look right on mobile?

Yes, mobile and desktop both display 1.91:1 in feed, with mobile applying a small top-and-bottom crop. The template centers key content vertically so both crops show the headline. Test before going live with a campaign.

### What is the file size limit?

Facebook supports up to 30 MB but recommends under 8 MB for fast loading. This template renders between 60 KB and 180 KB by default, so the file size never approaches the cap. Teams that file campaign creative as documents can also request format: "pdf" for an A4 copy; the upload to Facebook itself stays a PNG.

### Can I use this for Facebook Ads?

Yes, 1200x630 fits most ad placements including feed, in-stream, and right-column. Ad copy still goes in the post text rather than overlaying the image, so keep on-image text minimal to keep delivery costs low.

## Preview

![Facebook Post Image Generator API example render](https://i.html2img.com/image-1777560096985-710030.png)

## Related templates

- [instagram-square-post](https://html2img.com/templates/instagram-square-post/)
- [open-graph-image](https://html2img.com/templates/open-graph-image/)
- [twitter-post](https://html2img.com/templates/twitter-post/)

## See also

- [Every template](https://html2img.com/templates/)
- [Templates API reference](https://html2img.com/docs/templates/)
- [OpenAPI specification](https://html2img.com/openapi.json)
