{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Marketplace & Product Intelligence Scraper",
    "description": "Extract Facebook Marketplace listings, vehicle specs, rental property data, and price analytics. Export JSON/CSV or query with AI agents via MCP.",
    "version": "1.0",
    "x-build-id": "eY6ogN2CnrPi4I8Oq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bytefoundry~facebook-marketplace-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bytefoundry-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/bytefoundry~facebook-marketplace-scraper/runs": {
      "post": {
        "operationId": "runs-sync-bytefoundry-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/bytefoundry~facebook-marketplace-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-bytefoundry-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Extraction Mode",
            "enum": [
              "search",
              "category",
              "listing",
              "seller"
            ],
            "type": "string",
            "description": "Extraction mode: 'search' to query marketplace listings by keyword; 'category' to browse a specific product category; 'listing' to extract details from specific listing URLs; 'seller' to retrieve all listings from a seller profile.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "The search term or product name to search on Facebook Marketplace (e.g. 'iPhone 15 Pro', 'Toyota Tacoma 4x4', 'mid century sofa'). Required when mode is 'search'.",
            "default": ""
          },
          "location": {
            "title": "Marketplace Location",
            "type": "string",
            "description": "Target marketplace location name, city, or Facebook location slug (e.g. 'new york', 'los angeles', 'austin', 'london', 'toronto'). Defaults to 'new york'.",
            "default": "new york"
          },
          "radiusMiles": {
            "title": "Search Radius (Miles)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Search radius in miles from the specified location. Allowed range: 5 to 500 miles.",
            "default": 40
          },
          "category": {
            "title": "Category Filter",
            "enum": [
              "all",
              "vehicles",
              "property-rentals",
              "property-sales",
              "electronics",
              "furniture",
              "clothing",
              "toys-games",
              "sports-outdoors",
              "home-garden",
              "office-supplies",
              "pet-supplies",
              "musical-instruments",
              "free-stuff"
            ],
            "type": "string",
            "description": "Filter listings by Facebook Marketplace category vertical. Select 'all' for general search.",
            "default": "all"
          },
          "condition": {
            "title": "Item Condition",
            "enum": [
              "any",
              "new",
              "used-like-new",
              "used-good",
              "used-fair",
              "refurbished"
            ],
            "type": "string",
            "description": "Filter items by condition.",
            "default": "any"
          },
          "minPrice": {
            "title": "Minimum Price",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum listing price filter in local currency. Set to 0 to include free listings.",
            "default": 0
          },
          "maxPrice": {
            "title": "Maximum Price",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum listing price filter in local currency. Set to 0 for unlimited.",
            "default": 0
          },
          "daysSinceListed": {
            "title": "Days Since Listed",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Filter listings by recency (e.g. 1 for last 24 hours, 7 for past week, 30 for past month). Set to 0 for all listings.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort Results By",
            "enum": [
              "best_match",
              "creation_time_descend",
              "price_ascend",
              "price_descend",
              "distance_ascend"
            ],
            "type": "string",
            "description": "Sorting criteria for search results.",
            "default": "best_match"
          },
          "listingUrls": {
            "title": "Listing URLs",
            "type": "array",
            "description": "Array of specific Facebook Marketplace listing URLs to scrape. Required when mode is 'listing'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sellerUrl": {
            "title": "Seller Profile URL",
            "type": "string",
            "description": "Facebook Marketplace seller profile URL. Required when mode is 'seller'.",
            "default": ""
          },
          "includeDetails": {
            "title": "Deep Listing Details (PDP)",
            "type": "boolean",
            "description": "When enabled, retrieves comprehensive item details including full seller history, granular vehicle specs (VIN, title status), and full property terms. Slightly slower due to secondary GraphQL queries.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum Items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of listings to collect. Set to 0 for unlimited (subject to account budget). Defaults to 50.",
            "default": 50
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "json",
              "markdown",
              "both"
            ],
            "type": "string",
            "description": "Output formatting mode: 'json' for raw structured JSON only; 'markdown' for token-optimized LLM context summaries; 'both' for structured JSON with embedded `_markdown_summary` strings.",
            "default": "both"
          },
          "sessionCookies": {
            "title": "Optional Session Cookies",
            "type": "string",
            "description": "Optional raw cookie string or JSON array (e.g. containing c_user, xs, datr) for authenticated access. When omitted, the actor uses autonomous stealth browser session acquisition or public SSR feeds.",
            "default": ""
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy group settings. Residential proxies are strongly recommended to prevent Meta IP blocks.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}