{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prospectapis/json-schema/prospectapis-ad-schema.json",
  "title": "Ad",
  "description": "One ad as its library shows it. A field the library does not show is null, never filled in.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prospectapis-ads-api-openapi.yml#/components/schemas/Ad",
  "type": "object",
  "required": [
    "id",
    "platform",
    "advertiser_name",
    "advertiser_id",
    "advertiser_url",
    "creative_text",
    "media_urls",
    "first_seen",
    "last_seen",
    "countries",
    "landing_url",
    "status",
    "format",
    "source_url",
    "read_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Our id: the platform, a dot, and the library's own id."
    },
    "platform": {
      "type": "string",
      "enum": [
        "meta",
        "google",
        "linkedin",
        "tiktok"
      ]
    },
    "advertiser_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "advertiser_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The library's id for the advertiser (a page id, an advertiser id, a company id). TikTok shows none."
    },
    "advertiser_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "creative_text": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ad's text. Google and TikTok list views show none."
    },
    "media_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "Image and video URLs as the library serves them; some expire."
    },
    "first_seen": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the library says the ad started."
    },
    "last_seen": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the library says the ad was last shown."
    },
    "countries": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "ISO 3166-1 alpha-2 codes, where the library names them (often only on GET /v1/ads/{id})."
    },
    "landing_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "active",
        "inactive",
        null
      ],
      "description": "Meta states it; for Google it is active when last shown within 2 days of the read; LinkedIn and TikTok state none."
    },
    "format": {
      "type": [
        "string",
        "null"
      ]
    },
    "source_url": {
      "type": "string",
      "format": "uri",
      "description": "The ad on its public library page."
    },
    "read_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When we read it from the library."
    }
  }
}