{
  "openapi": "3.0.1",
  "info": {
    "title": "eBay Sold Comps — Median & Analytics Summary",
    "description": "eBay sold comps + sold-price analytics summary: median/avg/p10/p90, compScore, buyBelow, comps-summary dataset row, optional Discord/CRM deal-alert. Demo mode included.",
    "version": "1.0",
    "x-build-id": "HVrVXJJjdfypkf92L"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/intelscrape~ebay-sold-comps-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-intelscrape-ebay-sold-comps-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/intelscrape~ebay-sold-comps-scraper/runs": {
      "post": {
        "operationId": "runs-sync-intelscrape-ebay-sold-comps-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/intelscrape~ebay-sold-comps-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-intelscrape-ebay-sold-comps-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "eBay search keywords for sold comps (e.g. iPhone 14 Pro 128GB). Optional if queries[] or startUrls is provided. Kept for backward compatibility."
          },
          "queries": {
            "title": "Search queries (multi)",
            "type": "array",
            "description": "Optional array of search keywords (one sold search per entry). Merged with searchQuery. Use this for multi-SKU comps in one run (xtracto queries / tagadanar search parity).",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional eBay search-result URLs to scrape. Each URL is forced into sold+completed mode (LH_Sold=1&LH_Complete=1). Use for advanced browser-built filters. NOT for /itm/ product-detail pages.",
            "items": {
              "type": "string"
            }
          },
          "ebaySite": {
            "title": "eBay marketplace",
            "enum": [
              "US",
              "UK",
              "DE",
              "AU",
              "CA",
              "FR",
              "IT",
              "ES"
            ],
            "type": "string",
            "description": "eBay site for sold search (US/UK/DE/AU/CA/FR/IT/ES). Aliases: marketplace, eBaySite. Also accepts host forms like ebay.co.uk / www.ebay.de.",
            "default": "US"
          },
          "marketplace": {
            "title": "Marketplace alias",
            "type": "string",
            "description": "Optional alias for ebaySite (khadinakbar-style). Accepts US/UK/... or host forms (ebay.com, ebay.co.uk, …). Overrides ebaySite when set."
          },
          "listingType": {
            "title": "Listing type",
            "enum": [
              "all",
              "auction",
              "buy_it_now"
            ],
            "type": "string",
            "description": "Filter by listing format: all, auction (LH_Auction=1), or buy_it_now (LH_BIN=1).",
            "default": "all"
          },
          "seller": {
            "title": "Seller username",
            "type": "string",
            "description": "When set, adds LH_SpecificSeller=1 and _ssn=seller to the sold search URL."
          },
          "returnsAccepted": {
            "title": "Returns accepted only",
            "type": "boolean",
            "description": "When true, adds LH_Rtn=1 to the sold search URL.",
            "default": false
          },
          "categoryId": {
            "title": "Category ID",
            "type": "string",
            "description": "Optional eBay category ID to narrow sold results."
          },
          "maxItems": {
            "title": "Max sold items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum sold listings to push to the dataset (across all queries/URLs).",
            "default": 50
          },
          "minSoldPrice": {
            "title": "Min sold price",
            "minimum": 0,
            "type": "number",
            "description": "Filter out sold items cheaper than this (0 = no min). Applied to eBay URL and client-side.",
            "default": 0
          },
          "maxSoldPrice": {
            "title": "Max sold price",
            "minimum": 0,
            "type": "number",
            "description": "Filter out sold items more expensive than this (0 = no max). Applied to eBay URL and client-side.",
            "default": 0
          },
          "conditions": {
            "title": "Condition filters",
            "type": "array",
            "description": "Optional condition labels to keep (e.g. New, Open box, Used, Refurbished). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "excludedPhrases": {
            "title": "Excluded phrases",
            "type": "array",
            "description": "Drop sold listings whose title contains any of these case-insensitive phrases (e.g. \"case only\", \"charger only\", \"for parts\"). midwest_united parity.",
            "items": {
              "type": "string"
            }
          },
          "knownBrands": {
            "title": "Known brands",
            "type": "array",
            "description": "Brand allow-list for noise control. If the search query names one of these brands, listings whose title shows a different brand from this list (and not the query brand) are dropped. Leave empty to disable. midwest_united parity.",
            "items": {
              "type": "string"
            }
          },
          "computeComps": {
            "title": "Compute comps",
            "type": "boolean",
            "description": "Attach median, avg, p10, p90, compScore, buyBelow to each row and charge premium-comp-report.",
            "default": true
          },
          "includeCompsSummary": {
            "title": "Include comps-summary row",
            "type": "boolean",
            "description": "Push one type=comps-summary analytics row (median/avg/p10/p90/buyBelow/count) after sold listings. Still charges premium-comp-report when computeComps is on.",
            "default": true
          },
          "soldWithinDays": {
            "title": "Sold within days",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Keep sold listings newer than this many days when soldDate parses (0 = no filter).",
            "default": 0
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "best_match",
              "newest",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "eBay sold search sort (best effort).",
            "default": "best_match"
          },
          "freeShippingOnly": {
            "title": "Free shipping only",
            "type": "boolean",
            "description": "Add eBay free-shipping filter to the sold search URL.",
            "default": false
          },
          "itemLocation": {
            "title": "Item location",
            "enum": [
              "default",
              "domestic",
              "worldwide"
            ],
            "type": "string",
            "description": "Search-page item location filter (caffein.dev parity). default = no LH_PrefLoc; domestic = LH_PrefLoc=1; worldwide = LH_PrefLoc=3.",
            "default": "default"
          },
          "aspectFilter": {
            "title": "Aspect filter",
            "type": "object",
            "description": "eBay aspect facet filters, e.g. {\"Brand\": \"Nike\"}. Keys and values are double-encoded per eBay's convention (caffein.dev parity). Applied to sold search URLs.",
            "default": {}
          },
          "discordWebhook": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "Optional Discord incoming webhook for high-compScore (≥75) deal alerts. Live runs: a successful Discord post bills the deal-alert PPE event ($0.002)."
          },
          "webhookUrl": {
            "title": "CRM webhook URL",
            "type": "string",
            "description": "Optional HTTP POST of each high-score sold-comp JSON. Live runs: a successful POST bills deal-alert ($0.002). One alert charge per row even if both Discord + CRM fire."
          },
          "demoMode": {
            "title": "Demo mode",
            "type": "boolean",
            "description": "Load bundled fixture sold listings (no live scrape). Still produces dataset items. Client filters (excludedPhrases/knownBrands/price/condition) still apply.",
            "default": false
          },
          "buyBelowPct": {
            "title": "Buy-below percent of median",
            "minimum": 50,
            "maximum": 100,
            "type": "number",
            "description": "buyBelow = median * (buyBelowPct/100). Default 85 means buy under 85% of median.",
            "default": 85
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}