{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Marketplace Scraper",
    "description": "Scrape Facebook Marketplace by keyword, category and city: prices, locations, sellers, photos, descriptions and vehicle data, plus new-listing and price-drop alerts. $1 per 1,000, usage included; failed pages and duplicates are free.",
    "version": "0.1",
    "x-build-id": "fFsO1HpBlEc3WMRuh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ragnum~facebook-marketplace-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ragnum-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/ragnum~facebook-marketplace-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ragnum-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/ragnum~facebook-marketplace-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ragnum-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": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "What to search for, e.g. \"bicycle\" or \"honda civic\". Each query runs once per location. Leave empty when you only use categories or start URLs. With no queries, categories or start URLs at all, the scraper searches \"bicycle\".",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations (Facebook location slugs)",
            "type": "array",
            "description": "Facebook Marketplace location slugs: the part after /marketplace/ in a Marketplace URL, e.g. nyc, la, chicago, london, toronto, sydney. Each query and category runs once per location. The proxy country follows the location (US, UK, Canada, Australia and more are built in), so results and prices are local. For any other place, use latitude/longitude, or set the proxy country under Advanced.",
            "default": [
              "nyc"
            ],
            "items": {
              "type": "string"
            }
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Search around these coordinates instead of a location slug (give longitude too). Example: 41.8781 for Chicago. Set the proxy country under Advanced to the coordinates' country for local results and currency."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Longitude for the coordinates search, e.g. -87.6298 for Chicago."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Search radius sent to Facebook. Facebook treats it as a hint and can return listings further away; every detail row carries distanceKm so you can filter, or turn on \"Strict radius\".",
            "default": 40
          },
          "strictRadius": {
            "title": "Strict radius",
            "type": "boolean",
            "description": "Drop listings whose distance from the search point is larger than the radius. Needs listing coordinates, which come with details: works together with \"Include details\". Dropped listings are not charged.",
            "default": false
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Facebook Marketplace URLs to scrape as they are: searches (https://www.facebook.com/marketplace/nyc/search?query=bike&maxPrice=300), categories (https://www.facebook.com/marketplace/london/furniture) and single listings (https://www.facebook.com/marketplace/item/1234567890/). Listing URLs return full detail rows.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Browse whole categories at each location (no query needed). Each category runs once per location.",
            "items": {
              "type": "string",
              "enum": [
                "apparel",
                "bicycles",
                "classifieds",
                "electronics",
                "entertainment",
                "family",
                "free",
                "furniture",
                "garden",
                "hobbies",
                "home",
                "home-improvements",
                "instruments",
                "office-supplies",
                "pets",
                "sports",
                "toys"
              ],
              "enumTitles": [
                "Apparel",
                "Bicycles",
                "Classifieds",
                "Electronics",
                "Entertainment",
                "Family",
                "Free stuff",
                "Furniture",
                "Garden & outdoor",
                "Hobbies",
                "Home goods",
                "Home improvement supplies",
                "Musical instruments",
                "Office supplies",
                "Pet supplies",
                "Sporting goods",
                "Toys & games"
              ]
            }
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "number",
            "description": "Lowest price, in the local currency of the location (e.g. dollars in nyc, pounds in london)."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "number",
            "description": "Highest price, in the local currency of the location."
          },
          "conditions": {
            "title": "Item condition",
            "type": "array",
            "description": "Only listings in these conditions. Leave empty for any condition.",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "used_like_new",
                "used_good",
                "used_fair"
              ],
              "enumTitles": [
                "New",
                "Used – like new",
                "Used – good",
                "Used – fair"
              ]
            }
          },
          "daysSinceListed": {
            "title": "Listed within",
            "enum": [
              "any",
              "1",
              "7",
              "30"
            ],
            "type": "string",
            "description": "Only listings posted within this many days.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "price_asc",
              "price_desc",
              "distance"
            ],
            "type": "string",
            "description": "Order of results, as on Facebook.",
            "default": "relevance"
          },
          "includeDetails": {
            "title": "Include details",
            "type": "boolean",
            "description": "Also read each listing's detail page: description, all photos, exact coordinates and distanceKm, condition, attributes, and vehicle data (make, model, year, mileage, transmission, fuel, colors, title status). A row with details is charged as one \"listing-detail\" event instead of a \"listing\" event.",
            "default": false
          },
          "incremental": {
            "title": "Only new and changed listings (monitoring)",
            "type": "boolean",
            "description": "Compare with earlier runs of the same search and return only NEW listings, PRICE_CHANGED listings (with previousPrice) and STATUS_CHANGED listings. Unchanged listings are skipped and not charged. Ideal for schedules and price-drop alerts. Removals are not reported: listings that drop out of results are not necessarily sold.",
            "default": false
          },
          "newListingsOnly": {
            "title": "Only listings posted since the last run",
            "type": "boolean",
            "description": "Monitoring: skip NEW listings that were posted before the previous run started. Facebook shows logged-out visitors a limited set of results that changes between runs, so older listings can appear for the first time; with this on you only get listings that are actually new, plus price and status changes. Skipped listings are not charged. The first run returns everything as a baseline. Turns on monitoring automatically. Works best with \"Sort by: Newest first\".",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the saved state used by monitoring mode. By default it is derived from your queries, locations, categories and filters, so the same input continues the same monitor. Set it to share one monitor between slightly different inputs, or to start a fresh one."
          },
          "maxItemsPerSearch": {
            "title": "Max listings per search",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Stop each search (one query or category at one location, or one start URL) after this many unique listings.",
            "default": 20
          },
          "maxPagesPerSearch": {
            "title": "Max result pages per search",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Hard cap on result pages read per search. The first page has about 12–15 listings, each further page about 24–29. Raise it together with \"Max listings per search\" (e.g. 10 pages for ~250 listings).",
            "default": 3
          },
          "maxRetriesPerPage": {
            "title": "Max retries per page",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How often a page that fails (blocked, timeout) is retried before it is given up. Failed attempts are never charged.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Managed for you, with the country matched to each location (included in the price). Set a country here to use it for every search, e.g. for latitude/longitude searches or locations outside the built-in list.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}