{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Marketplace Scraper",
    "description": "Scrape Facebook Marketplace search results, listing details, prices, photos, sellers, locations, and item status into clean structured data. Perfect for SEO and AI agents, MCP optimized.",
    "version": "1.0",
    "x-build-id": "IM495dq7s7FpeE4OV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~facebook-marketplace-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-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/khadinakbar~facebook-marketplace-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-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/khadinakbar~facebook-marketplace-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Marketplace search terms, for example bikes, sofas, apartments, iPhone, or office chairs.",
            "items": {
              "type": "string"
            }
          },
          "itemUrls": {
            "title": "Item URLs",
            "type": "array",
            "description": "Direct Facebook Marketplace item URLs to scrape in detail.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "itemIds": {
            "title": "Item IDs",
            "type": "array",
            "description": "Direct Marketplace numeric listing IDs. Use this when you know the item ID but do not have the full URL.",
            "items": {
              "type": "string"
            }
          },
          "locationQuery": {
            "title": "Location query",
            "type": "string",
            "description": "City or place to resolve into Marketplace latitude and longitude before search. Example: Austin, TX."
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Search latitude. If omitted, location query is used."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Search longitude. If omitted, location query is used."
          },
          "radiusKm": {
            "title": "Radius in kilometers",
            "minimum": 1,
            "maximum": 500,
            "type": "number",
            "description": "Marketplace search radius around the resolved coordinates.",
            "default": 40
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "number",
            "description": "Optional minimum listing price."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "number",
            "description": "Optional maximum listing price."
          },
          "maxListings": {
            "title": "Maximum listings",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum search listing records to save across all search queries.",
            "default": 100
          },
          "maxPages": {
            "title": "Maximum pages per query",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum provider result pages to request per search query.",
            "default": 5
          },
          "countPerPage": {
            "title": "Count per page",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of listings requested from the provider per page.",
            "default": 24
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "suggested",
              "distance_ascend",
              "creation_time_descend",
              "price_ascend",
              "price_descend"
            ],
            "type": "string",
            "description": "Provider-side Marketplace ordering.",
            "default": "suggested"
          },
          "deliveryMethod": {
            "title": "Delivery method",
            "enum": [
              "all",
              "local_pick_up",
              "shipping"
            ],
            "type": "string",
            "description": "Optional Marketplace delivery filter.",
            "default": "all"
          },
          "condition": {
            "title": "Condition",
            "enum": [
              "all",
              "new",
              "used_like_new",
              "used_good",
              "used_fair"
            ],
            "type": "string",
            "description": "Optional item condition filter.",
            "default": "all"
          },
          "dateListed": {
            "title": "Date listed",
            "enum": [
              "all",
              "last_24_hours",
              "last_7_days",
              "last_30_days"
            ],
            "type": "string",
            "description": "Optional Marketplace date-listed filter.",
            "default": "all"
          },
          "availability": {
            "title": "Availability",
            "enum": [
              "in_stock",
              "sold",
              "all"
            ],
            "type": "string",
            "description": "Optional listing availability filter.",
            "default": "in_stock"
          },
          "startCursor": {
            "title": "Start cursor",
            "type": "string",
            "description": "Optional provider pagination cursor from RUN_SUMMARY.nextCursors."
          },
          "dataSource": {
            "title": "Data source",
            "enum": [
              "auto",
              "provider"
            ],
            "type": "string",
            "description": "Provider mode uses configured ScrapeCreators or SociaVault APIs. Auto currently resolves to provider mode because Facebook Marketplace is login-heavy.",
            "default": "auto"
          },
          "providerOrder": {
            "title": "Provider order",
            "enum": [
              "scrapecreators-first",
              "sociavault-first",
              "scrapecreators-only",
              "sociavault-only"
            ],
            "type": "string",
            "description": "Choose which managed provider API is tried first.",
            "default": "scrapecreators-first"
          },
          "includeItemDetails": {
            "title": "Include item details",
            "type": "boolean",
            "description": "Fetch detailed item records for each search listing. This costs one item-detail provider request per listing.",
            "default": false
          },
          "includeLocationResults": {
            "title": "Include location results",
            "type": "boolean",
            "description": "Save location lookup results to the dataset when location query is used.",
            "default": true
          },
          "includeRawData": {
            "title": "Include raw provider data",
            "type": "boolean",
            "description": "Include raw source objects in each dataset row for debugging and custom downstream parsing.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}