# Facebook Marketplace Scraper (`devcake/facebook-marketplace-scraper`) Actor

Facebook Marketplace scraper for finding public listings by keyword, location, price, condition, and category. Export results to CSV, Excel, or JSON.

- **URL**: https://apify.com/devcake/facebook-marketplace-scraper.md
- **Developed by:** [devcake](https://apify.com/devcake) (community)
- **Categories:** Social media, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Scrape and export public Facebook Marketplace listings

**Collect public Facebook Marketplace listings in a clean, ready-to-use table.** This Actor searches by keyword or browses Facebook Marketplace search and category pages, applies practical filters, and exports normalized results through an Apify Dataset.

No Facebook login is required. The Actor only reads information Facebook shows publicly and never creates, edits, buys, sells, or messages about listings.

### 🔎 What can this Facebook Marketplace scraper do?

- 🔍 Run one or more keyword searches, with a separate listing limit for each query.
- 🗂️ Browse Marketplace search or category links and numeric category IDs.
- 📍 Filter by location, radius, price, condition, listing date, delivery method, and availability.
- ↕️ Sort listings by best match, newest, price, or distance.
- 📄 Optionally enrich search results with fuller descriptions, photos, videos, public seller information, and category-specific details.
- 🧹 Remove duplicate listing IDs found across multiple searches or sources.
- 📦 Save normalized results to an Apify Dataset for export or integration.

The Actor requires at least one search query or one Marketplace link/category ID. When `queries` contains a value, it takes priority and `categoryUrlsOrIds` is ignored.

### 🚀 How to scrape Facebook Marketplace listings

1. 🔍 Enter a phrase such as `office chair` in **Search queries**. To browse instead, clear the queries and add a Marketplace search/category link or numeric category ID.
2. 🎛️ Choose the listing limit and any location, price, condition, date, delivery, availability, or sorting options.
3. 📄 Enable **Include listing details** when you need richer listing-page data. Detail requests take longer than search-only runs.
4. ▶️ Click **Run**.
5. 📥 Open the **Dataset** tab to preview or export the results.

### ⚙️ Input configuration

The table below mirrors the current `.actor/input_schema.json` fields.

| Input | Type | Default | What it does |
|---|---|---:|---|
| `queries` | Array of strings | `office chair` prefill | Runs each keyword as a separate search. If non-empty, these queries take priority over `categoryUrlsOrIds`. |
| `categoryUrlsOrIds` | Array of strings | `[]` | Accepts HTTPS Facebook Marketplace search, browse, city, or category links, plus numeric category IDs. Listing item URLs are not accepted here. |
| `maxItemsPerQuery` | Integer | `50` | Returns at most this many listings for each query, link, or category ID. Allowed range: 1–500. |
| `includeListingDetails` | Boolean | `false` | Opens listing pages to enrich results with fuller descriptions, media, seller information, and category details when available. With the current runtime defaults, up to 100 search results are enriched per run. |
| `location` | String | Empty | Sets a city, state, country, ZIP code, or Marketplace location slug for keyword/category-ID searches. |
| `radiusKm` | Number | Not set | Sets the search radius around the selected location. Minimum: 0.1 km. |
| `minPrice` | Number | Not set | Keeps listings at or above this price in the Marketplace currency. Minimum: 0. |
| `maxPrice` | Number | Not set | Keeps listings at or below this price in the Marketplace currency. Minimum: 0. |
| `sortBy` | Select | `best_match` | Sorts by best match, newest first, price low-to-high, price high-to-low, or nearest first. |
| `conditions` | Multi-select | `[]` | Filters for new, used—like new, used—good, and/or used—fair listings. |
| `daysSinceListed` | Integer | Not set | Keeps listings posted within the selected number of days. Allowed range: 1–365. |
| `untilDate` | String | Not set | Keeps listings posted on or after this date. Format: `YYYY-MM-DD`. |
| `deliveryMethods` | Multi-select | `[]` | Filters for local pickup, shipping, or both. |
| `availability` | Select | `in_stock` | Returns all listings, available listings only, or sold/pending listings. |
| `proxyConfiguration` | Object | Apify Residential, US | Controls the connection used for Facebook requests. The default usually works best. |

The Actor applies the configured filters whenever Facebook provides enough data to evaluate them. A supplied Marketplace URL also retains the search context encoded in that URL. If Facebook omits a field needed to verify a filter, the result can be retained and identified through `filterUnverifiedFields` and `filtersVerified` instead of having missing data guessed.

#### Example input

```json
{
  "queries": [
    "office chair",
    "standing desk"
  ],
  "categoryUrlsOrIds": [],
  "maxItemsPerQuery": 25,
  "includeListingDetails": true,
  "location": "San Francisco, California",
  "radiusKm": 25,
  "minPrice": 20,
  "maxPrice": 300,
  "sortBy": "creation_time_descend",
  "conditions": [
    "used_like_new",
    "used_good"
  ],
  "daysSinceListed": 7,
  "deliveryMethods": [
    "local_pick_up"
  ],
  "availability": "in_stock",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

### 📦 What Facebook Marketplace data can you extract?

| Data group | Examples |
|---|---|
| **Listing** | ID, URL, title, description, condition, attributes, category, and inventory count |
| **Price** | Formatted price, numeric amount, currency, price type, previous price, and price range |
| **Location** | Place name, city, state, postal code, coordinates, and calculated distance |
| **Media** | Main image, photo gallery, and video URLs |
| **Availability** | Available, sold, pending, live status, and delivery types |
| **Seller** | Public seller ID, name, profile URL, profile image, and business status |
| **Category details** | Vehicle and real-estate information when Facebook provides it |
| **Provenance** | Search query, requested source, source type, scrape time, and resolved search context |
| **Quality and detail status** | Verified/unverified filters, mismatch reasons, detail status, attempts, source, and errors |

Search results may already contain many of these fields. Enabling `includeListingDetails` gives the Actor a chance to enrich each result from its listing page. Missing information is left empty rather than guessed, and seller information is limited to publicly visible fields.

### 📤 Export and use your Marketplace data

Results appear in an Apify **Dataset**, the downloadable table for the run. Preview it in the browser or export it as Excel, CSV, JSON, XML, or another supported format. See the [Apify Dataset documentation](https://docs.apify.com/platform/storage/dataset).

You can also:

- 🗓️ Save the input as an Apify Task and run it on a schedule.
- 🔌 Connect the Dataset to other tools through Apify integrations or the Apify API.
- 🧾 Read the run summary and diagnostics from the Actor output links.

### 💳 Pricing, limits, and reliability

- 💰 Check the Actor's **Pricing** tab for current pricing and use Apify's spending limit to control your budget.
- 📊 `maxItemsPerQuery` is a per-query/source cap; duplicate IDs are merged before the Dataset is written.
- ⏳ Enabling listing details adds requests and can increase runtime and cost.
- 🌐 Facebook may limit public access, omit fields, or vary results by location and connection.
- 🛠️ If a run returns no listings, try a broad query, fewer filters, a recognized Marketplace location, or the default proxy settings.

### ❓ Frequently asked questions

#### Can Apify scrape Facebook Marketplace?

Yes. This Actor collects publicly visible Marketplace search and category results and saves normalized records to an Apify Dataset. Results depend on what Facebook exposes publicly for the selected location and connection.

#### Do I need a Facebook account?

No. The Actor does not require Facebook credentials and does not access private Marketplace data, messages, or account-only actions.

#### Can I use a Facebook Marketplace URL instead of a keyword?

Yes. Clear `queries`, then add an HTTPS Facebook Marketplace search, browse, city, or category URL to `categoryUrlsOrIds`. You can also use a numeric Marketplace category ID. Direct `/marketplace/item/...` listing URLs are not part of the current input schema.

#### Why are some output fields empty?

Facebook does not expose every field on every search result or listing page. Missing values are left empty. Enable `includeListingDetails` to request richer data, while keeping in mind that a detail page can still be partial or unavailable.

#### Is Facebook Marketplace scraping legal?

Legality depends on the data, location, purpose, and use. Public access does not make every use automatically permitted. Follow applicable laws, Facebook's terms, privacy rules, and reasonable limits. Seek legal advice when needed.

# Actor input Schema

## `queries` (type: `array`):

Enter one or more things to search for, such as office chair or mountain bike. Each search is run separately.

## `categoryUrlsOrIds` (type: `array`):

Optional. Paste Marketplace search or category links, or enter category IDs. Use this when you do not want to search by words.

## `maxItemsPerQuery` (type: `integer`):

Maximum number of listings to return for each search or link.

## `includeListingDetails` (type: `boolean`):

Include fuller descriptions, photos, videos, seller information, and category details. This may take longer.

## `location` (type: `string`):

Optional city, state, country, ZIP code, or Marketplace location. Examples: San Francisco, California; 94107; newyork.

## `radiusKm` (type: `number`):

Optional search radius around the selected location.

## `minPrice` (type: `number`):

Optional lowest price in the Marketplace currency.

## `maxPrice` (type: `number`):

Optional highest price in the Marketplace currency.

## `sortBy` (type: `string`):

Choose how to sort the results.

## `conditions` (type: `array`):

Only show listings with the selected condition.

## `daysSinceListed` (type: `integer`):

Only show listings posted within the last number of days you choose.

## `untilDate` (type: `string`):

Only show listings posted on or after this date. Use YYYY-MM-DD, for example 2026-01-01.

## `deliveryMethods` (type: `array`):

Choose local pickup, shipping, or both.

## `availability` (type: `string`):

Choose all listings, available listings, or sold and pending listings.

## `proxyConfiguration` (type: `object`):

The default settings usually work best. Change them only if you need a different connection.

## Actor input object example

```json
{
  "queries": [
    "office chair"
  ],
  "categoryUrlsOrIds": [],
  "maxItemsPerQuery": 50,
  "includeListingDetails": false,
  "location": "",
  "sortBy": "best_match",
  "conditions": [],
  "deliveryMethods": [],
  "availability": "in_stock",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `diagnostics` (type: `string`):

No description

## `changes` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "office chair"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("devcake/facebook-marketplace-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": ["office chair"] }

# Run the Actor and wait for it to finish
run = client.actor("devcake/facebook-marketplace-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "office chair"
  ]
}' |
apify call devcake/facebook-marketplace-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devcake/facebook-marketplace-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/mHWY3soh12wpbhEgj/builds/2YibtJZRK5w7zxWG5/openapi.json
