Real Estate Listing template

The real-estate-listing template renders a real-estate image as a PNG. POST a JSON payload to the endpoint below and you receive a CDN URL in the response.

Endpoint

POST https://html2img.com/api/v1/templates/real-estate-listing
X-API-Key: <your-api-key>
Content-Type: application/json

Authentication uses the X-API-Key header. See the authentication docs for details on issuing and rotating keys.

Inputs

The full set of inputs the template accepts:

Name Type Required Description Example
price string Yes Text value for the price. $1,495,000
address string Yes Text value for the address. 482 Maple Ridge Lane
address_secondary string No Text value for the address secondary. Sausalito, CA 94965
beds string No Text value for the beds. 4
baths string No Text value for the baths. 3
sqft string No Text value for the sqft. 2,840
status string No Text value for the status. Just listed
property_image_url url No URL of the property image to include in the rendered image. https://picsum.photos/seed/real-estate/1200/600
agent_name string No Text value for the agent name. Elena Martinez
agent_title string No Text value for the agent title. Senior Listing Agent
agent_phone string No Text value for the agent phone. (415) 555-0142
agent_avatar_url url No URL of the agent avatar to include in the rendered image. https://i.pravatar.cc/160?img=23
brokerage_name string No Text value for the brokerage name. Bay Bridge Realty
logo_url url No URL of the logo to include in the rendered image.
accent_color string No Hex colour code for the accent. #0F172A

Defaults

Defaults applied automatically when not overridden in the request:

Option Default value
width 1200
height 900

Code examples

curl -X POST https://app.html2img.com/api/v1/templates/real-estate-listing \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"price":"$1,495,000","address":"482 Maple Ridge Lane","address_secondary":"Sausalito, CA 94965","beds":"4","baths":"3","sqft":"2,840","status":"Just listed","property_image_url":"https://picsum.photos/seed/real-estate/1200/600","agent_name":"Elena Martinez","agent_title":"Senior Listing Agent","agent_phone":"(415) 555-0142","agent_avatar_url":"https://i.pravatar.cc/160?img=23","brokerage_name":"Bay Bridge Realty","accent_color":"#0F172A"}'

Looking for a fuller integration sketch in your language? The usage guides cover PHP, Laravel, Rails, Python, JavaScript, React and Vue.

Response

A successful render returns:

{
  "success": true,
  "id": "abc123",
  "url": "https://i.html2img.com/abc123.png",
  "credits_remaining": 1234,
  "template": "real-estate-listing"
}

The url field is a CDN URL for the rendered PNG. credits_remaining tracks your monthly quota. Shared response fields are documented in the API parameters reference.

Errors

The template endpoint returns the following error responses:

422 Validation failed

Returned when one or more inputs fail validation. The errors object lists field-specific messages.

{
  "success": false,
  "error": "validation_failed",
  "errors": {
    "title": ["The title field is required."]
  }
}

404 Template not found

Returned with {"code": "template_not_found"} if the slug is not registered. Check the template list for current slugs.

401 Unauthorised

Missing or invalid API key. See the authentication docs.

429 Too many requests

You have hit the rate limit or used your monthly credits. The pricing page covers higher-volume plans.

See the Real Estate Listing template in our gallery for sample renders and use cases.