JSXImage
On this page

Listing images for marketplaces and real estate

A bare photo says little when a listing is shared. A branded image with the photo, price, address and key details says it all at a glance, in link previews, social posts and messages. This guide gives every listing such an image, generated from your listing data and updated when the price or details change.

How it works

  1. A template combines the listing’s photo with its price and details, in your brand.
  2. Each listing page signs a URL with its data, used as the page’s og:image, so every shared link shows the card.
  3. The same URLs go into social posts, newsletters and partner feeds.

Step 1: build the template

Start from the Property listing example in the playground (Templates, then Property listing), or ask your AI assistant through the MCP server.

export const props = {
  price: "$1,285,000",
  address: "48 Alder Street",
  city: "Portland, OR 97209",
  beds: "3",
  baths: "2",
  area: "1,840",
  agent: "Marta Lindqvist",
  agency: "Northgate Realty",
  photo: "https://example.com/listings/48-alder/main.jpg",
};

For a marketplace, the same idea works with other props: item, condition, price, seller rating, location.

  • Photos. The listing photo is fetched from its URL when the image renders. Use a web-sized version (up to about 2000 px wide and well under 10 MB), not the original from the camera.
  • JPEG. Photos compress best as JPEG: format: "jpeg" with quality around 85 keeps the image small.
  • Formatting. Format prices and areas in your data ($1,285,000, 1,840 sq ft, 125 m²), so the image shows them exactly as on your site.
  • Badges. Add props for “New”, “Price reduced” or “Sold” and show them in the template when they are set.

Step 2: an image for every listing

Sign a URL per listing where its page is rendered, and use it as the page’s og:image. The signing function comes from Sign URLs in your code (in the menu next to Create URL), and the Open Graph guide shows the setup, with examples for Astro and Next.js.

const image = await imageUrl({
  price: formatPrice(listing.price),
  address: listing.street,
  city: `${listing.city}, ${listing.postalCode}`,
  beds: String(listing.bedrooms),
  baths: String(listing.bathrooms),
  area: listing.area.toLocaleString("en-US"),
  agent: listing.agent.name,
  agency: "Northgate Realty",
  photo: listing.photos[0].url,
});

When the price drops, the props change, so the page gets a new URL and the image renders once more with the new price. Nothing to regenerate or purge.

Step 3: use it beyond the listing page

  • Social posts. Post new listings with the image URL, or download it from the URL for tools that need a file.
  • Newsletters. Put the listing images in your “new this week” email as <img> tags, see Personalized images in emails.
  • Square and story sizes. For Instagram, render the same listing at 1080 × 1080 or 1080 × 1920 with the render API’s options, or make a template per shape.
  • Agents and sellers. Show the image on the listing’s dashboard with a download button, so agents and sellers share it themselves.

Good to know

  • Quota. Each listing’s URL uses one render the first time it is opened; every share after that is served from the cache. A price change is one more render.
  • Sold listings. Set a status prop to “Sold” and the image changes with it, wherever it is shown.
  • Photos must stay online. The photo is fetched when the image renders. If a photo URL stops working, a new render of that listing fails; images already rendered keep working.

Questions? See the docs or email info@jsximage.com.