{
  "openapi": "3.0.1",
  "info": {
    "title": "eBay AI Listing Optimizer & Description Generator",
    "description": "Optimize one eBay listing with AI: ten 78-80 character titles, official Item Specifics and an HTML description modeled on top-selling competitors and your photos.",
    "version": "0.1",
    "x-build-id": "E7BKcNBOKySHbtuqF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magic-scraper~ebay-listing-optimizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magic-scraper-ebay-listing-optimizer",
        "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/magic-scraper~ebay-listing-optimizer/runs": {
      "post": {
        "operationId": "runs-sync-magic-scraper-ebay-listing-optimizer",
        "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/magic-scraper~ebay-listing-optimizer/run-sync": {
      "post": {
        "operationId": "run-sync-magic-scraper-ebay-listing-optimizer",
        "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",
        "required": [
          "itemIds"
        ],
        "properties": {
          "itemIds": {
            "title": "🔍 eBay listing IDs or URLs",
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "description": "Enter 1 to 10 complete 10–14 digit eBay listing IDs or /itm/ URLs to optimize in parallel.",
            "items": {
              "type": "string"
            }
          },
          "llmApiKey": {
            "title": "🔑 Your LLM API key (optional)",
            "type": "string",
            "description": "Leave empty to use the built-in model included in the price. Provide your own OpenAI-compatible key only to choose another provider/model; its usage is then billed by that provider."
          },
          "llmBaseUrl": {
            "title": "🌐 LLM API base URL",
            "type": "string",
            "description": "Used only with your own key. Defaults to https://openrouter.ai/api/v1. A bare server address gets /v1; custom API paths such as /v1beta/openai are preserved."
          },
          "llmModel": {
            "title": "🤖 LLM model",
            "type": "string",
            "description": "Used only with your own key. Defaults to google/gemini-2.5-flash. Needs Chat Completions, JSON output and image input."
          },
          "maxCompetitors": {
            "title": "🏆 Niche leaders to include",
            "minimum": 3,
            "maximum": 10,
            "type": "integer",
            "description": "Top velocity examples from the inspected category/Type sample, included in the LLM context (3–10).",
            "default": 8
          },
          "itemTimeoutSecs": {
            "title": "⏱️ Processing deadline per listing (seconds)",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "Time budget for source collection, competitor sampling and LLM generation. Larger budgets allow longer LLM requests within the remaining time. Timed-out or unreadable responses are skipped.",
            "default": 300
          },
          "analyzeImages": {
            "title": "📷 Analyse up to three product images",
            "type": "boolean",
            "description": "Use a separate vision request to describe up to three source images before final generation. Uncertain observations are marked; requires a vision-capable model.",
            "default": true
          },
          "llmVisionModel": {
            "title": "👁️ Vision model (optional)",
            "type": "string",
            "description": "Used only with your own key: an image-capable model on the same provider. When omitted, uses llmModel."
          },
          "descriptionTemplate": {
            "title": "🎨 Description template",
            "enum": [
              "clean",
              "technical",
              "catalog",
              "premium"
            ],
            "type": "string",
            "description": "The complete selected HTML template is supplied to the LLM and filled with its product copy and specifics.",
            "default": "clean"
          },
          "saveHtmlToKvs": {
            "title": "💾 Export HTML and audit files",
            "type": "boolean",
            "description": "Save DESCRIPTION_{itemId}.html and AUDIT_{itemId}.md after the dataset result is accepted. Full copies are always in the dataset.",
            "default": true
          },
          "ebayAccessToken": {
            "title": "🔐 eBay OAuth access token (optional)",
            "type": "string",
            "description": "Optional OAuth token for Browse search and official category Taxonomy. All listing cards are read from the website; no API detail calls."
          },
          "ebayClientId": {
            "title": "🔐 eBay application Client ID (optional)",
            "type": "string",
            "description": "Production App ID. Pair with Client Secret for search and category Taxonomy. Official category aspects are required for generation. Listing details come from the website."
          },
          "ebayClientSecret": {
            "title": "🔐 eBay application Client Secret (optional)",
            "type": "string",
            "description": "Production Cert ID from eBay Developers Program. Must be paired with Client ID. Credentials can also be configured as actor environment variables."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}