{
  "openapi": "3.0.1",
  "info": {
    "title": "Xianyu Goofish Scraper — China Resale Search & Item API",
    "description": "Search Xianyu (Goofish, 闲鱼), China's largest second-hand resale marketplace, by keyword and export clean data: price, condition, location, specs, want-count and full seller profiles. Sortable, paginated search plus item-ID detail lookups. Export JSON, CSV or Excel for price monitoring and research.",
    "version": "1.0",
    "x-build-id": "zw8gxMtAKBBVQ1KjE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~xianyu-goofish-product-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-xianyu-goofish-product-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/sian.agency~xianyu-goofish-product-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-xianyu-goofish-product-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/sian.agency~xianyu-goofish-product-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-xianyu-goofish-product-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": {
          "operation": {
            "title": "🛠️ Operation",
            "enum": [
              "keywordSearch",
              "productDetail"
            ],
            "type": "string",
            "description": "🛠️ **OPERATION:** Choose what to scrape.\n\n🔍 **Listing Search** — find second-hand listings by keyword and export price, condition, location, want-count and seller signals (paginated, sortable).\n\n📦 **Item Detail** — look up one or more listings by item ID for the full description, structured specs (brand/model/storage/condition), demand counts and a complete seller profile.",
            "default": "keywordSearch"
          },
          "keyword": {
            "title": "🔍 Search Keyword (Single)",
            "type": "string",
            "description": "🔍 **SINGLE KEYWORD SEARCH:** Enter one keyword to search the marketplace.\n\n💡 **Examples:** `iPhone`, `Air Jordan 1`, `Rolex`, `PS5`, or Chinese terms like `球鞋`, `相机`, `耐克`.\n\n📦 Returns relevance-ranked second-hand listings with price, condition and seller info.\n\n💡 **TIP:** Use **Bulk Keywords** below to sweep a whole watchlist in one run.\n\n⚠️ Used only when **Operation = Listing Search**.",
            "default": "iPhone"
          },
          "keywords": {
            "title": "🚀 Bulk Keywords (Multiple)",
            "uniqueItems": true,
            "type": "array",
            "description": "🚀 **BULK KEYWORD SEARCH:** Search many keywords in one run — perfect for monitoring a brand or product watchlist.\n\n📊 **TIER-BASED LIMITS:**\n- **FREE users:** Up to 5 keywords per run\n- **PAID users:** Unlimited keywords\n\n✏️ **BULK EDIT:** Click \"Bulk edit\" to paste keywords (one per line).\n\n⚠️ Used only when **Operation = Listing Search**. Provide a single keyword OR bulk keywords.",
            "items": {
              "type": "string"
            }
          },
          "keywordsFileUrl": {
            "title": "📄 Keywords from File URL (Optional)",
            "type": "string",
            "description": "📄 **KEYWORDS FROM A FILE:** Provide a public URL to a plain-text file with one keyword per line. Useful for large, version-controlled watchlists.\n\n📊 Tier limits apply the same as Bulk Keywords (FREE: 5, PAID: unlimited).\n\n⚠️ Used only when **Operation = Listing Search**."
          },
          "sort": {
            "title": "↕️ Sort Order",
            "enum": [
              "active",
              "recent",
              "credit",
              "price_asc",
              "price_desc",
              "price_drop",
              "newest"
            ],
            "type": "string",
            "description": "↕️ **SORT ORDER** for Listing Search results:\n\n- **Active** — active listings first (default)\n- **Recent** — recent / position-based results first\n- **Seller credit** — high-credit sellers first\n- **Price: low → high** — cheapest first (best for arbitrage)\n- **Price: high → low** — most expensive first\n- **Price drop** — recently reduced-price listings first\n- **Newest** — newly listed items first\n\n⚠️ Used only when **Operation = Listing Search**.",
            "default": "active"
          },
          "itemId": {
            "title": "📦 Item ID (Single)",
            "type": "string",
            "description": "📦 **SINGLE ITEM DETAIL:** Enter one Xianyu (Goofish) item ID to pull the full listing + seller profile.\n\n💡 The item ID is the numeric `id` in a listing URL (e.g. `https://www.goofish.com/item?id=`**`1031168370989`**) and is also returned as `itemId` by Listing Search.\n\n💡 **TIP:** Use **Bulk Item IDs** below for several at once.\n\n⚠️ Used only when **Operation = Item Detail**."
          },
          "itemIds": {
            "title": "🚀 Bulk Item IDs (Multiple)",
            "uniqueItems": true,
            "type": "array",
            "description": "🚀 **BULK ITEM DETAIL:** Look up many listings by item ID in one run.\n\n📊 **TIER-BASED LIMITS:**\n- **FREE users:** Up to 5 item IDs per run\n- **PAID users:** Unlimited item IDs\n\n✏️ **BULK EDIT:** Click \"Bulk edit\" to paste item IDs (one per line).\n\n⚠️ Used only when **Operation = Item Detail**.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "🔢 Max Results per Keyword",
            "minimum": 8,
            "maximum": 200,
            "type": "integer",
            "description": "🔢 **RESULT CAP:** Maximum unique listings to return per keyword for **Listing Search** (8–200). The actor paginates the marketplace (≈10 listings per page) until this cap is reached.\n\n💡 Default 30 captures three pages of fresh listings. (Ignored for Item Detail.)",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}