X (Twitter) · Schema

Place

Place schema from X API v2

Social MediaMicrobloggingReal-Time DataStreamingAdvertisingContent

Properties

Name Type Description
contained_within array
country string The full name of the county in which this place exists.
country_code string A two-letter ISO 3166-1 alpha-2 country code.
full_name string The full name of this place.
geo object
id string The identifier for this place.
name string The human readable name of this place.
place_type string
View JSON Schema on GitHub

JSON Schema

x-api-place-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/twitter/refs/heads/main/json-schema/x-api-place-schema.json",
  "title": "Place",
  "description": "Place schema from X API v2",
  "type": "object",
  "properties": {
    "contained_within": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/PlaceId"
      }
    },
    "country": {
      "type": "string",
      "description": "The full name of the county in which this place exists.",
      "example": "United States"
    },
    "country_code": {
      "type": "string",
      "description": "A two-letter ISO 3166-1 alpha-2 country code.",
      "pattern": "^[A-Z]{2}$",
      "example": "US"
    },
    "full_name": {
      "type": "string",
      "description": "The full name of this place.",
      "example": "Lakewood, CO"
    },
    "geo": {
      "type": "object",
      "required": [
        "type",
        "bbox",
        "properties"
      ],
      "properties": {
        "bbox": {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "items": {
            "type": "number",
            "minimum": -180,
            "maximum": 180,
            "format": "double"
          },
          "example": [
            -105.193475,
            39.60973,
            -105.053164,
            39.761974
          ]
        },
        "geometry": {
          "$ref": "#/components/schemas/Point"
        },
        "properties": {
          "type": "object"
        },
        "type": {
          "type": "string",
          "enum": [
            "Feature"
          ]
        }
      }
    },
    "id": {
      "type": "string",
      "description": "The identifier for this place.",
      "example": "f7eb2fa2fea288b1"
    },
    "name": {
      "type": "string",
      "description": "The human readable name of this place.",
      "example": "Lakewood"
    },
    "place_type": {
      "type": "string",
      "enum": [
        "poi",
        "neighborhood",
        "city",
        "admin",
        "country",
        "unknown"
      ],
      "example": "city"
    }
  },
  "required": [
    "id",
    "full_name"
  ]
}