{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Marketplace Deal Radar — Under-$X Deals",
    "description": "Facebook Marketplace under-$X deal radar: maxPrice/minPrice packs, dealScore, multi-city alerts. Pay per listing. Lawful use only.",
    "version": "1.0",
    "x-build-id": "2MsWpzeCo70rohAbg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/intelscrape~facebook-marketplace-deal-radar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-intelscrape-facebook-marketplace-deal-radar",
        "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/intelscrape~facebook-marketplace-deal-radar/runs": {
      "post": {
        "operationId": "runs-sync-intelscrape-facebook-marketplace-deal-radar",
        "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/intelscrape~facebook-marketplace-deal-radar/run-sync": {
      "post": {
        "operationId": "run-sync-intelscrape-facebook-marketplace-deal-radar",
        "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": {
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Marketplace search keywords (e.g. iPhone, sofa, Honda Civic)."
          },
          "smartQuery": {
            "title": "Smart query expansion",
            "type": "boolean",
            "description": "When true, expand searchQuery with built-in synonyms (e.g. iPhone → iphone, iphone pro, apple iphone) and any synonyms[]. Fanout across query variants × cities.",
            "default": false
          },
          "synonyms": {
            "title": "Query synonyms",
            "type": "array",
            "description": "Optional extra search variants (used when smartQuery is on, or always merged if provided). E.g. [\"iphone 13\", \"iphone 14\"].",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional Marketplace search or listing URLs. If empty, built from searchQuery + location/cities.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "location": {
            "title": "Location slug (single)",
            "type": "string",
            "description": "Single Facebook Marketplace location slug (city). Used when cities[]/locations[] are empty. Kept for Greenville schedule / Task backward compatibility.",
            "default": "austin"
          },
          "cities": {
            "title": "Cities (multi-metro)",
            "type": "array",
            "description": "Marketplace location slugs to fan out across (e.g. greenville, austin, houston, dallas). Prefer this for multi-city runs. Alias of locations[].",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations (alias of cities)",
            "type": "array",
            "description": "Optional alias for cities[]. Same Marketplace location slugs.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories (fanout)",
            "type": "array",
            "description": "Facebook Marketplace categories to search (memo23/blackfalcon parity). Each category is its own search; results merged+deduped. Leave empty for all. Allowed slugs: vehicles, propertyforsale, propertyrentals, apparel, electronics, entertainment, family, free, garden, hobbies, home, instruments, pets, sports, toys, classifieds.",
            "items": {
              "type": "string"
            }
          },
          "vertical": {
            "title": "Vertical",
            "enum": [
              "general",
              "vehicles"
            ],
            "type": "string",
            "description": "Deal vertical preset. general = electronics/furniture/etc (default, Greenville schedule unchanged). vehicles = car/truck/SUV flipper mode with vehicle query presets + vehicle-tuned dealScore.",
            "default": "general"
          },
          "vehiclePresets": {
            "title": "Vehicle query presets",
            "type": "array",
            "description": "When vertical=vehicles (or set explicitly), expand searches for these presets: cars, trucks, suv. Empty + vertical=vehicles defaults to all three.",
            "items": {
              "type": "string"
            }
          },
          "vehicleYearMin": {
            "title": "Vehicle year min",
            "minimum": 0,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional. Keep listings whose parsed year (from title/description text) is >= this. 0 = no min. Requires scrapeable year in listing text.",
            "default": 0
          },
          "vehicleYearMax": {
            "title": "Vehicle year max",
            "minimum": 0,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional. Keep listings whose parsed year is <= this. 0 = no max.",
            "default": 0
          },
          "vehicleMake": {
            "title": "Vehicle make filter",
            "type": "string",
            "description": "Optional. Keep listings whose parsed make (from title/description) contains this string (e.g. Honda, Toyota, Ford). Empty = no make filter."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Search radius in kilometers (best-effort; FB UI may use miles).",
            "default": 40
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Optional precise pin latitude (memo23). Provide longitude too. Combined with radiusKm on search URLs."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Optional precise pin longitude (memo23). Provide latitude too. Combined with radiusKm on search URLs."
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "Filter out listings cheaper than this (0 = no min).",
            "default": 0
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Filter out listings more expensive than this (0 = no max).",
            "default": 0
          },
          "daysSinceListed": {
            "title": "Days since listed",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Only keep listings posted within this many days.",
            "default": 14
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum listings to push to the dataset (across all cities/queries).",
            "default": 50
          },
          "includeDetails": {
            "title": "Include listing details",
            "type": "boolean",
            "description": "Visit each listing page for description (slower; live mode only).",
            "default": false
          },
          "newOnly": {
            "title": "New listings only",
            "type": "boolean",
            "description": "Skip IDs already stored in KeyValueStore (deal-radar-seen-ids). Same as onlyNewListings.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional HTTP POST of each new listing JSON."
          },
          "discordWebhook": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "Optional Discord incoming webhook for new listing alerts."
          },
          "demoMode": {
            "title": "Demo mode",
            "type": "boolean",
            "description": "Load bundled demo listings (no cookies, no live scrape, no Actor.charge).",
            "default": false
          },
          "sessionCookies": {
            "title": "Facebook session cookies",
            "type": "string",
            "description": "REQUIRED for live mode. Paste Cookie header or c_user=...; xs=... from a logged-in browser (Chrome DevTools → Application → Cookies → facebook.com). Anonymous scraping does not work. Not needed for demoMode."
          },
          "storageStateJson": {
            "title": "Playwright storageState JSON",
            "type": "string",
            "description": "Optional alternative to sessionCookies: paste Playwright storageState JSON (cookies + origins) from a logged-in context."
          },
          "condition": {
            "title": "Condition",
            "type": "array",
            "description": "Item condition(s) to include (curious_coder parity). Leave empty for any. Allowed values: new, used_like_new, used_good, used_fair.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "",
              "creation_time_descend",
              "price_ascend",
              "price_descend",
              "distance_ascend"
            ],
            "type": "string",
            "description": "Marketplace search sort (curious_coder). Applies when building search URLs.",
            "default": ""
          },
          "deliveryMethod": {
            "title": "Delivery method",
            "enum": [
              "",
              "local_pickup",
              "shipping"
            ],
            "type": "string",
            "description": "Filter by delivery (curious_coder). Best-effort URL param.",
            "default": ""
          },
          "onlyWithPhotos": {
            "title": "Only listings with photos",
            "type": "boolean",
            "description": "Skip text-only listings without an image (memo23/curious_coder media pattern).",
            "default": false
          },
          "allPhotos": {
            "title": "All photos",
            "type": "boolean",
            "description": "When true, collect full photo URL arrays (photos[]) from listing cards and detail pages when available. Always outputs photos[] with at least the primary imageUrl when present.",
            "default": false
          },
          "onlyNewListings": {
            "title": "Only new/changed listings (alias)",
            "type": "boolean",
            "description": "Alias of New listings only — remembers scraped IDs across runs (curious_coder onlyNewListings).",
            "default": false
          },
          "availability": {
            "title": "Availability",
            "enum": [
              "",
              "in_stock",
              "out_of_stock"
            ],
            "type": "string",
            "description": "Filter by stock status (curious_coder / memo23). Applied as Marketplace URL param and post-filter on listing.availability / availabilityStatus / inStock. Empty = any.",
            "default": ""
          },
          "untilDate": {
            "title": "Until date (listed on/after)",
            "type": "string",
            "description": "YYYY-MM-DD. Keep listings listed on or after this date (curious_coder untilDate). Drops when listedAt < untilDate start-of-day UTC; when only daysSinceListed is present, approximates vs Date.now()."
          },
          "strictFiltering": {
            "title": "Strict filtering",
            "type": "boolean",
            "description": "When true, drop listings missing a location match against cities/locations OR missing required fields (title + price + url). Echoed on filtersApplied.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify proxy settings. Live Marketplace still requires session cookies; proxy country can help match regional results.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}