{
  "openapi": "3.0.1",
  "info": {
    "title": "Ninja Grocery Product Scraper: Prices and Catalog",
    "description": "Read the grocery, beauty and pharmacy catalog that Ninja serves in Saudi Arabia: find the stores at a delivery point, then search products, browse a category or brand, and get prices, discounts, units, categories and brands for price monitoring.",
    "version": "1.0",
    "x-build-id": "KV54I9AeCzBIMUj1U"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/happyendpoint~ninja-saudi-grocery-product-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-happyendpoint-ninja-saudi-grocery-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/happyendpoint~ninja-saudi-grocery-product-scraper/runs": {
      "post": {
        "operationId": "runs-sync-happyendpoint-ninja-saudi-grocery-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/happyendpoint~ninja-saudi-grocery-product-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-happyendpoint-ninja-saudi-grocery-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",
        "required": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "verticals",
              "productSearch",
              "productsByCategory",
              "productsByBrand",
              "productDetails",
              "categories",
              "categorySections",
              "brands",
              "productBundle"
            ],
            "type": "string",
            "description": "Which data to fetch. Each option is one kind of request."
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most results to return. The run stops once it has this many.",
            "default": 100
          },
          "storeId": {
            "title": "Store ID",
            "pattern": "^[0-9]{1,12}$",
            "type": "string",
            "description": "The number of the store whose shelves to read. Run Stores at a point for your delivery point and take the store_id of the catalog you want: the number differs by place and by catalog. Used by: Search products, Products of a category, Products of a brand, Product details, Categories, Brands."
          },
          "vertical": {
            "title": "Catalog",
            "enum": [
              "RETAIL",
              "BEAUTY",
              "PHARMACY"
            ],
            "type": "string",
            "description": "Which part of the store to read: grocery, beauty or pharmacy. Required for Categories and Category sections. Used by: Search products, Products of a category, Products of a brand, Product details, Categories, Category sections, Brands."
          },
          "productIds": {
            "title": "Product IDs",
            "pattern": "^[0-9]{1,12}(,[0-9]{1,12}){0,49}$",
            "type": "string",
            "description": "One or more catalog product numbers, with a comma between them, up to 50. Use the product_id of a search row, not its store-specific id. Used by: Product details."
          },
          "productId": {
            "title": "Product ID",
            "pattern": "^[0-9]{1,12}$",
            "type": "string",
            "description": "The catalog number of the product that has a bundle, as the product_id of a search row. Used by: Product bundle."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "North-south position of the place where goods would be delivered, as a decimal number. Stores are found for that point. Used by: Stores at a point."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "East-west position of the delivery place, as a decimal number. Used by: Stores at a point."
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "ar"
            ],
            "type": "string",
            "description": "The language of names and labels in the rows. Leave it empty for English. Product rows keep both the English and the Arabic name where the site has them. Used by: Stores at a point, Search products, Products of a category, Products of a brand, Product details, Categories, Category sections, Brands, Product bundle."
          },
          "country": {
            "title": "Country",
            "enum": [
              "sa",
              "kw",
              "qa",
              "bh"
            ],
            "type": "string",
            "description": "The country whose category sections to read. Used by: Category sections."
          },
          "query": {
            "title": "Keyword",
            "maxLength": 100,
            "type": "string",
            "description": "A product name or word, in Arabic or English, to look for in the store. For Brands it narrows the list to brand names that match. Used by: Search products, Brands."
          },
          "categoryIds": {
            "title": "Category IDs",
            "pattern": "^[0-9]{1,12}(,[0-9]{1,12}){0,19}$",
            "type": "string",
            "description": "One or more category numbers from Categories, with a comma between them, up to 20. Used by: Products of a category."
          },
          "subCategoryIds": {
            "title": "Subcategory IDs",
            "pattern": "^[0-9]{1,12}(,[0-9]{1,12}){0,19}$",
            "type": "string",
            "description": "Narrow the chosen categories to these subcategory numbers, with a comma between them, up to 20. Used by: Products of a category."
          },
          "brandCode": {
            "title": "Brand code",
            "maxLength": 60,
            "type": "string",
            "description": "The short code of one brand, as Brands returns it in the code of each row. It is a code, not the brand number or its display name. Used by: Products of a brand, Brands."
          },
          "parentCategoryId": {
            "title": "Parent category ID",
            "pattern": "^[0-9]{1,12}$",
            "type": "string",
            "description": "Return only the direct children of this category number. Leave it empty to list every level. Used by: Categories."
          },
          "topLevelOnly": {
            "title": "Top level only",
            "type": "boolean",
            "description": "Return only the root categories, a short overview of the whole tree. Used by: Categories."
          },
          "includePrescription": {
            "title": "Include prescription products",
            "type": "boolean",
            "description": "Allow products that need a prescription in pharmacy results. Leave it empty for the site default. Used by: Search products, Products of a category, Products of a brand, Product details."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}