# Facebook Marketplace Scraper (`receptional_blender/fb-marketplace-listings`) Actor

Extract Facebook Marketplace search listings — title, price, currency, image, location, delivery options and availability — as clean structured records.

- **URL**: https://apify.com/receptional\_blender/fb-marketplace-listings.md
- **Developed by:** [Assia Fadli](https://apify.com/receptional_blender) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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

## Facebook Marketplace Scraper

Turn a Facebook Marketplace **search URL** into a clean, structured dataset of listings — title,
price, currency, thumbnail, location, delivery options and availability flags — ready to export as
JSON, CSV or Excel, or to pipe into your own tools.

The scraper opens each search page in a real (headful) Chrome, dismisses the login prompt, and
reads the listings straight from Facebook's own data feed as it scrolls, so you get exactly the
fields the site itself renders.

### What you get

One record per listing, for example:

```json
{
    "story_key": "28509434075314340",
    "listing_id": "9502906969742434",
    "image_url": "https://scontent.xx.fbcdn.net/v/t45.5328-4/....jpg",
    "price": {
        "formatted_amount": "DZD19,000",
        "amount_with_offset_in_currency": "14047",
        "amount": "19000.00"
    },
    "amount": "19000.00",
    "currency": "14047",
    "location": "Annaba",
    "title": "Promotion 2025 Tv Géant 32Pou",
    "delivery_types": ["IN_PERSON", "SHIPPING_OFFSITE"],
    "is_sold": false,
    "is_live": true,
    "is_pending": false,
    "is_viewer_seller": false
}
```

#### Output fields

| Field | Description |
| --- | --- |
| `story_key` | Feed-level identifier for the listing card |
| `listing_id` | Facebook's listing id |
| `image_url` | Primary listing photo URL |
| `price` | Full price object (`formatted_amount`, `amount`, `amount_with_offset_in_currency`) |
| `amount` | Numeric price amount |
| `currency` | Amount with the currency offset applied |
| `location` | City the item is listed in |
| `title` | Listing title |
| `delivery_types` | Available delivery methods (e.g. `IN_PERSON`, `SHIPPING_OFFSITE`) |
| `is_sold` / `is_live` / `is_pending` | Availability flags |
| `is_viewer_seller` | Whether the viewer owns the listing |

### Input

| Field | Type | Description |
| --- | --- | --- |
| `startUrls` | array | Facebook Marketplace **search** URLs to scrape. Run a search in your browser and paste the resulting URL. Multiple URLs are supported. |
| `maxListings` | integer | Maximum number of unique listings to deliver across the whole run. `0` (or empty) keeps scrolling until no new listings appear. Default `100`. |
| `proxyConfig` | object | Proxy settings. Apify Proxy is recommended — a bare datacenter IP is blocked quickly by Facebook. |

Example input:

```json
{
    "startUrls": [
        { "url": "https://www.facebook.com/marketplace/115562848457396/search?query=tv&exact=false" }
    ],
    "maxListings": 100,
    "proxyConfig": { "useApifyProxy": true }
}
```

### How it works

Facebook Marketplace loads its results through internal GraphQL (`/api/graphql/`) requests as you
scroll. The actor listens to those responses in a real Chrome session, maps each listing to the
record shape above, and pushes it to the dataset. Scrolling continues until the listing limit is
reached or the page stops returning new results.

### Pricing

This actor uses Apify's **pay-per-event** model. You are charged once per listing delivered, under
the `listing-scraped` event — so your cost scales directly with the number of listings you collect.
Set `maxListings` to keep runs within a predictable budget.

### Responsible use

Scrape only publicly visible search results and stay within Facebook's terms and applicable law.
Use reasonable request volumes and a proxy, and treat any personal data you collect responsibly.

### License

Released under the [MIT License](https://opensource.org/licenses/MIT). Maintained by **Assia Fadli**.

# Actor input Schema

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

Facebook Marketplace search-result pages to scrape. Paste the full URL of a search you ran in your browser (it usually contains a location id plus a `query=` term). Provide several to cover multiple searches or locations in one run. Each listing that appears while the page is scrolled becomes one output record.

## `maxListings` (type: `integer`):

Upper bound on the total number of listings scraped in one run (across all search URLs). The crawler stops as soon as this many unique listings have been delivered. Start small (e.g. 20) to validate a search, then raise it. Leave empty or 0 to keep scraping until scrolling stops producing new listings.

## `proxyConfig` (type: `object`):

Proxy applied to every request. Keeping Apify Proxy on reduces blocking and rate limiting on Facebook. You may pick specific groups or a country, or supply your own proxy URLs. Disabling proxy routes all traffic through a single datacenter IP, which Facebook blocks quickly.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/marketplace/115562848457396/search?query=tv&exact=false"
    },
    {
      "url": "https://www.facebook.com/marketplace/nyc/search?query=bike"
    }
  ],
  "maxListings": 200,
  "proxyConfig": {
    "useApifyProxy": true
  }
}
```

# 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/115562848457396/search?query=tv&exact=false"
        }
    ],
    "maxListings": 100,
    "proxyConfig": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("receptional_blender/fb-marketplace-listings").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/115562848457396/search?query=tv&exact=false" }],
    "maxListings": 100,
    "proxyConfig": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("receptional_blender/fb-marketplace-listings").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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/115562848457396/search?query=tv&exact=false"
    }
  ],
  "maxListings": 100,
  "proxyConfig": {
    "useApifyProxy": true
  }
}' |
apify call receptional_blender/fb-marketplace-listings --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=receptional_blender/fb-marketplace-listings",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BT0l752RHGAcIdowM/builds/1k52U70tcbPpVcPDF/openapi.json
