---
title: "LinkedIn Post Image API: 1200x627 Cards from JSON"
description: "Render feed cards with the LinkedIn post image API. Send title, eyebrow, and author block as JSON, get back a 1200x627 PNG sized to LinkedIn's spec."
url: "https://html2img.com/templates/linkedin-post/"
---

# Linkedin Post Image Generator API

Send post title and author details as JSON, get back a 1200x627 PNG ready for the LinkedIn feed.

B2B SaaS marketing teams and thought leaders use the LinkedIn post image API to attach share cards to long-form posts and case studies. The 1200x627 size matches LinkedIn's documented dimensions for feed share images, which differ subtly from Facebook's 1200x630. You post the title, eyebrow text, optional author block, and brand inputs as JSON, and the response holds a PNG ready to attach to a feed post or schedule via your LinkedIn ads tooling.

## At a glance

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

## Fields

| Field | Type | Required | Example |
| --- | --- | --- | --- |
| `title` | string | Yes | Five lessons from scaling a B2B SaaS to $10M ARR |
| `subtitle` | string | No | What I would have done differently in years one through three. |
| `eyebrow` | string | No | GROWTH PLAYBOOK |
| `author_name` | string | No | Priya Natarajan |
| `author_role` | string | No | CEO, Northwind Labs |
| `author_avatar_url` | url | No | https://i.pravatar.cc/160?img=47 |
| `logo_url` | url | No |  |
| `background_color` | string | No | #FFFFFF |
| `accent_color` | string | No | #0A66C2 |

## Defaults

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

## Example request

```bash
curl -X POST https://app.html2img.com/api/v1/templates/linkedin-post \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Five lessons from scaling a B2B SaaS to $10M ARR","subtitle":"What I would have done differently in years one through three.","eyebrow":"GROWTH PLAYBOOK","author_name":"Priya Natarajan","author_role":"CEO, Northwind Labs","author_avatar_url":"https://i.pravatar.cc/160?img=47","background_color":"#FFFFFF","accent_color":"#0A66C2"}'
```

## 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/linkedin-post', ['title' => 'Five lessons from scaling a B2B SaaS to $10M ARR', 'subtitle' => 'What I would have done differently in years one through three.', 'eyebrow' => 'GROWTH PLAYBOOK', 'author_name' => 'Priya Natarajan', 'author_role' => 'CEO, Northwind Labs', 'author_avatar_url' => 'https://i.pravatar.cc/160?img=47', 'background_color' => '#FFFFFF', 'accent_color' => '#0A66C2']);

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

### Node.js

```javascript
const response = await fetch('https://app.html2img.com/api/v1/templates/linkedin-post', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "title": "Five lessons from scaling a B2B SaaS to $10M ARR",
    "subtitle": "What I would have done differently in years one through three.",
    "eyebrow": "GROWTH PLAYBOOK",
    "author_name": "Priya Natarajan",
    "author_role": "CEO, Northwind Labs",
    "author_avatar_url": "https://i.pravatar.cc/160?img=47",
    "background_color": "#FFFFFF",
    "accent_color": "#0A66C2"
}),
});

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

### Python

```python
import requests

response = requests.post(
    'https://app.html2img.com/api/v1/templates/linkedin-post',
    headers={'X-API-Key': 'YOUR_API_KEY'},
    json={'title': 'Five lessons from scaling a B2B SaaS to $10M ARR', 'subtitle': 'What I would have done differently in years one through three.', 'eyebrow': 'GROWTH PLAYBOOK', 'author_name': 'Priya Natarajan', 'author_role': 'CEO, Northwind Labs', 'author_avatar_url': 'https://i.pravatar.cc/160?img=47', 'background_color': '#FFFFFF', 'accent_color': '#0A66C2'},
)

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

## What it is for

### B2B SaaS sharing case studies

Case study posts perform better with custom artwork than with the default link unfurl. Render with the case study client name, the headline metric ("3x faster onboarding", "70 percent cost reduction"), and your accent_color, then attach to the LinkedIn post that links to the case study page. Halberd Software publishes 4 case study posts per quarter through this flow, and click-throughs to the case study page run roughly 2.5x the rate of plain link posts.

### Agencies publishing client wins

Agencies that highlight client outcomes on LinkedIn benefit from per-client cards with the client logo and the headline result. Render with the client name, the win metric, and a small attribution mark, post on behalf of the agency or the client, and the agency feed reads as a portfolio of measurable outcomes. Wren Analytics' agency arm posts 12 client wins per month through this template.

### Recruiters posting roles

Talent teams posting open roles benefit from cards that go beyond the LinkedIn job listing format. Render with the role title, the team, the location, and a CTA to apply, attach to the recruiter's post, and the role gets visibility in the connection feed without requiring readers to click through to a job board. Linden & Co posts 8 roles per month through this template.

### Thought leaders sharing essay artwork

Long-form essay writers on LinkedIn benefit from a hero card per essay, similar to how a magazine treats a feature. Render with the essay title, the author photo, and a small magazine-style label ("Essay", "Op-ed", "Analysis"), attach to the post, and the essay reads as published rather than as a casual update. Northwind Studio's founder publishes one essay per month through this format.

### Conferences promoting speakers

Event organizers running B2B conferences publish speaker announcements on LinkedIn in the lead-up to the event. Render a card per speaker with their name, role, talk title, and event date, attach to the announcement post, and the campaign reads as one structured speaker reveal. The Type Conference uses this for 28 speaker reveals across the 8-week pre-event campaign.

## Output

- **Dimensions:** 1200x627
- **Colour space:** sRGB
- **Transparency:** Not supported
- **Typical file size:** 60 KB to 200 KB
- **Platform specification:** [LinkedIn share image dimensions](https://www.linkedin.com/help/linkedin/answer/a565068)

## Common mistakes

### Mixing 627 and 630 across templates

LinkedIn documents 1200x627 while Facebook documents 1200x630, so a single design at 1200x630 will get a 3-pixel rounding shift when LinkedIn re-encodes. Render at 1200x627 specifically for LinkedIn, and at 1200x630 for OG tags on the destination page.

### Company page and personal post crops differ on mobile

Company page posts and personal posts use slightly different mobile crops in the LinkedIn app. Keep the focal area centered both vertically and horizontally so both surfaces show the headline. Test in the LinkedIn mobile app before scheduling a paid campaign.

### Document carousels need a different format

LinkedIn document carousels use 1920x1080 PDFs rather than images. This template only handles single-image posts. For carousels, render each slide separately and assemble a PDF with a tool like ImageMagick or pdfkit on your side.

## Questions

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

Use 1200x627 for feed share images and 1080x1080 for square posts. The LinkedIn docs specify 627, not 630, which differs from Facebook by 3 pixels. This template uses the documented 627 height.

### Does it work for company pages?

Yes, both company page and personal post share images use the same 1200x627 dimensions. The renderer does not differentiate between them, so the same template serves both surfaces. Apply your company branding via accent_color and logo_url.

### What about LinkedIn document carousels?

Carousels use 1920x1080 PDFs rather than images, so this template is not the right tool. Render each carousel slide separately at 1920x1080, then assemble the PDF with a tool like pdfkit or ImageMagick on your side, then upload as a document post.

### Can I include hashtags on the image?

Hashtags belong in the post text rather than on the image. LinkedIn parses hashtags from the body for discoverability and topic association. Use the image purely for visual identity and put hashtags in the post composer.

### Will it work for ads?

Yes, 1200x627 fits LinkedIn Sponsored Content placements. The same render serves organic posts and paid campaigns, so you do not need separate creative for each. Test ad performance with at least three accent_color variants to find the highest CTR card.

### What is the file size limit?

LinkedIn caps post images at 10 MB. Default-DPI renders from this template land between 60 KB and 200 KB, well below the cap. Higher-DPI renders for retina displays can reach 1 MB but stay comfortable. Compliance teams archiving social creative can add format: "pdf" to receive the same artwork as an A4 document.

## Preview

![Linkedin Post Image Generator API example render](https://i.html2img.com/image-1777560098562-117894.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)
