{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pexafy/json-schema/pexafy-photo-response-schema.json",
  "title": "PhotoResponse",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pexafy-photos-api-openapi.yml#/components/schemas/PhotoResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "$ref": "#/$defs/Photo_2"
    },
    "meta": {
      "$ref": "#/$defs/Meta_2"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ApiError"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "ApiError": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Machine-readable error code (e.g. `MISSING_PARAMS`, `PHOTO_NOT_FOUND`)."
        },
        "message": {
          "type": "string",
          "description": "Human-readable error message."
        },
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "Attribution_2": {
      "type": "object",
      "description": "Ready-to-display credit for the photographer/source.",
      "properties": {
        "html": {
          "type": "string",
          "description": "HTML attribution snippet."
        },
        "plain": {
          "type": "string",
          "description": "Plain-text attribution."
        }
      }
    },
    "Meta_2": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "description": "Unique id for this request (quote it in support tickets)."
        },
        "took_ms": {
          "type": "number",
          "description": "Server processing time in milliseconds."
        }
      }
    },
    "PhotoUrls_2": {
      "type": "object",
      "description": "Ready-to-use image links in five sizes.",
      "properties": {
        "thumb": {
          "type": "string",
          "format": "uri"
        },
        "small": {
          "type": "string",
          "format": "uri"
        },
        "regular": {
          "type": "string",
          "format": "uri"
        },
        "large": {
          "type": "string",
          "format": "uri"
        },
        "full": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "Photo_2": {
      "type": "object",
      "description": "A photo result. Fields returned can be narrowed with the `fields` parameter and may depend on your plan.",
      "properties": {
        "photo_id": {
          "type": "string",
          "description": "Unique Pexafy identifier (UUID)."
        },
        "image_url": {
          "type": "string",
          "format": "uri",
          "description": "Canonical source image URL."
        },
        "urls": {
          "$ref": "#/$defs/PhotoUrls_2"
        },
        "width": {
          "type": [
            "integer",
            "null"
          ]
        },
        "height": {
          "type": [
            "integer",
            "null"
          ]
        },
        "blur_hash": {
          "type": [
            "string",
            "null"
          ],
          "description": "BlurHash placeholder string."
        },
        "orientation": {
          "type": "string",
          "enum": [
            "landscape",
            "portrait",
            "square"
          ]
        },
        "color_name": {
          "type": "string",
          "description": "Dominant color name."
        },
        "color_hex": {
          "type": "string",
          "description": "Dominant color hex code."
        },
        "photographer_username": {
          "type": "string"
        },
        "photographer_full_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "photographer_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "source": {
          "type": "string",
          "description": "Provider (e.g. `Pexels`, `Unsplash`, `Pixabay`)."
        },
        "license_type": {
          "type": "string",
          "description": "License type (e.g. `free`)."
        },
        "source_image_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "URL of the photo's page on the provider."
        },
        "source_description": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "AI-generated caption."
        },
        "alt_description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Accessibility-friendly text."
        },
        "uploaded_on": {
          "type": [
            "string",
            "null"
          ],
          "description": "Publication date (YYYY-MM-DD)."
        },
        "relevance_score": {
          "type": [
            "number",
            "null"
          ],
          "description": "Match score 0–1 (higher is better). Only on search results."
        },
        "attribution": {
          "$ref": "#/$defs/Attribution_2"
        }
      }
    }
  }
}