{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Marketplace Deal Finder",
    "description": "Find public Facebook Marketplace listings by keyword, city, area, or ZIP. Export Markdown, CSV, and Excel with prices, locations, sellers, images, history, filters, diagnostics, and alerts. Login-gated or blocked pages are reported transparently.",
    "version": "0.1",
    "x-build-id": "QUfVuTerR33FV4ddj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kuantum~facebook-marketplace-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kuantum-facebook-marketplace-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/kuantum~facebook-marketplace-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kuantum-facebook-marketplace-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/kuantum~facebook-marketplace-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kuantum-facebook-marketplace-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": {
          "keywords": {
            "title": "Search keywords",
            "maxItems": 20,
            "type": "array",
            "description": "Terms to search for in Facebook Marketplace. Generated search URLs are best-effort because Facebook may require login.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "areas": {
            "title": "Areas or cities",
            "maxItems": 20,
            "type": "array",
            "description": "City, county, or area names paired with each keyword.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "maxItems": 20,
            "type": "array",
            "description": "ZIP or postal codes paired with each keyword and area.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "Marketplace search URLs",
            "maxItems": 20,
            "type": "array",
            "description": "Public Facebook Marketplace search URLs. Login-required pages produce a failure record.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "listingUrls": {
            "title": "Marketplace listing URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Direct public Facebook Marketplace listing URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "capturedListingStoreId": {
            "title": "Captured listing URL store ID",
            "type": "string",
            "description": "Optional protected Key-Value Store ID containing CAPTURED_LISTING_URLS created by the browser-assisted search capture script."
          },
          "maxItems": {
            "title": "Maximum listings",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of public listing pages to inspect and emit.",
            "default": 10
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Number of public listing pages to inspect in parallel.",
            "default": 1
          },
          "maxScrolls": {
            "title": "Search page scrolls",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Additional scrolls per search page to load more listing links. Ignored when infinite scrolling is enabled.",
            "default": 3
          },
          "infiniteScroll": {
            "title": "Infinite scroll until stable",
            "type": "boolean",
            "description": "Continue scrolling until maxItems is reached or two consecutive scrolls add no new listing links. A safety ceiling of 100 scrolls applies.",
            "default": false
          },
          "scrollDelayMs": {
            "title": "Scroll delay (ms)",
            "minimum": 500,
            "maximum": 30000,
            "type": "integer",
            "description": "Wait time between infinite-scroll steps.",
            "default": 1500
          },
          "maxRetries": {
            "title": "Retry attempts",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries after navigation failures, using exponential backoff.",
            "default": 0
          },
          "requestDelayMs": {
            "title": "Request delay (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Delay between page requests. Increase this to reduce request pressure.",
            "default": 10000
          },
          "stopOnAccessBlock": {
            "title": "Stop on Facebook block",
            "type": "boolean",
            "description": "Stop the entire run after the configured number of Facebook login, security, bot-check, 403, or 429 signals.",
            "default": true
          },
          "maxBlockedPages": {
            "title": "Maximum blocked pages",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Number of Facebook block signals allowed before the circuit breaker stops the run.",
            "default": 1
          },
          "listingTimeoutMs": {
            "title": "Listing timeout (ms)",
            "minimum": 5000,
            "maximum": 60000,
            "type": "integer",
            "description": "Maximum time to wait for each listing page before recording a failure and continuing.",
            "default": 20000
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "number",
            "description": "Optional minimum listing price. Listings without a numeric price are filtered out when this is set."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "number",
            "description": "Optional maximum listing price. Listings without a numeric price are filtered out when this is set."
          },
          "alertWebhookUrl": {
            "title": "Alert webhook URL",
            "pattern": "^https://",
            "type": "string",
            "description": "Optional HTTPS webhook URL for run-complete and price-drop JSON notifications."
          },
          "alertOnPriceDrop": {
            "title": "Alert on price drops",
            "type": "boolean",
            "description": "Send a webhook notification when a previously seen listing price decreases.",
            "default": true
          },
          "alertOnNewListing": {
            "title": "Alert on new listings",
            "type": "boolean",
            "description": "Send a webhook notification for listings not present in historical state.",
            "default": false
          },
          "maxHistoryItems": {
            "title": "History retention limit",
            "minimum": 100,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of listing records retained in persistent history.",
            "default": 10000
          },
          "fallbackApiUrl": {
            "title": "Authorized fallback API URL",
            "pattern": "^https://",
            "type": "string",
            "description": "Optional HTTPS endpoint you are authorized to use. It must return an array or {items: []} of listing objects."
          },
          "fallbackApiToken": {
            "title": "Fallback API token",
            "type": "string",
            "description": "Optional bearer token for the authorized fallback API. It is never logged."
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Route browser traffic through Apify Proxy when enabled. Disabled by default because direct access is more reliable for Marketplace.",
            "default": false
          },
          "useFacebookSession": {
            "title": "Use authorized Facebook session",
            "type": "boolean",
            "description": "Load Playwright session state from the protected facebook-session Key-Value Store. You must create and authorize this session yourself.",
            "default": false
          },
          "facebookSessionStoreId": {
            "title": "Facebook session store ID",
            "type": "string",
            "description": "Protected Key-Value Store ID containing PLAYWRIGHT_STORAGE_STATE. Use the ID printed by the session capture script."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}