{
  "openapi": "3.0.1",
  "info": {
    "title": "Alibaba Top Ranking Scraper - Hot Selling & Trending Products",
    "description": "Alibaba Top Ranking scraper: hot-selling, most-popular and best-reviewed products per Alibaba.com category. One row per ranked product: rank, niche, price, MOQ, orders, units sold, views, score, country. Input: category names, IDs or ranking URLs. Schedule it for trends. $1.00 per 1,000.",
    "version": "1.0",
    "x-build-id": "ZPzOs3epOMb3tiXqj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rel8ble~alibaba-top-ranking-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rel8ble-alibaba-top-ranking-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~alibaba-top-ranking-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rel8ble-alibaba-top-ranking-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~alibaba-top-ranking-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rel8ble-alibaba-top-ranking-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": {
          "categories": {
            "title": "Categories (names, IDs or Top ranking URLs)",
            "type": "array",
            "description": "What to get rankings for, one per line. Use a top-level Alibaba category name (\"Consumer Electronics\", \"Beauty\", \"Home & Garden\"), a path to a subcategory (\"Consumer Electronics > Chargers, Batteries & Power Supplies\"), a numeric Alibaba category id (\"201334413\", from the rankingCategoryId column), a Top ranking URL copied from alibaba.com (https://sale.alibaba.com/p/dviiav4th/index.html?categoryIds=...), or \"all\" for every category. A category that is itself one ranking returns that ranking; a broader category returns its featured rankings first, then the rankings of its subcategories, up to Max rankings per category. Empty = a Consumer Electronics demo.",
            "default": [
              "Consumer Electronics"
            ],
            "items": {
              "type": "string"
            }
          },
          "rankTypes": {
            "title": "Ranking types",
            "type": "array",
            "description": "Optional. Which lists to read for every ranking: \"hot-selling\" (ranked by number of orders; default), \"most-popular\" (by views and interested buyers), \"best-reviewed\" (by review volume in the past 180 days). Each type is a separate list of up to 20 products.",
            "items": {
              "type": "string",
              "enum": [
                "hot-selling",
                "most-popular",
                "best-reviewed"
              ],
              "enumTitles": [
                "Hot selling (by orders)",
                "Most popular (by views)",
                "Best reviewed"
              ]
            },
            "default": [
              "hot-selling"
            ]
          },
          "regions": {
            "title": "Buyer regions",
            "type": "array",
            "description": "Optional. Which buyer market the ranking reflects: \"global\" (default), \"us\" (United States) or \"eur\" (Europe). Each region is a separate list.",
            "items": {
              "type": "string",
              "enum": [
                "global",
                "us",
                "eur"
              ],
              "enumTitles": [
                "Global",
                "United States",
                "Europe"
              ]
            },
            "default": [
              "global"
            ]
          },
          "maxRankingsPerCategory": {
            "title": "Max rankings per category",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional. How many rankings (one ranking = one product niche such as \"Power Banks\") to read per input line, integer 0-100000. Default 5 = the featured rankings of the category. Higher values also walk the subcategories. 0 = every ranking under the category (can be hundreds of lists for a top-level category).",
            "default": 5
          },
          "maxProductsPerRanking": {
            "title": "Max products per ranking list",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Optional. Products to save from each list, integer 1-20. Alibaba ranks 20 products per list. Default 20. Use 3 or 5 for a cheap \"top of every niche\" scan.",
            "default": 20
          },
          "rankingKeywords": {
            "title": "Only rankings whose name contains",
            "type": "array",
            "description": "Optional. Keep only rankings whose name contains one of these words, e.g. \"earphone\", \"yoga\", \"dog\". The scraper then walks every subcategory of your input categories to find them, so combine it with a category (not \"all\") to keep runs short. Not charged for skipped rankings.",
            "items": {
              "type": "string"
            }
          },
          "attributeRankingsPerRanking": {
            "title": "Attribute sub-rankings per ranking",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Optional. Alibaba also ranks products inside a niche by attribute (\"Breathable Walking Style Shoes\", \"CE Certified ...\"); a niche can have over 100 of these. Integer 0-500: how many attribute sub-rankings to read per ranking, in Alibaba's order. Default 0 = main rankings only.",
            "default": 0
          },
          "attributeKeywords": {
            "title": "Only attribute sub-rankings containing",
            "type": "array",
            "description": "Optional. Read only attribute sub-rankings whose name contains one of these words, e.g. \"waterproof\", \"CE\", \"wireless\". When set and the number above is 0, every matching attribute sub-ranking is read.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results in total",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Stop after this many rows across all categories, integer. 0 (default) = no limit. You are charged per saved row only.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Optional, advanced. Parallel requests, integer 1-20. Default 5.",
            "default": 5
          },
          "maxRequestRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Optional, advanced. Retries per failed or blocked request, integer 0-20; each retry uses a new session. Default 6.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional, advanced. Leave as is. Default {\"useApifyProxy\": false} = automatic: direct connection first, and only requests that get blocked are retried through Apify Proxy (datacenter, then residential). Set your own Apify Proxy groups or proxy URLs to force them for every request.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}