{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook marketplace scraper",
    "description": "Scrape facebook marketplace listings from search URLs or using filters and get complete details including seller info. ✅ Option to get only new listings* across multiple runs. 💰 Cost: $1.5 per 1K",
    "version": "1.7",
    "x-build-id": "yu2h4fY9gulsLn1tI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/curious_coder~facebook-marketplace/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-curious_coder-facebook-marketplace",
        "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/curious_coder~facebook-marketplace/runs": {
      "post": {
        "operationId": "runs-sync-curious_coder-facebook-marketplace",
        "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/curious_coder~facebook-marketplace/run-sync": {
      "post": {
        "operationId": "run-sync-curious_coder-facebook-marketplace",
        "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": {
          "urls": {
            "title": "Facebook marketplace URLs",
            "type": "array",
            "description": "Search URLs (e.g. [marketplace search](https://www.facebook.com/marketplace/nyc/cars)) or individual listing URLs (e.g. https://www.facebook.com/marketplace/item/3195892660712281/). Open in incognito to verify accessibility. Optional if Filters are set.",
            "items": {
              "type": "string"
            }
          },
          "searchKeyword": {
            "title": "Search keyword",
            "type": "string",
            "description": "Search term for Marketplace listings (e.g. couch, used bike)."
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "To avoid matching wrong locations with similar names use location in the format \"City, State, Country\" (e.g. \"Los Angeles, California, United States\", \"Brooklyn, New York, United States\"). Also supports postal codes. Resolved to exact coordinates via Facebook's location search. For full control, set Latitude/Longitude instead."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "type": "integer",
            "description": "This is always km regardless of region: Facebook's UI may display miles in mile-using regions (e.g. the US), but it converts to km for the request (selecting 80 miles becomes radius=128). So to target 80 miles, enter 128. Combine with Location (city name / postal code) or Latitude/Longitude."
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Center latitude for Filters-based searches. When set with Longitude, overrides the Location field (location name lookup is skipped). Ignored if you paste URLs above. Set Longitude too."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Center longitude for Filters-based searches. Use together with Latitude (and optionally Radius) to target an exact area; overrides Location when both coordinates are set. Ignored if you paste URLs above."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "",
              "creation_time_descend",
              "price_ascend",
              "price_descend",
              "distance_ascend"
            ],
            "type": "string",
            "description": "Order of the search results. Applies to Filters-based searches (ignored when you paste your own URLs).",
            "default": ""
          },
          "minPrice": {
            "title": "Min price",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum listing price, in the searched location's local currency (e.g. a search in India filters in ₹). The currency follows the location, not the proxy region."
          },
          "maxPrice": {
            "title": "Max price",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum listing price, in the searched location's local currency (e.g. a search in India filters in ₹). The currency follows the location, not the proxy region."
          },
          "condition": {
            "title": "Condition",
            "type": "array",
            "description": "Item condition(s) to include. 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": "Date listed",
            "enum": [
              "",
              "1",
              "7",
              "30"
            ],
            "type": "string",
            "description": "Only include listings posted within this window.",
            "default": ""
          },
          "availability": {
            "title": "Availability",
            "enum": [
              "",
              "in_stock",
              "out_of_stock"
            ],
            "type": "string",
            "description": "Filter by listing availability.",
            "default": ""
          },
          "deliveryMethod": {
            "title": "Delivery method",
            "enum": [
              "",
              "local_pickup",
              "shipping"
            ],
            "type": "string",
            "description": "Filter by how the item is delivered.",
            "default": ""
          },
          "getListingDetails": {
            "title": "Get listing details",
            "type": "boolean",
            "description": "Scraper will visit details page and extract more information",
            "default": true
          },
          "getAllListingPhotos": {
            "title": "Get all listing photos",
            "type": "boolean",
            "description": "When get listing details is enabled, fetch listing media (images). Set to false to skip media API calls and reduce requests by ~33%",
            "default": true
          },
          "strictFiltering": {
            "title": "Strict filtering",
            "type": "boolean",
            "description": "Exclude listings that are broad matches (outside location, similar items, etc.)",
            "default": false
          },
          "maxPagesPerUrl": {
            "title": "Max pages per URL",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of search pages to scrape per search URL."
          },
          "untilDate": {
            "title": "Until date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Scrape listings until this date (YYYY-MM-DD). Only works if Get listing details is enabled and search url is sorted by newest first or url contains `sortBy=creation_time_descend`"
          },
          "proxy": {
            "title": "Set proxy country",
            "type": "object",
            "description": "Set proxy country to your target marketplace region (e.g. US, IN, UK). Results depend on proxy region. Proxies are managed internally you only need to set proxy country in proxy input field."
          },
          "cookies": {
            "title": "Cookies",
            "type": "string",
            "description": "Facebook cookies for authenticated scraping. \n\nWhen provided, enables seller details scraping. \n\nRequires logged-in session cookies (`c_user` and `xs`). Accepts **Header string** (`name1=value1; name2=value2`) or **JSON** export. \n\nConcurrency is set to 1 and random delays are added when using cookies. Follow these steps to get the cookies: <ol> <li>Install [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) chrome extension</li> <li> Login to your facebook account </li> <li> Click on the extension icon > Export > Header string <em>or</em> JSON </li> <li>Paste the copied contents here</li> </ol> <p> <a href=https://youtu.be/YuKp9BlVgNM target=_blank><img src=https://www.youtube.com/s/desktop/66e817d4/img/favicon_32x32.png width=16px> Video - How to get cookies (0:14)</a>"
          },
          "onlyNewListings": {
            "title": "Scrape only new or changed listings",
            "type": "boolean",
            "description": "Remember scraped search listings across runs and skip unchanged items before fetching their details. Listings are scraped again when their price, availability, or other visible search-result content changes.",
            "default": false
          },
          "cacheStorageId": {
            "title": "Cache storage to use for existing listings",
            "type": "string",
            "description": "Key-value store shared by monitoring runs. Defaults to facebook-marketplace-listing-cache when empty. Use a separate store for each independent search/workflow so listings from different keywords or locations do not share one cache and get skipped"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}