{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/upspring-ai/json-schema/upspring-ai-advertiser-by-domain-response-schema.json",
  "title": "AdvertiserByDomainResponse",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/upspring-ai-openapi.json#/components/schemas/AdvertiserByDomainResponse",
  "type": "object",
  "properties": {
    "data": {
      "anyOf": [
        {
          "$ref": "#/$defs/AdvertiserDetail"
        },
        {
          "$ref": "#/$defs/AdvertiserUnavailable"
        },
        {
          "$ref": "#/$defs/AdvertiserPendingStub"
        }
      ]
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false,
  "$defs": {
    "AdvertiserDetail": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "vertical": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "label"
          ],
          "additionalProperties": false
        },
        "category": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "label"
          ],
          "additionalProperties": false
        },
        "summary": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "one_line": {
              "type": [
                "string",
                "null"
              ]
            },
            "short_summary": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "one_line",
            "short_summary"
          ],
          "additionalProperties": false
        },
        "enrichment": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "spend": {
              "type": "object",
              "properties": {
                "grade": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "D",
                    "C",
                    "B",
                    "A",
                    "A+"
                  ]
                },
                "floor": {
                  "type": "string"
                },
                "estimated": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "grade"
              ],
              "additionalProperties": false
            },
            "traffic": {
              "type": "object",
              "properties": {
                "grade": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "D",
                    "C",
                    "B",
                    "A",
                    "A+"
                  ]
                },
                "floor": {
                  "type": "string"
                },
                "estimated": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "grade"
              ],
              "additionalProperties": false
            },
            "sales": {
              "type": "object",
              "properties": {
                "grade": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "D",
                    "C",
                    "B",
                    "A",
                    "A+"
                  ]
                },
                "floor": {
                  "type": "string"
                },
                "estimated": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                },
                "note": {
                  "type": "string"
                }
              },
              "required": [
                "grade"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "spend",
            "traffic",
            "sales"
          ],
          "additionalProperties": false
        },
        "social": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "fb_followers": {
              "type": [
                "number",
                "null"
              ]
            },
            "ig_followers": {
              "type": [
                "number",
                "null"
              ]
            },
            "active_ads": {
              "type": [
                "number",
                "null"
              ]
            },
            "as_of": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "fb_followers",
            "ig_followers",
            "active_ads",
            "as_of"
          ],
          "additionalProperties": false
        },
        "reddit": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "summary": {
              "type": [
                "string",
                "null"
              ]
            },
            "sentiment": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "positive",
                "mixed",
                "negative"
              ]
            },
            "sentiment_note": {
              "type": [
                "string",
                "null"
              ]
            },
            "themes": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "praise",
                      "complaint",
                      "discussion"
                    ]
                  },
                  "detail": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "kind",
                  "detail"
                ],
                "additionalProperties": false
              }
            },
            "fetched_at": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "summary",
            "sentiment",
            "sentiment_note",
            "themes",
            "fetched_at"
          ],
          "additionalProperties": false
        },
        "signals": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "personas": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "share": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "label",
                  "share"
                ],
                "additionalProperties": false
              }
            },
            "mechanisms": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "share": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "label",
                  "share"
                ],
                "additionalProperties": false
              }
            },
            "hooks": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "share": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "label",
                  "share"
                ],
                "additionalProperties": false
              }
            },
            "media_mix": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "share": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "label",
                  "share"
                ],
                "additionalProperties": false
              }
            },
            "funnel": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "share": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "label",
                  "share"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "personas",
            "mechanisms",
            "hooks",
            "media_mix",
            "funnel"
          ],
          "additionalProperties": false
        },
        "hook_themes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "example_hooks": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "name",
              "description",
              "example_hooks"
            ],
            "additionalProperties": false
          }
        },
        "top_ads": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "one_line": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "media_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "is_active": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "one_line",
              "media_type",
              "is_active"
            ],
            "additionalProperties": false
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "ready",
            "unavailable"
          ]
        },
        "refetch_after": {
          "type": "number"
        }
      },
      "required": [
        "id",
        "name",
        "vertical",
        "category",
        "summary",
        "enrichment",
        "social",
        "reddit",
        "signals",
        "hook_themes",
        "top_ads"
      ],
      "additionalProperties": false
    },
    "AdvertiserPendingStub": {
      "type": "object",
      "properties": {
        "domain": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending"
          ]
        },
        "refetch_after": {
          "type": "number",
          "description": "Seconds to wait before calling again with the same domain."
        }
      },
      "required": [
        "domain",
        "status",
        "refetch_after"
      ],
      "additionalProperties": false
    },
    "AdvertiserUnavailable": {
      "type": "object",
      "properties": {
        "domain": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "unavailable"
          ]
        }
      },
      "required": [
        "domain",
        "status"
      ],
      "additionalProperties": false
    }
  }
}