{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentionsapi-com/json-schema/mentionsapi-com-mentions-crawl-response-schema.json",
  "title": "MentionsCrawlResponse",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentionsapi-com-openapi.json#/components/schemas/MentionsCrawlResponse",
  "type": "object",
  "required": [
    "request_id",
    "brand",
    "normalized_brand",
    "prompt",
    "mentions",
    "total_mentions_found",
    "providers",
    "usage"
  ],
  "properties": {
    "request_id": {
      "type": "string",
      "format": "uuid"
    },
    "brand": {
      "type": "string"
    },
    "normalized_brand": {
      "type": "string"
    },
    "prompt": {
      "type": "string"
    },
    "mentions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "brand": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "snapshot_at": {
            "type": "string",
            "format": "date-time"
          },
          "rank": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sentiment": {
            "type": [
              "string",
              "null"
            ]
          },
          "context": {
            "type": [
              "string",
              "null"
            ]
          },
          "content_excerpt": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "total_mentions_found": {
      "type": "integer",
      "minimum": 0
    },
    "providers": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/ProviderResult"
          },
          {
            "$ref": "#/$defs/ProviderError"
          }
        ]
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "billable_units": {
          "type": "integer"
        },
        "latency_ms": {
          "type": "integer"
        },
        "cost_cents": {
          "type": "integer"
        }
      }
    }
  },
  "$defs": {
    "Citation": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string"
        },
        "snippet": {
          "type": "string"
        }
      }
    },
    "ProviderError": {
      "type": "object",
      "required": [
        "provider",
        "error"
      ],
      "properties": {
        "provider": {
          "$ref": "#/$defs/ProviderId"
        },
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        }
      }
    },
    "ProviderId": {
      "type": "string",
      "enum": [
        "openai",
        "anthropic",
        "gemini",
        "perplexity"
      ],
      "description": "The LLM provider that produced a result."
    },
    "ProviderResult": {
      "type": "object",
      "required": [
        "provider",
        "model",
        "content",
        "citations",
        "tokens",
        "latency_ms"
      ],
      "properties": {
        "provider": {
          "$ref": "#/$defs/ProviderId"
        },
        "model": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "citations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Citation"
          }
        },
        "tokens": {
          "$ref": "#/$defs/TokenUsage"
        },
        "latency_ms": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "TokenUsage": {
      "type": "object",
      "required": [
        "input",
        "output"
      ],
      "properties": {
        "input": {
          "type": "integer",
          "minimum": 0
        },
        "output": {
          "type": "integer",
          "minimum": 0
        },
        "reasoning": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}