{
  "openapi": "3.0.1",
  "info": {
    "title": "CeX Spain Product Scraper",
    "description": "Scrape CeX Spain product pages and search results with sell prices, trade-in cash, voucher values, stock status, images, URLs, and product IDs.",
    "version": "1.0",
    "x-build-id": "AfW1basKEIfhwcjTM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/autoclient~cex-spain-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-autoclient-cex-spain-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/autoclient~cex-spain-scraper/runs": {
      "post": {
        "operationId": "runs-sync-autoclient-cex-spain-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/autoclient~cex-spain-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-autoclient-cex-spain-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": {
          "search_input": {
            "title": "Search input",
            "type": "string",
            "description": "Product search query (e.g. 'iPhone 15 128GB'). Primary field used by the orchestrator."
          },
          "search_query": {
            "title": "Search query (legacy alias)",
            "type": "string",
            "description": "Legacy alias for search_input. Either field works."
          },
          "max_items": {
            "title": "Maximum items",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of grade SKUs to scrape and capture.",
            "default": 10
          },
          "include_trade_values": {
            "title": "Include trade-in values",
            "type": "boolean",
            "description": "Best-effort extraction of CeX buy/exchange prices from each ficha.",
            "default": true
          },
          "include_images": {
            "title": "Include images",
            "type": "boolean",
            "description": "Include product image URLs in the output.",
            "default": true
          },
          "include_stock_status": {
            "title": "Include stock status",
            "type": "boolean",
            "description": "Include in-stock / out-of-stock status per SKU.",
            "default": true
          },
          "include_descriptions": {
            "title": "Include descriptions",
            "type": "boolean",
            "description": "Include long product descriptions (off by default).",
            "default": false
          },
          "throttle": {
            "title": "Throttle (ms)",
            "type": "integer",
            "description": "Optional delay between requests.",
            "default": 0
          },
          "proxy_groups": {
            "title": "Proxy groups (Apify)",
            "type": "string",
            "description": "Apify proxy groups (comma-separated). RESIDENTIAL by default (webuy 403-blocks datacenter). Ignored if Custom proxy URLs are set."
          },
          "proxy_country_code": {
            "title": "Proxy country (Apify)",
            "type": "string",
            "description": "Country for the Apify proxy IP (ES by default, so webuy serves the Spanish locale).",
            "default": "ES"
          },
          "proxyUrls": {
            "title": "Custom proxy URLs",
            "type": "array",
            "description": "Optional. Standard proxy URLs (http://user:pass@host:port) from ANY residential provider (IPRoyal, DataImpulse, Smartproxy…). If set, these REPLACE the Apify proxy and the actor can run outside Apify. Leave empty to use the Apify proxy.",
            "items": {
              "type": "string"
            }
          },
          "s3Endpoint": {
            "title": "S3 endpoint (optional)",
            "type": "string",
            "description": "S3-compatible endpoint, e.g. https://<acct>.r2.cloudflarestorage.com or http://minio:9000. Leave empty for AWS S3. When the S3 fields are set, screenshots upload here instead of Apify KV (run outside Apify)."
          },
          "s3Bucket": {
            "title": "S3 bucket",
            "type": "string",
            "description": "Bucket name for screenshot uploads. Required to enable S3 storage; otherwise screenshots go to the Apify key-value store."
          },
          "s3Region": {
            "title": "S3 region",
            "type": "string",
            "description": "Region (use 'auto' for Cloudflare R2). Defaults to auto."
          },
          "s3AccessKeyId": {
            "title": "S3 access key id",
            "type": "string",
            "description": "Access key id for the S3 bucket."
          },
          "s3SecretAccessKey": {
            "title": "S3 secret access key",
            "type": "string",
            "description": "Secret access key for the S3 bucket."
          },
          "s3PublicBaseUrl": {
            "title": "S3 public base URL",
            "type": "string",
            "description": "Public base URL screenshots are served from, e.g. https://cdn.example.com/screenshots. The emitted screenshotUrl is <base>/<key>. Defaults to <endpoint>/<bucket>."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}