{
  "openapi": "3.0.1",
  "info": {
    "title": "Second-hand Deal Scanner ES — Vinted & Milanuncios vs eBay Sold",
    "description": "Finds underpriced live listings on Vinted & Milanuncios by cross-checking real eBay SOLD prices: deals ranked by estimated resale profit, with valuation stats attached. Built for resellers and AI agents.",
    "version": "0.3",
    "x-build-id": "9hJT2jkehKqwEQyhN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jdepablos~second-hand-deal-scanner-es/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jdepablos-second-hand-deal-scanner-es",
        "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/jdepablos~second-hand-deal-scanner-es/runs": {
      "post": {
        "operationId": "runs-sync-jdepablos-second-hand-deal-scanner-es",
        "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/jdepablos~second-hand-deal-scanner-es/run-sync": {
      "post": {
        "operationId": "run-sync-jdepablos-second-hand-deal-scanner-es",
        "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": {
          "query": {
            "title": "Item to watch",
            "type": "string",
            "description": "Item you want deals for, e.g. 'Game Boy Micro'. Use a canonical product name — it drives both the source search and the eBay valuation. For multiple items use 'items'."
          },
          "items": {
            "title": "Watchlist (optional)",
            "type": "array",
            "description": "Up to 20 items per run. Each entry: {\"query\": \"...\"} plus any per-item overrides (priceMax, marginMinPct, sources, ...)."
          },
          "country": {
            "title": "Country",
            "enum": [
              "ES",
              "FR",
              "DE",
              "IT",
              "UK"
            ],
            "type": "string",
            "description": "Market to scan. Determines the Vinted domain, the default eBay site for valuation and the proxy country. Wallapop & Milanuncios are Spain-only and are skipped elsewhere.",
            "default": "ES"
          },
          "sources": {
            "title": "Sources to scan",
            "type": "array",
            "description": "Marketplaces to scan for live listings. Non-Spanish countries support Vinted only (others are skipped).",
            "items": {
              "type": "string",
              "enum": [
                "vinted",
                "milanuncios",
                "wallapop"
              ],
              "enumTitles": [
                "Vinted (ES)",
                "Milanuncios",
                "Wallapop"
              ]
            }
          },
          "marketplaceForComps": {
            "title": "eBay site for valuation",
            "enum": [
              "ebay.es",
              "ebay.com",
              "ebay.co.uk",
              "ebay.de",
              "ebay.fr",
              "ebay.it"
            ],
            "type": "string",
            "description": "Where resale value is computed from sold listings. Defaults to the eBay site of the selected country (keeps currencies consistent)."
          },
          "marginMinPct": {
            "title": "Min profit margin %",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Only report listings whose estimated profit margin (vs estimated buy total) reaches this percentage.",
            "default": 25
          },
          "priceMax": {
            "title": "Max listing price",
            "type": "integer",
            "description": "Ignore live listings above this price (EUR)."
          },
          "condition": {
            "title": "Condition (for valuation)",
            "enum": [
              "any",
              "new",
              "used"
            ],
            "type": "string",
            "description": "Restrict the eBay sold comps used for valuation.",
            "default": "any"
          },
          "minTitleMatch": {
            "title": "Title match threshold",
            "type": "string",
            "description": "0-1: fraction of query words that must appear in a listing title (source search relevance is loose — this kills false positives). Default 0.75.",
            "default": "0.75"
          },
          "priceSanityMinPct": {
            "title": "Price sanity floor %",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Listings priced below this % of the resale median are treated as a different product (accessory, single game, empty box), not a deal. Default 10.",
            "default": 10
          },
          "maxListingsPerSource": {
            "title": "Max listings per source",
            "minimum": 5,
            "maximum": 96,
            "type": "integer",
            "description": "How many live listings to pull from each source per item.",
            "default": 40
          },
          "strictClean": {
            "title": "Strict cleaning",
            "type": "boolean",
            "description": "Drop lots/bundles/for-parts/repro listings on both sides (valuation comps AND live candidates). Recommended.",
            "default": true
          },
          "economics": {
            "title": "Economics overrides",
            "type": "object",
            "description": "Optional cost model overrides: {\"resaleFeePct\": 13, \"vintedBuyerFeePct\": 5, \"vintedShippingEst\": 3.5, \"milanunciosShippingEst\": 0, \"wallapopBuyerFeePct\": 5, \"wallapopShippingEst\": 4}."
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Sources use DataDome — residential ES proxy is strongly recommended (default).",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "ES"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}