I want to get them just with code. Not with google reviews cause people need to have a google account for that. I've looked on schema.org but i just don't get it.
so how do i get the stars in my snippet
You should use AggregateRating :
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "LocalBusiness",
"name" : "My Company",
"url" : "http://www.mycompany.com/",
"telephone" : "(+33) 1 23 45 67 89",
"email" : "info@mycompany.com",
"address" : {
"@type" : "PostalAddress",
"streetAddress" : "1 Rue de la Place",
"addressLocality" : "Paris",
"postalCode" : "75000"
},
"aggregateRating" : {
"@type" : "AggregateRating",
"ratingValue" : "4.2",
"bestRating" : "5",
"ratingCount" : "100"
},
"openingHours": "Mo-Su 00:00-00:00"
}
</script>
The snippet above should be put just before the ending </html>
tag, and should display a score of 4.2/5 based on 100 ratings
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.