{
  "openapi": "3.0.1",
  "info": {
    "title": "GTIN / UPC / EAN → Product Markdown Card",
    "description": "Look up GTIN/UPC/EAN barcodes via UPCitemdb or Barcode Lookup (bring your own key) with Open Food Facts as a keyless food/FMCG fallback. One Markdown product card (+ optional RAG chunks) per barcode. 256 MB. Not-found & failed rows free. No Idealo/Amazon scraping.",
    "version": "0.1",
    "x-build-id": "a7jHEizO7EoxF0GBA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ingenious_quip_bxq~gtin-product-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ingenious_quip_bxq-gtin-product-markdown",
        "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/ingenious_quip_bxq~gtin-product-markdown/runs": {
      "post": {
        "operationId": "runs-sync-ingenious_quip_bxq-gtin-product-markdown",
        "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/ingenious_quip_bxq~gtin-product-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-ingenious_quip_bxq-gtin-product-markdown",
        "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": {
          "gtins": {
            "title": "GTINs / UPCs / EANs",
            "type": "array",
            "description": "One barcode per line (8–14 digits). Spaces and dashes are stripped; non-digit characters are removed. Duplicates are dropped.",
            "items": {
              "type": "string"
            }
          },
          "barcodes": {
            "title": "Barcodes (alias of gtins)",
            "type": "array",
            "description": "Optional alias of `gtins`. Same normalization rules.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset ID (barcode list)",
            "type": "string",
            "description": "Optional. Read barcodes from another Actor's dataset. Uses the field set in 'Barcode field', else gtin / upc / ean / barcode / code."
          },
          "keyValueStoreId": {
            "title": "Key-value store ID (barcode list)",
            "type": "string",
            "description": "Optional. Read barcodes from a key-value record: JSON array, {\"gtins\": [...]} / {\"barcodes\": [...]}, or plain text with one barcode per line."
          },
          "keyValueRecordKey": {
            "title": "Key-value record key",
            "type": "string",
            "description": "Record key inside the key-value store (default INPUT_GTINS).",
            "default": "INPUT_GTINS"
          },
          "barcodeField": {
            "title": "Barcode field (dataset / JSON objects)",
            "type": "string",
            "description": "Optional. Name of the field holding the barcode in dataset items or JSON objects."
          },
          "provider": {
            "title": "Provider",
            "enum": [
              "auto",
              "upcitemdb",
              "barcodelookup"
            ],
            "type": "string",
            "description": "Which barcode API to call. `auto` uses your key with UPCitemdb first (then Barcode Lookup on auth failure), then Open Food Facts on miss when fallback is on. Without a key, `auto` goes straight to Open Food Facts.",
            "default": "auto"
          },
          "apiKey": {
            "title": "Provider API key",
            "type": "string",
            "description": "UPCitemdb paid `user_key` or Barcode Lookup `key`. Stored encrypted and never logged. Without a key, paid providers are skipped; Open Food Facts still works when fallback is enabled. Placeholders like YOUR_KEY are ignored."
          },
          "upcitemdbUserId": {
            "title": "UPCitemdb user_key override (optional)",
            "type": "string",
            "description": "Rarely needed. UPCitemdb paid plans authenticate with the `user_key` header (same value as apiKey) plus fixed `key_type: 3scale`. Use this only if you want a separate user_key distinct from apiKey."
          },
          "fallbackOpenFoodFacts": {
            "title": "Fallback to Open Food Facts",
            "type": "boolean",
            "description": "When the paid provider misses (or no key is provided under auto), look up the GTIN on Open Food Facts (keyless, food/FMCG coverage). Always labels `source=openfoodfacts` on success.",
            "default": true
          },
          "includeRagChunks": {
            "title": "Include RAG chunks",
            "type": "boolean",
            "description": "Split each product Markdown card into ~500–800 character chunks with headings. Written to key-value record CHUNKS.jsonl.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many barcodes. 0 = no limit (still subject to platform limits).",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Parallel provider requests. Keep low to respect provider rate limits.",
            "default": 2
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries for 429, 5xx and timeouts with exponential backoff (honours Retry-After). 401/403/not-found are not retried.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout per provider request.",
            "default": 30
          },
          "stopOnAuthError": {
            "title": "Stop on rejected key",
            "type": "boolean",
            "description": "After a paid provider rejects the key (401/403), mark remaining paid lookups as skipped (still try Open Food Facts when fallback is on). All free.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}