{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Marketplace AI Deal Finder",
    "description": "Scrape Facebook Marketplace listings worldwide, get AI-powered market price comparison, and discover underpriced items for reselling. Works in any language — German, French, Japanese, Portuguese, and more.",
    "version": "1.0",
    "x-build-id": "wmhgLuKi7ZFFVXFzh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/webdatalabs~facebook-marketplace-deal-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-webdatalabs-facebook-marketplace-deal-finder",
        "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/webdatalabs~facebook-marketplace-deal-finder/runs": {
      "post": {
        "operationId": "runs-sync-webdatalabs-facebook-marketplace-deal-finder",
        "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/webdatalabs~facebook-marketplace-deal-finder/run-sync": {
      "post": {
        "operationId": "run-sync-webdatalabs-facebook-marketplace-deal-finder",
        "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": {
          "url": {
            "title": "Facebook Marketplace URL (optional)",
            "type": "string",
            "description": "Paste a direct Facebook Marketplace URL to skip location resolution. Example: https://www.facebook.com/marketplace/newyork/electronics"
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "City to search. Works worldwide: 'New York', 'Berlin, Germany', 'Tokyo, Japan', 'London, UK'",
            "default": "New York"
          },
          "category": {
            "title": "Category",
            "enum": [
              "electronics",
              "vehicles",
              "all",
              "property_rentals",
              "apparel",
              "classifieds",
              "entertainment",
              "family",
              "free",
              "garden",
              "hobbies",
              "home_goods",
              "home_improvement",
              "household_sales",
              "musical_instruments",
              "office_supplies",
              "pet_supplies",
              "sporting_goods",
              "toys_games"
            ],
            "type": "string",
            "description": "What type of items to find",
            "default": "electronics"
          },
          "searchQuery": {
            "title": "Search Query (optional)",
            "type": "string",
            "description": "Filter listings by keyword, e.g. 'iPhone 15', 'MacBook Pro', 'couch'"
          },
          "radius": {
            "title": "Search Radius (miles)",
            "minimum": 5,
            "maximum": 500,
            "type": "integer",
            "description": "How far from the location to search",
            "default": 25
          },
          "minPrice": {
            "title": "Min Price (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum listing price to include. Leave empty for no minimum."
          },
          "maxPrice": {
            "title": "Max Price (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum listing price to include. Leave empty for no maximum."
          },
          "maxListings": {
            "title": "Maximum Results",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many listings to return (max 200)",
            "default": 50
          },
          "enableDealScoring": {
            "title": "Enable Deal Scoring",
            "type": "boolean",
            "description": "Score listings by deal quality. Identifies brands/models via regex (+ GPT-4o-mini if OPENAI_API_KEY is set), then looks up real sold prices on eBay to estimate market value. Up to 6 unique products get eBay price data per run.",
            "default": true
          },
          "enableDeepScrape": {
            "title": "Enable Deep Scrape",
            "type": "boolean",
            "description": "Visit individual listing pages (up to 15) for full description, all photos, seller info, and condition. Slower but much richer data.",
            "default": false
          },
          "minDealScore": {
            "title": "Minimum Deal Score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only output listings scoring at or above this threshold. 0 = output everything, 20+ = potential deals, 40+ = good deals only.",
            "default": 0
          },
          "proxyCountry": {
            "title": "Proxy Country (optional)",
            "type": "string",
            "description": "ISO country code for proxy routing (e.g. US, DE, GB). Auto-detected from location if empty."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}