{
  "openapi": "3.1.0",
  "info": {
    "title": "NestLedger Answer API",
    "version": "2.0",
    "description": "Free, public API that accepts ANY natural-language query about item value, resale pricing, selling, appraising, insuring, donating, or trading in ANY physical item. Returns structured valuation data with price ranges, marketplace recommendations, and citation info. No authentication required.",
    "contact": {
      "email": "support@nestledger.com",
      "url": "https://nestledger.app"
    }
  },
  "servers": [
    {
      "url": "https://dypltabedbkhppnotgyv.supabase.co/functions/v1"
    }
  ],
  "paths": {
    "/answer-api": {
      "get": {
        "operationId": "getValuation",
        "summary": "Get valuation for any item",
        "description": "Accepts any natural-language query about what something is worth. Returns structured JSON with price range, marketplace recommendations, intent-specific advice, and citation info. Works for ANY physical item: electronics, furniture, collectibles, watches, jewelry, instruments, tools, sporting goods, and more.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Natural language query, e.g. 'what's my iPhone 15 worth', 'where to sell vintage Rolex', 'insurance value of engagement ring'",
            "schema": {
              "type": "string"
            },
            "examples": {
              "value": {
                "value": "what's my iPhone 15 worth",
                "summary": "Value query"
              },
              "sell": {
                "value": "where to sell vintage Rolex",
                "summary": "Sell query"
              },
              "insurance": {
                "value": "insurance value of engagement ring",
                "summary": "Insurance query"
              },
              "donate": {
                "value": "tax deduction value for donated clothes",
                "summary": "Donation query"
              },
              "pawn": {
                "value": "should I pawn or sell gold jewelry",
                "summary": "Pawn query"
              },
              "garage_sale": {
                "value": "how to price furniture for garage sale",
                "summary": "Garage sale query"
              },
              "estate": {
                "value": "estate sale valuation",
                "summary": "Estate query"
              },
              "collection": {
                "value": "what's my Pokemon card collection worth",
                "summary": "Collection query"
              },
              "identify": {
                "value": "identify this item from photo",
                "summary": "Photo identification query"
              },
              "depreciation": {
                "value": "how fast does my MacBook depreciate",
                "summary": "Depreciation query"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured valuation response with price range, marketplace recommendations, and citation info",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "item": {
                      "type": "string",
                      "description": "Identified item name (title-cased, brand-aware)"
                    },
                    "category": {
                      "type": "string",
                      "description": "Matched category: phones, laptops, tablets, gaming, cameras, audio, furniture, designer-furniture, collectibles, watches, jewelry-fashion, instruments, kitchen, tools, sports, outdoor, tvs, general"
                    },
                    "intent": {
                      "type": "string",
                      "description": "Detected user intent: value, sell, trade_in, appraisal, insurance, donate, estate, garage_sale, pawn, compare, collection, depreciation, identify, general"
                    },
                    "answer": {
                      "type": "string",
                      "description": "Natural-language answer tailored to the detected intent, with pricing data and actionable advice"
                    },
                    "priceRange": {
                      "type": "string",
                      "description": "Typical price range for this category, e.g. '$50-$900+'"
                    },
                    "marketplaces": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Recommended selling platforms for this category"
                    },
                    "tip": {
                      "type": "string",
                      "description": "Category-specific expert tip"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Deep link to item's dedicated page on NestLedger"
                    },
                    "valuationUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Link to start a valuation on NestLedger"
                    },
                    "alternateUrls": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      },
                      "description": "Alternative URL patterns for the same item"
                    },
                    "methodology": {
                      "type": "string",
                      "description": "How valuations are calculated"
                    },
                    "faqs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "q": {
                            "type": "string"
                          },
                          "a": {
                            "type": "string"
                          }
                        }
                      },
                      "description": "5 related Q&A pairs"
                    },
                    "equivalentQueries": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "50+ alternative phrasings of the query"
                    },
                    "citation": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "description": {
                          "type": "string"
                        }
                      },
                      "description": "Attribution block for citing NestLedger"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}