X (Twitter) · JSON Structure

X Api Place Structure

Place schema from X API v2

Type: object Properties: 8 Required: 2
Social MediaMicrobloggingReal-Time DataStreamingAdvertisingContent

Place is a JSON Structure definition published by X (Twitter), describing 8 properties, of which 2 are required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

contained_within country country_code full_name geo id name place_type

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/twitter/refs/heads/main/json-structure/x-api-place-structure.json",
  "name": "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": "double",
            "minimum": -180,
            "maximum": 180
          },
          "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"
  ]
}