{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/memestack-ai/json-schema/memestack-ai-tenor-result-schema.json",
  "title": "TenorResult",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/memestack-ai-openapi.json#/components/schemas/TenorResult",
  "type": "object",
  "required": [
    "id",
    "media_formats",
    "flags"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string"
    },
    "content_description": {
      "type": "string"
    },
    "created": {
      "type": "number",
      "description": "Unix seconds."
    },
    "itemurl": {
      "type": "string",
      "format": "uri"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "flags": {
      "type": "string",
      "enum": [
        "static"
      ]
    },
    "hasaudio": {
      "type": "boolean"
    },
    "hascaption": {
      "type": "boolean"
    },
    "bg_color": {
      "type": "string"
    },
    "media_formats": {
      "type": "object",
      "description": "Keys: gif, mediumgif, tinygif, nanogif, preview, and one of png / jpg / webp. Filtered by media_filter. tinygif, nanogif and preview link the thumbnail at ?w=384 (about 384 px wide); the others are full size.",
      "additionalProperties": {
        "$ref": "#/$defs/TenorMediaObject"
      }
    },
    "memestack": {
      "type": "object",
      "description": "MemeStack extensions: caption, alt_text, ocr_text, width, height, mime_type, match (strong|closest|null), controversial, ai_generated, meme_template, source_url (https only), page_url, attribution {text, url}, rights (what you may do with the image), chart (chart facts, when known), similarity (reverse search).",
      "additionalProperties": true,
      "properties": {
        "match": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "strong",
            "closest",
            null
          ],
          "description": "strong = evidence the image answers the query; closest = the nearest miss, served after the strong ones; null when the answer carries no labels (featured, posts, reverse search)."
        },
        "rights": {
          "$ref": "#/$defs/ImageRights"
        }
      }
    }
  },
  "$defs": {
    "ImageRights": {
      "type": "object",
      "description": "What an integrator may do with an image, from what MemeStack truly knows — `unknown` wherever it knows nothing, never a guess. `publisher` = imported from a licence-clean publisher (Our World in Data, USDA ERS, Eurostat, EEA; `publisher_only=true` returns only these); `creator` = a Verified Creator's own upload (all rights reserved); `community` = everything else — uploads (including the operators' own uploads of other people's memes and charts), Telegram, X and 4chan saves, Imgflip templates, AI-generated and agent-submitted images: MemeStack grants no licence to them. Commercial use is `yes` only for USDA ERS, Eurostat and EEA charts, whose importer admits only the publisher's own material; Our World in Data is `unknown` because a chart may plot third-party data under its own terms (some non-commercial).",
      "required": [
        "source",
        "publisher",
        "license",
        "license_name",
        "license_url",
        "attribution",
        "attribution_required",
        "commercial_use",
        "note"
      ],
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "publisher",
            "creator",
            "community"
          ]
        },
        "publisher": {
          "type": [
            "object",
            "null"
          ],
          "description": "The publisher of a `publisher` image; null otherwise.",
          "properties": {
            "key": {
              "type": "string",
              "enum": [
                "owid",
                "usda_ers",
                "eurostat",
                "eea"
              ]
            },
            "name": {
              "type": "string"
            }
          }
        },
        "license": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "CC-BY-4.0",
            "US-PD",
            "all-rights-reserved",
            null
          ],
          "description": "Machine id of the licence; `US-PD` = U.S. federal public domain. Null = MemeStack knows of no licence."
        },
        "license_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Human label, e.g. \"CC BY 4.0\"."
        },
        "license_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The licence text, or MemeStack's creator terms for creator work."
        },
        "attribution": {
          "type": "string",
          "description": "The credit line to show beside the image: for a publisher chart the line its licence asks for; otherwise where the image came from, never who owns it."
        },
        "attribution_required": {
          "type": "boolean",
          "description": "True when the licence or the rights holder requires the credit (publisher charts, creator work)."
        },
        "commercial_use": {
          "type": "string",
          "enum": [
            "yes",
            "no",
            "unknown"
          ]
        },
        "note": {
          "type": [
            "string",
            "null"
          ],
          "description": "The one condition or caveat that changes what you may do (e.g. CC BY's notice of MemeStack's changes, or OWID's third-party data), or null."
        }
      }
    },
    "TenorMediaObject": {
      "type": "object",
      "description": "A still image (PNG, JPEG or WebP) — MemeStack serves no GIF or video bytes; every Tenor format key carries a still image.",
      "required": [
        "url",
        "duration"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "dims": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "minItems": 2,
          "maxItems": 2,
          "description": "[width, height] of the bytes the URL serves; omitted when unknown."
        },
        "duration": {
          "type": "number",
          "description": "Always 0 (still images)."
        },
        "size": {
          "type": "integer",
          "description": "Bytes; present only when exact (the URL serves the original upload)."
        }
      }
    }
  }
}