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

Facebook Marketplace scraper that collects public listing titles, prices, locations, sellers, and photos so resellers can research local markets without manual copying.

- **URL**: https://apify.com/coder_luffy/facebook-marketplace-scraper.md
- **Developed by:** [Luffy](https://apify.com/coder_luffy) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

![Facebook Marketplace Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/facebook-marketplace-scraper-cover.png)

## Facebook Marketplace Scraper

Facebook Marketplace scraper for public listings. Paste a Marketplace search URL or a keyword, run the actor, and get title, price, location, seller, and photo into a clean dataset you can export to JSON, CSV, or Excel.

It works on public Marketplace pages only. Content that requires a login is out of scope.

### What data does this actor extract

| Field | Meaning |
|-------|---------|
| `listingId` | Marketplace listing id |
| `listingTitle` | Public listing title |
| `price` | Formatted asking price |
| `priceAmount` | Numeric price amount when present |
| `strikethroughPrice` | Previous or crossed-out price when present |
| `city` | City from the listing location |
| `state` | State or region |
| `locationDisplay` | Broader location display name |
| `sellerName` | Public seller name when available |
| `sellerId` | Public seller id when available |
| `photoUrl` | Primary listing photo URL |
| `categoryId` | Marketplace category id |
| `isSold` / `isPending` / `isLive` | Listing status flags |
| `creationTime` | Creation time when present |
| `listingUrl` | Public item URL |
| `sourceUrl` | Search or category URL the row came from |
| `scrapedAt` | ISO timestamp for when the row was saved |

### Use cases

- Research local resale prices for furniture, bikes, or electronics before you buy or sell
- Price your own listing by comparing near-identical items in the same city
- Spot underpriced goods to review by hand against the local median
- Compare used car asking prices across metro areas
- Size supply for a category such as strollers or gaming consoles
- Schedule deal alerts into Sheets, Make, Zapier, or n8n

### How to run

1. Add one or more public Marketplace URLs under `startUrls`, or set `searchQuery` with a `location` slug such as `nyc`.
2. Optionally set price, sort, days-listed, or condition filters.
3. Set `maxItems` if you want more than the default of 3 (up to 1000).
4. Start the run and download the dataset.

A URL that returns no listings writes an error row and the run continues with the next URL.

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `startUrls` | array | NYC bike search | Public Marketplace URLs |
| `searchQuery` | string | empty | Optional keyword used to build a search URL |
| `location` | string | `nyc` | Location slug used with `searchQuery` |
| `minPrice` | integer | empty | Minimum asking price |
| `maxPrice` | integer | empty | Maximum asking price |
| `sortBy` | string | empty | `best_match`, `creation_time_descend`, `price_ascend`, `price_descend`, or `distance_ascend` |
| `daysSinceListed` | string | empty | `1`, `7`, or `30` |
| `itemCondition` | string | empty | `new` or `used` |
| `radiusKm` | integer | empty | Search radius in kilometers from the location center |
| `maxItems` | integer | 3 | Max listings to save (hard cap 1000) |
| `requestTimeoutSecs` | integer | 60 | Per-request timeout in seconds |

#### Example input

```json
{
  "searchQuery": "bike",
  "location": "nyc",
  "minPrice": 100,
  "maxPrice": 400,
  "sortBy": "price_ascend",
  "daysSinceListed": "7",
  "itemCondition": "used",
  "radiusKm": 40,
  "maxItems": 50,
  "requestTimeoutSecs": 60
}
```

### Example output

```json
{
  "listingId": "2417574965318193",
  "listingTitle": "Diamondback Hook Mountain Bike",
  "price": "$80",
  "priceAmount": "80.00",
  "strikethroughPrice": "$120",
  "city": "Staten Island",
  "state": "NY",
  "locationDisplay": "New York, New York",
  "sellerName": "Jonny Zoe",
  "sellerId": "100035780016700",
  "photoUrl": "https://scontent.xx.fbcdn.net/v/example.jpg",
  "categoryId": "1658310421102081",
  "isSold": false,
  "isPending": false,
  "isLive": true,
  "creationTime": 1793466354,
  "listingUrl": "https://www.facebook.com/marketplace/item/2417574965318193",
  "sourceUrl": "https://www.facebook.com/marketplace/nyc/search?query=bike",
  "scrapedAt": "2026-11-02T01:00:00+00:00",
  "error": null
}
```

### FAQ

**How many listings can one run collect?**
Up to `maxItems`, with a hard maximum of 1000 listings per run.

**Can I scrape private or logged-in only listings?**
No. This actor only targets public Marketplace pages.

**What happens if a URL fails?**
The actor saves an error row for that URL and continues with the remaining URLs.

**Do I need a Facebook account?**
No. It only reads public Marketplace content.

**Can I schedule recurring runs?**
Yes. Use Apify schedules and push the dataset into Sheets, Make, Zapier, or n8n.

### Trademark notice

Facebook Marketplace and related names, logos, and trademarks belong to their respective owners. Their use here only identifies the source of the data and does not imply affiliation, sponsorship, endorsement, or partnership.

### Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or otherwise officially associated with Facebook Marketplace or its owners. All data is collected from publicly available sources. Users are responsible for complying with the source's terms of use, rate limits, and attribution or licensing requirements.

### Is web scraping legal

This Actor only collects publicly available data from Facebook Marketplace, without logging in. Scraping public data is generally legal, but how you use it matters.

- **Personal data.** If results include personal data (names, emails, profile details), laws such as the GDPR in the EU and the CCPA in California may apply. Only collect and store personal data when you have a legitimate reason.
- **Copyright.** Some content may be protected by copyright. Do not republish full copyrighted content without permission.
- **Legal advice.** This is general information, not legal advice. If you are unsure, consult a lawyer.

To learn more, read Apify's guide [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

![Facebook Marketplace Scraper CTA](https://images.bigibyte.com/cdn-cgi/image/width=840,height=360,fit=cover,format=webp/apify-actors-covers/facebook-marketplace-scraper-cta.png)

# Actor input Schema

## `startUrls` (type: `array`):

Public Facebook Marketplace URLs to scrape (for example a city search results page).

## `searchQuery` (type: `string`):

Optional keyword used to build a Marketplace search URL when you do not paste startUrls. Combined with location.

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

Marketplace location slug used with searchQuery (for example nyc, chicago, london).

## `minPrice` (type: `integer`):

Only include listings at or above this asking price (same currency as the Marketplace page).

## `maxPrice` (type: `integer`):

Only include listings at or below this asking price (same currency as the Marketplace page).

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

Marketplace sort order for results.

## `daysSinceListed` (type: `string`):

Only include listings posted within this many days. Marketplace commonly supports 1, 7, and 30.

## `itemCondition` (type: `string`):

Filter by public listing condition when Marketplace exposes it for the category.

## `radiusKm` (type: `integer`):

Limit results to this distance from the Marketplace location center, in kilometers.

## `maxItems` (type: `integer`):

Maximum number of listings to save per run. Default is 3 to keep test runs cheap. Raise up to 1000 when you need a larger export.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds. Use 60+ for busy Marketplace search pages.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/marketplace/nyc/search?query=bike"
    }
  ],
  "searchQuery": "bike",
  "location": "nyc",
  "maxItems": 3,
  "requestTimeoutSecs": 60
}
```

# Actor output Schema

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

No description

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/marketplace/nyc/search?query=bike"
        }
    ],
    "location": "nyc"
};

// Run the Actor and wait for it to finish
const run = await client.actor("coder_luffy/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 = {
    "startUrls": [{ "url": "https://www.facebook.com/marketplace/nyc/search?query=bike" }],
    "location": "nyc",
}

# Run the Actor and wait for it to finish
run = client.actor("coder_luffy/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 '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/marketplace/nyc/search?query=bike"
    }
  ],
  "location": "nyc"
}' |
apify call coder_luffy/facebook-marketplace-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,coder_luffy/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/d35NXXL8EVnxWODh4/builds/K5bwO48feObTSS2CC/openapi.json
