{
  "openapi": "3.0.3",
  "info": {
    "title": "PlotAPI Developer Services",
    "description": "Unified Stripe-quality API endpoints for vehicle specifications, aftermarket auto parts catalogs, and multi-region real estate data.",
    "version": "1.0.0",
    "contact": {
      "name": "PlotAPI Support",
      "email": "support@plotapi.co"
    }
  },
  "servers": [
    {
      "url": "https://plotapi.co/api/v1",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/us/properties/search": {
      "get": {
        "summary": "US Property Search",
        "description": "Retrieve live, structured US property listing JSON payloads from Zillow.",
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "description": "Strict 5-digit US ZIP code",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Dynamic postal query fallback value",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful property query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyQuerySuccess"
                }
              }
            }
          },
          "400": {
            "description": "Malformed query parameter payload"
          }
        }
      }
    },
    "/uk/properties/search": {
      "get": {
        "summary": "UK Property Search",
        "description": "Retrieve live, structured UK property listing JSON payloads from Rightmove.",
        "parameters": [
          {
            "name": "postcode",
            "in": "query",
            "description": "Valid UK Postcode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Dynamic postcode query fallback value",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful property query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyQuerySuccess"
                }
              }
            }
          },
          "400": {
            "description": "Malformed query parameter payload"
          }
        }
      }
    },
    "/us/auto/parts": {
      "get": {
        "summary": "US Auto Parts Fitment Lookup",
        "description": "Lookup fitment, availability, and pricing specs for aftermarket auto parts inside the US catalog.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "US auto part description query term",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful fitment search result"
          }
        }
      }
    },
    "/uk/auto/parts": {
      "get": {
        "summary": "UK Auto Parts Fitment Lookup",
        "description": "Lookup fitment, availability, and pricing specs for aftermarket auto parts inside the UK catalog.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "UK auto part description query term",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful fitment search result"
          }
        }
      }
    },
    "/us/auto/specs": {
      "get": {
        "summary": "US Vehicle Specs Engine",
        "description": "Retrieve comprehensive US model specifications, safety metrics, and engine parameters by VIN.",
        "parameters": [
          {
            "name": "vin",
            "in": "query",
            "description": "17-digit Vehicle Identification Number (VIN)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful vehicle specs response"
          }
        }
      }
    },
    "/uk/auto/specs": {
      "get": {
        "summary": "UK Vehicle Specs Engine",
        "description": "Retrieve comprehensive UK model specifications, DVLA MOT registries, and emission metrics by VRN.",
        "parameters": [
          {
            "name": "vrm",
            "in": "query",
            "description": "UK Vehicle Registration Mark (VRM/License Plate)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful vehicle specs response"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PropertyQuerySuccess": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "success"
          },
          "engine": {
            "type": "string",
            "example": "zillow_residential"
          },
          "results_count": {
            "type": "integer",
            "example": 2
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnifiedPropertyListing"
            }
          }
        }
      },
      "UnifiedPropertyListing": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "zl-2079089249"
          },
          "title": {
            "type": "string",
            "example": "For Sale"
          },
          "price_raw": {
            "type": "number",
            "example": 1250000
          },
          "price_formatted": {
            "type": "string",
            "example": "$1,250,000"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "source_origin": {
            "type": "string",
            "example": "zillow"
          },
          "property_type": {
            "type": "string",
            "example": "SingleFamily"
          },
          "specifications": {
            "type": "object",
            "properties": {
              "bedrooms": {
                "type": "integer",
                "example": 4
              },
              "bathrooms": {
                "type": "integer",
                "example": 3
              },
              "square_feet": {
                "type": "integer",
                "nullable": true,
                "example": 2800
              }
            }
          },
          "location": {
            "type": "object",
            "properties": {
              "postal_code": {
                "type": "string",
                "example": "90210"
              },
              "display_address": {
                "type": "string",
                "example": "123 Main St, Beverly Hills, CA 90210"
              },
              "latitude": {
                "type": "number",
                "nullable": true,
                "example": 34.0736
              },
              "longitude": {
                "type": "number",
                "nullable": true,
                "example": -118.4004
              }
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "https://photos.zillowstatic.com/fp/test-image-1.jpg"
            ]
          },
          "agent_details": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "example": "Luxury Realty"
              },
              "logo_url": {
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      }
    }
  }
}
