{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://socialcrawl.dev/schemas/place.json",
  "title": "SocialCrawl Place",
  "description": "Canonical unified place or business object returned by every SocialCrawl endpoint with the Place/PlaceList archetype. Nullability is expressed via JSON Schema 2020-12 type arrays. Generated from the Zod schema in packages/social-api/src/schemas/canonical.ts.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Place ID (Google cid for a business, hotel_identifier for a hotel)"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Business / hotel name"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Website or canonical URL"
    },
    "category": {
      "type": [
        "string",
        "null"
      ],
      "description": "Primary category (e.g. \"Coffee shop\", \"Hotel\")"
    },
    "rating": {
      "type": "object",
      "description": "Aggregate rating (value + max)",
      "properties": {
        "value": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.rating.value"
        },
        "max": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.rating.max"
        }
      }
    },
    "reviews_count": {
      "type": [
        "number",
        "null"
      ],
      "description": "Number of ratings"
    },
    "price_level": {
      "type": [
        "string",
        "null"
      ],
      "description": "Price band (\"inexpensive\" / \"$$\" / null)"
    },
    "address": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at place.address"
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at place.phone"
    },
    "latitude": {
      "type": [
        "number",
        "null"
      ],
      "description": "Numeric at place.latitude"
    },
    "longitude": {
      "type": [
        "number",
        "null"
      ],
      "description": "Numeric at place.longitude"
    },
    "verified": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Claimed-business flag (Google is_claimed)"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at place.description"
    },
    "image_urls": {
      "type": [
        "string",
        "array",
        "null"
      ],
      "description": "Union: string | array | null",
      "items": {
        "type": "string",
        "description": "String at place.image_urls"
      }
    },
    "categories": {
      "type": [
        "array",
        "null"
      ],
      "description": "Array at place.categories",
      "items": {
        "type": "string",
        "description": "String at place.categories"
      }
    },
    "hotel": {
      "type": [
        "object",
        "null"
      ],
      "description": "Hotel-only richness (stars, amenities, review topics, prices); null for plain places",
      "properties": {
        "stars": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.hotel.stars"
        },
        "stars_description": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.hotel.stars_description"
        },
        "check_in_time": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.hotel.check_in_time"
        },
        "check_out_time": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.hotel.check_out_time"
        },
        "amenities": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at place.hotel.amenities",
          "items": {
            "type": "object",
            "description": "Nested object: place.hotel.amenities",
            "properties": {
              "category": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.hotel.amenities.category"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.hotel.amenities.name"
              },
              "available": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Boolean at place.hotel.amenities.available"
              },
              "hint": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.hotel.amenities.hint"
              }
            }
          }
        },
        "review_topics": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at place.hotel.review_topics",
          "items": {
            "type": "object",
            "description": "Nested object: place.hotel.review_topics",
            "properties": {
              "title": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.hotel.review_topics.title"
              },
              "positive_score": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Numeric at place.hotel.review_topics.positive_score"
              },
              "positive_count": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Numeric at place.hotel.review_topics.positive_count"
              },
              "negative_count": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Numeric at place.hotel.review_topics.negative_count"
              },
              "total_count": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Numeric at place.hotel.review_topics.total_count"
              }
            }
          }
        },
        "prices": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at place.hotel.prices",
          "items": {
            "type": "object",
            "description": "Nested object: place.hotel.prices",
            "properties": {
              "title": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.hotel.prices.title"
              },
              "price": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Numeric at place.hotel.prices.price"
              },
              "currency": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.hotel.prices.currency"
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.hotel.prices.url"
              },
              "official_site": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Boolean at place.hotel.prices.official_site"
              }
            }
          }
        }
      }
    },
    "ext": {
      "type": [
        "object",
        "null"
      ],
      "description": "Nested object: place.ext",
      "properties": {
        "distance": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.ext.distance"
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.status"
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.timezone"
        },
        "hours": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at place.ext.hours",
          "items": {
            "type": "object",
            "description": "Nested object: place.ext.hours",
            "properties": {
              "date": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.ext.hours.date"
              },
              "day_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.ext.hours.day_name"
              },
              "is_open": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Boolean at place.ext.hours.is_open"
              },
              "opens_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.ext.hours.opens_at"
              },
              "closes_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.ext.hours.closes_at"
              }
            }
          }
        },
        "place_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.place_id"
        },
        "attributes": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at place.ext.attributes"
        },
        "rating_distribution": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at place.ext.rating_distribution",
          "additionalProperties": {
            "type": "number",
            "description": "Numeric at place.ext.rating_distribution.*"
          }
        },
        "people_also_search": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at place.ext.people_also_search",
          "items": {
            "type": "object",
            "description": "Nested object: place.ext.people_also_search",
            "properties": {
              "cid": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.ext.people_also_search.cid"
              },
              "title": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at place.ext.people_also_search.title"
              },
              "rating": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Nested object: place.ext.people_also_search.rating",
                "properties": {
                  "value": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Numeric at place.ext.people_also_search.rating.value"
                  },
                  "votes_count": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Numeric at place.ext.people_also_search.rating.votes_count"
                  }
                }
              }
            }
          }
        },
        "menu_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.menu_url"
        },
        "domain": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.domain"
        },
        "maps_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.maps_url"
        },
        "rank": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.ext.rank"
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.city"
        },
        "postal_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.postal_code"
        },
        "region": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.region"
        },
        "country_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.country_code"
        },
        "posts_count": {
          "type": [
            "number",
            "null"
          ],
          "description": "`/v1/instagram/location` only: the number of public posts Instagram counts at the place."
        },
        "website": {
          "type": [
            "string",
            "null"
          ],
          "description": "`/v1/instagram/location` only: the venue's own website (`place.url` is its Instagram page)."
        },
        "facebook_places_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "`/v1/instagram/location` only: the Facebook Places id of the same place."
        },
        "business_username": {
          "type": [
            "string",
            "null"
          ],
          "description": "`/v1/instagram/location` only: the username of the Instagram business account linked to the place, or null when none is linked."
        },
        "is_ad": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Boolean at place.ext.is_ad"
        },
        "ad_rank": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.ext.ad_rank"
        },
        "ad_description": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.ad_description"
        },
        "status_description": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.status_description"
        },
        "visitor_reviews_count": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.ext.visitor_reviews_count"
        },
        "blog_reviews_count": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at place.ext.blog_reviews_count"
        },
        "booking_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at place.ext.booking_url"
        },
        "keywords": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at place.ext.keywords",
          "items": {
            "type": "string",
            "description": "String at place.ext.keywords"
          }
        }
      }
    }
  },
  "additionalProperties": true
}
