Reputation: 11990
I have a real estate website which displays real estate properties for sale. For each page where a property is listed, I want to create JSON-LD code to display information about the property, using Schema.org.
I am not sure if there is a better type to use than Product
for real estate listings here.
How can I add a custom attribute to describe the property?
Here is a JSON-LD structure for Product
:
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "address of the property ",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"description": "description about the houese"
}
}
I want to be able to add other info like
Primary Features
Interior Features
Exterior Features
How can I add these custom attribute that describes the property using Schema.org?
Upvotes: 2
Views: 768
Reputation: 96607
If you want to provide data about real estate, you need to use a type that represents real estate. Probably Accommodation
(Apartment
, House
, …) for your case.
If you want to convey that this real estate is a product, you need to provide the Product
type in addition to the Accommodation
type.
Then you can use properties from Accommodation
as well as Product
.
{
"@context": "https://schema.org/",
"@type": ["House", "Product"],
"offers": {
"@type": "Offer"
},
"numberOfRooms": 4
}
Custom properties about the real estate can be added with the additionalProperty
property, and, if applicable, with the amenityFeature
property.
Upvotes: 4