{
  "openapi": "3.0.1",
  "info": {
    "title": "TREFAC Scraper - Treasure Factory Japan Second-Hand Fashion",
    "description": "Scrape trefac.jp (Treasure Factory, Japan's second-hand fashion chain): title, brand, size, colour, price in JPY, sale badge, store, photos; optional model number, condition rank, accessories. Bulk keywords, categories, URLs. Schedule it for new arrivals. $0.80 / 1,000, no start fee.",
    "version": "1.0",
    "x-build-id": "1pr5JBoJxiaa6CdvN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rel8ble~trefac-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rel8ble-trefac-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/rel8ble~trefac-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rel8ble-trefac-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/rel8ble~trefac-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rel8ble-trefac-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": {
          "keywords": {
            "title": "Keywords / brands",
            "type": "array",
            "description": "One search per keyword, in English or Japanese: brands (\"NIKE\", \"LOUIS VUITTON\", \"PORTER\", \"Supreme\", \"ルイヴィトン\"), models (\"Air Jordan 1\", \"speedy\") or item words (\"ダウンジャケット\"). The site matches English and katakana brand names alike. With categories you get one search per keyword x category. An input without keywords, categories or URLs searches NIKE and LOUIS VUITTON.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "tops, outerwear, coats, pants, skirts, dresses, suits, shoes, bags, fashion accessories, accessories (jewellery), wallets, watches, hats, other - or the site's Japanese names (バッグ, 時計 ...) or category numbers (94). Alone, a category lists every item in it.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "trefac.jp listing pages (a category or subcategory such as /store/t1c90psb/?kind=142, a store /store/tcpsb/?shop=2, a search_result.html search with its filters) or item pages (/store/{code}/c{id}/).",
            "items": {
              "type": "string"
            }
          },
          "gender": {
            "title": "Gender",
            "enum": [
              "all",
              "men",
              "women",
              "kids",
              "boys",
              "girls"
            ],
            "type": "string",
            "description": "Gender section of the site.",
            "default": "all"
          },
          "conditions": {
            "title": "Conditions",
            "type": "array",
            "description": "Any of: unused (6), nearly unused (5), little sign of use (4), some scratches or marks (3), scratches or marks (2), well used (1). Also \"new\", \"like new\", \"excellent\", \"good\", \"fair\", \"poor\" or ranks 1-6. Several = any of them.",
            "items": {
              "type": "string"
            }
          },
          "minPrice": {
            "title": "Min price (JPY)",
            "minimum": 0,
            "type": "integer",
            "description": "Tax-inclusive yen. 0 = no limit.",
            "default": 0
          },
          "maxPrice": {
            "title": "Max price (JPY)",
            "minimum": 0,
            "type": "integer",
            "description": "Tax-inclusive yen. 0 = no limit.",
            "default": 0
          },
          "priceType": {
            "title": "Price type",
            "enum": [
              "all",
              "reduced",
              "regular"
            ],
            "type": "string",
            "description": "Reduced (値下げ) or regular-price items.",
            "default": "all"
          },
          "market": {
            "title": "Section",
            "enum": [
              "all",
              "luxury",
              "vintage"
            ],
            "type": "string",
            "description": "Optional site section: SELECTED LUXURY or vintage clothing.",
            "default": "all"
          },
          "includeOutOfStock": {
            "title": "Include out-of-stock items",
            "type": "boolean",
            "description": "Also list items that are no longer in stock (the site's 在庫なし含む), useful for price history. Default: in stock only.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "priceLow",
              "priceHigh"
            ],
            "type": "string",
            "description": "Order the site lists items in. With a cap per search this decides which items you get; use newest for daily monitoring.",
            "default": "relevance"
          },
          "mustContain": {
            "title": "Must contain (one of)",
            "type": "array",
            "description": "Keep items whose title, brand, colour (and with details, model number and description) contain one of these words. Filtered rows are not charged.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop items whose title, brand or description contains one of these (e.g. \"ジャンク\" for junk items).",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "Max items per search",
            "minimum": 0,
            "type": "integer",
            "description": "Rows per keyword / category / URL. Default 50; 0 = all the site shows (up to 9,990 per search, 90 per page). You pay per row.",
            "default": 50
          },
          "maxResults": {
            "title": "Max items in total",
            "minimum": 0,
            "type": "integer",
            "description": "Optional cap for the whole run. 0 = no cap.",
            "default": 0
          },
          "includeDetails": {
            "title": "Add model number, condition, accessories and all photos",
            "type": "boolean",
            "description": "One extra request per item: model number, condition rank 1-6 (Japanese and English) and the store's notes, accessories, category path, tag and reference size, measurements, description, every photo, shipping fee, stock status. Same price per row.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Parallel requests 1-8 (paced at about 3 requests per second).",
            "default": 4
          },
          "maxRequestRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 15,
            "type": "integer",
            "description": "Retries per failed request.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The site needs no proxy; enable Apify Proxy only if requests fail.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}