{
  "openapi": "3.0.1",
  "info": {
    "title": "Alfagift (Alfamart) Product, Price & Promo Scraper",
    "description": "Twelve Alfagift scrapers in one - no login, no browser, no captcha. Pull Alfamart's whole ~10,000-product catalogue with live prices and discounts, search any keyword, read product detail down to the barcode, sweep the A-Z brand directory, and see every promo campaign running right now.",
    "version": "0.0",
    "x-build-id": "7cJB5h7U0xgDcVwaw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fanndev~alfagift-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fanndev-alfagift-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/fanndev~alfagift-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fanndev-alfagift-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/fanndev~alfagift-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fanndev-alfagift-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "searchSuggestions",
              "categoryTree",
              "categoryProducts",
              "fullCatalog",
              "productDetail",
              "brandDirectory",
              "brandProducts",
              "newArrivals",
              "recommendations",
              "promoBanners",
              "promoProducts"
            ],
            "type": "string",
            "description": "Pick the surface you want. Modes marked (needs input) require a list below; the rest discover their own targets.",
            "default": "search"
          },
          "searchKeywords": {
            "title": "Keywords",
            "type": "array",
            "description": "For 'search' and 'searchSuggestions'. Plain keywords ('susu uht') or pasted alfagift.id/find/... URLs.",
            "items": {
              "type": "string"
            }
          },
          "categoryIds": {
            "title": "Category IDs or URLs",
            "type": "array",
            "description": "For 'categoryProducts'. A 24-character category id, or a pasted alfagift.id/c/... URL. Run 'categoryTree' first to see what exists.",
            "items": {
              "type": "string"
            }
          },
          "productIds": {
            "title": "Product IDs or URLs",
            "type": "array",
            "description": "For 'productDetail'. A numeric productId, or a pasted alfagift.id/p/... URL. A SKU such as A13170001210 will NOT work -- Alfagift only accepts the numeric id.",
            "items": {
              "type": "string"
            }
          },
          "brandIds": {
            "title": "Brand IDs or URLs",
            "type": "array",
            "description": "For 'brandProducts'. A numeric brandId, or a pasted alfagift.id/b/... URL. Run 'brandDirectory' first to find ids.",
            "items": {
              "type": "string"
            }
          },
          "promotionIds": {
            "title": "Promotion IDs or URLs",
            "type": "array",
            "description": "Optional for 'promoProducts'. Leave empty to discover every live campaign from the banner rail. Note this is the id from a banner's deep link (/promotion-products?id=...), NOT the banner's own id.",
            "items": {
              "type": "string"
            }
          },
          "brandLetters": {
            "title": "Brand letters",
            "type": "array",
            "description": "Optional for 'brandDirectory'. Defaults to A-Z. Letters C, F, G, V and W are broken in Alfagift's own brand index and return HTTP 500 whatever you do -- the run reports them as diagnostic rows.",
            "items": {
              "type": "string"
            }
          },
          "targets": {
            "title": "Targets (generic)",
            "type": "array",
            "description": "A single list routed into whichever field the chosen mode needs. Handy when chaining this actor after another one.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many dataset rows. 0 means no limit.",
            "default": 0
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Rows per request. Alfagift enforces no cap, so the default of 1000 fits most whole categories and keyword result sets into a single request.",
            "default": 1000
          },
          "maxPagesPerTarget": {
            "title": "Max pages per target",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety ceiling on how far to page one category, brand or keyword. Rarely reached at the default page size.",
            "default": 50
          },
          "bannerLocation": {
            "title": "Banner location",
            "type": "string",
            "description": "For 'promoBanners' and 'promoProducts'. Only 'main_banner_new' is used by the live site; an unknown location returns an empty list rather than an error.",
            "default": "main_banner_new"
          },
          "bannerLimit": {
            "title": "Banner limit",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many banners to pull from the rail before resolving promotions.",
            "default": 150
          },
          "includePromoDetail": {
            "title": "Include promo detail",
            "type": "boolean",
            "description": "For 'promoBanners': also fetch each campaign's detail page (title, artwork, SEO copy). Costs one extra request per banner.",
            "default": false
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Alfagift did not rate limit 20 back-to-back requests during testing, so this is deliberately small. Raise it if a long catalogue walk starts seeing HTTP 429.",
            "default": 0.2
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry a request that fails with a transient error. A 401 is never retried -- it means the site's encryption key rotated and no number of retries will help.",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 10,
            "maximum": 300,
            "type": "integer",
            "description": "A full-category request can return several megabytes, so keep this generous.",
            "default": 90
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Alfagift has no WAF and no IP gate, so this actor works without a proxy. A residential Indonesian address only buys rate-limit headroom on very large walks.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}