{
  "openapi": "3.0.1",
  "info": {
    "title": "Barnes & Noble Stock Checker: Store Inventory & Restocks",
    "description": "Barnes & Noble stock checker and scraper: is a book, LEGO set, Funko or toy in stock at each B&N store near any ZIP code or city, with address, phone, hours and distance, plus price, sale price and online availability. Search by keyword, link or ISBN. Scheduled runs = restock alerts.",
    "version": "0.1",
    "x-build-id": "Isfww6eLu9y09saVg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~barnes-noble-stock-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-barnes-noble-stock-checker",
        "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/s_actors~barnes-noble-stock-checker/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-barnes-noble-stock-checker",
        "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/s_actors~barnes-noble-stock-checker/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-barnes-noble-stock-checker",
        "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": {
          "mode": {
            "title": "📋 What to do",
            "enum": [
              "search",
              "products"
            ],
            "type": "string",
            "description": "Search: keywords or barnesandnoble.com search links, every product found with its availability in stores near your ZIP codes. Check products: exact products by link, ISBN, EAN or UPC (best for a back-in-stock watchlist).",
            "default": "search"
          },
          "keywords": {
            "title": "🔎 Keywords or search links",
            "type": "array",
            "description": "Search mode: what to search on Barnes & Noble, one per line (e.g. \"lego icons\", \"pokemon\", \"criterion collection\", \"atomic habits\"), or a barnesandnoble.com search link with its filters and sort order (…/search?q=funko&attributes.productLineCategoryDisplayName=Toys+%26+Games). eBooks and audiobooks are skipped: stores do not sell them.",
            "items": {
              "type": "string"
            }
          },
          "products": {
            "title": "🏷️ Product links, ISBNs, EANs or UPCs",
            "type": "array",
            "description": "Check products mode: barnesandnoble.com product links (…?ean=9781604382648), ISBN-13, ISBN-10, EAN or UPC, one per line.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "📍 ZIP codes or cities",
            "type": "array",
            "description": "US ZIP codes (10001) or cities (\"Chicago, IL\") to check stores around, one per line: the nearest stores within \"Radius\" (up to \"Stores per ZIP code\"). Empty and no store numbers = online availability only.",
            "items": {
              "type": "string"
            }
          },
          "storeNumbers": {
            "title": "🏬 Store numbers",
            "type": "array",
            "description": "Exact Barnes & Noble stores to check, one per line: the store number (e.g. 2675) or a store link (stores.barnesandnoble.com/store/2675).",
            "items": {
              "type": "string"
            }
          },
          "radiusMiles": {
            "title": "📏 Radius (miles)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How far from each ZIP code or city to look for stores.",
            "default": 25
          },
          "maxStoresPerZip": {
            "title": "🔢 Stores per ZIP code",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "For each ZIP code or city: how many of the nearest stores to check (up to 50).",
            "default": 10
          },
          "maxProductsPerSearch": {
            "title": "🔢 Max products per search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Search mode: how many products to take from each keyword or link (24 per Barnes & Noble page).",
            "default": 40
          },
          "sortBy": {
            "title": "↕️ Sort search by",
            "enum": [
              "relevance",
              "bestsellers",
              "newest",
              "price_low",
              "price_high"
            ],
            "type": "string",
            "description": "Search mode: the order of barnesandnoble.com, which decides the products taken. A search link keeps its own sort order.",
            "default": "relevance"
          },
          "onlyInStock": {
            "title": "✅ Only in stock",
            "type": "boolean",
            "description": "Return only rows where the store has the product now (or, without stores, where it is in stock online).",
            "default": false
          },
          "maxPrice": {
            "title": "💲 Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Return only products at or below this price in USD. Empty = any price."
          },
          "onlyChanges": {
            "title": "🔔 Only report changes",
            "type": "boolean",
            "description": "For scheduled runs. The first run saves availability and prices; later runs return only what changed: back in stock at a store, sold out, price drops and increases, and new products or stores in your searches (e.g. a new LEGO or Funko release). Each row also carries the restocks this monitor has seen and the usual restock weekday. You pay only for the changes returned.",
            "default": false
          },
          "monitorName": {
            "title": "🏷️ Monitor name",
            "type": "string",
            "description": "Separate monitors keep separate memory. Use a different name for each scheduled task.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "⚡ Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many requests run at the same time.",
            "default": 6
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}