Free API

Generate HeadlineShot cards from your own project with a single GET request. The API extracts the article metadata and returns the rendered PNG in one call — no account, no API key. Use it directly as an image source in Next.js, plain HTML, or any stack.

Endpoint

GET https://headlineshot.press/api/card?url=<article-url>

Returns image/png with CORS enabled (access-control-allow-origin: *). Responses are cached for one hour at the edge, so repeated embeds of the same card are fast.

Quick start

Plain HTML — the image renders without touching this site:

<img
  src="https://headlineshot.press/api/card?url=https://example.com/article"
  alt="Article headline card"
  width="1080"
  height="1080"
/>

Next.js with next/image:

import Image from "next/image";

export function ArticleCard({ articleUrl }: { articleUrl: string }) {
  const src = `https://headlineshot.press/api/card?url=${encodeURIComponent(articleUrl)}&template=newspaper&theme=light`;
  return <Image src={src} alt="Article card" width={1080} height={1080} />;
}

// next.config.ts — allow the remote host:
// images: {
//   remotePatterns: [{ protocol: "https", hostname: "headlineshot.press" }],
// }

Server-side, fetching the PNG bytes (Node, route handlers, cron jobs):

const response = await fetch(
  "https://headlineshot.press/api/card?url=" + encodeURIComponent(articleUrl),
);
if (!response.ok) {
  const { error } = await response.json();
  throw new Error(error.message);
}
const png = Buffer.from(await response.arrayBuffer());

Parameters

Every parameter except url is optional. The defaults match the editor: dark editorial square card with the photo, author, date, domain, and publication logo visible.

ParamValuesDefaultDescription
urlhttp(s) article URLrequiredThe article to turn into a card.
templateeditorial | newspapereditorialCard layout.
ratiolandscape | wide | square | portrait | story | pinsquareCanvas format. story reserves Instagram safe zones.
themelight | darkdarkCard color scheme.
alignleft | centerleftText alignment.
image, author, date, domain, logo1 | 01Show or hide each card element.
logoSize, headlineSize, publicationSize, sectionSize, authorSize, metaSizesmall | medium | largemediumSize of each element.
backgroundbg1 | bg2 | bg3 | bg4noneDecorative background behind a smaller inset card.
cardStylesolid | glasssolidCard fill when a background is active.
glasslight | medium | strongmediumFrosted-glass strength when cardStyle=glass.
bw1 | 00Convert the article photo to black and white.
grainlight | medium | strongoffFilm-grain overlay on the photo.
duotone1 | 00Map the photo to two custom colors.
duotoneShadow, duotoneHighlight6-digit hex (with or without #)0f172a / f97316Duotone shadow and highlight colors.

Example with options

https://headlineshot.press/api/card
  ?url=https://example.com/article
  &template=editorial
  &ratio=story
  &theme=dark
  &background=bg2
  &cardStyle=glass
  &bw=1
  &grain=medium

Errors

Failures return JSON with an error code and message:

{ "error": { "code": "INVALID_URL", "message": "That does not look like a valid article URL." } }

Rate limits and fair use

The API is free and requires no key. Requests are limited per IP (currently 30 cards per hour) to keep the service available for everyone. Cache the generated PNGs on your side when possible — responses include cache headers to help. Attribution is appreciated but not required.

Advanced: split endpoints

If you need more control (for example, editing the headline before rendering), the underlying endpoints are also available: POST /api/extract with { "url": "..." } returns the extracted article as JSON, and POST /api/render accepts the full article and design payload and returns the PNG.