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

Scrape Facebook Marketplace listings by keyword, city or link: price, photos, description, location, posting time and vehicle specs. Search wide areas, watch for new listings with monitoring mode, and get only listings that match your filters. No login needed.

- **URL**: https://apify.com/calm_builder/facebook-marketplace-scraper.md
- **Developed by:** [Coder](https://apify.com/calm_builder) (community)
- **Categories:** Automation, E-commerce, Social media
- **Features:** Limited permissions
- **Stats:** 449 total users, 66 monthly users, 100.0% runs succeeded, 12 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.40 / 1,000 listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

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

Collect Facebook Marketplace listings by keyword, by vehicle make, or from any Marketplace link, with price, location, photos and status, and optionally the full listing: description, every photo and video, seller type, dealership contacts and vehicle specs. No login, no cookies.

Use it for **price monitoring**, **deal alerts**, **vehicle market analysis**, **inventory research** and **resale data pipelines**.

**New:** type any place as the location (`Toronto`, `Austin, Texas`, a postal code), cover a whole region with **Search radius**, filter by **delivery method**, and run on a schedule with **Only new listings** at no extra cost.

For Facebook Pages, Groups or profile posts, use the [Facebook Posts Scraper](https://apify.com/calm_builder/facebook-posts-scraper). For comments and replies, use the [Facebook Comments Scraper](https://apify.com/calm_builder/facebook-comments-scraper).

***

### What you get

Each row is **one Marketplace listing**:

| Section         | What it contains                                                        |
| --------------- | ----------------------------------------------------------------------- |
| **Identity**    | Listing ID, title, and link to the listing                              |
| **`price`**     | Formatted price, amount and currency                                    |
| **`location`**  | City, state or province, and full location label                        |
| **Media**       | Photo URLs (every photo, plus videos, with detailed information on)     |
| **Status**      | Sold and pending flags                                                  |
| **`category`**  | Marketplace category ID                                                 |
| **`creation_time`** | When the listing was posted                                         |
| **`subtitles`** | Facebook's short facts: mileage on vehicles (`145K km`), street address on property |
| **Extras**      | `delivery_options`, `is_live`, `previous_price` (when the price was reduced), `custom_title` (e.g. `2 beds · 1 bath`), `video_id`, `seller` (when shown) |
| **`sourceUrl`** | The search or link that found this listing                              |

With **Fetch detailed information** on (and always for listing links), each row also has the description, creation time, condition, delivery options, seller type and dealership contacts, vehicle details (mileage, VIN, colours, fuel, transmission ...) and every other field Facebook shows on the listing.

Results appear in the dataset while the run is going.

***

### Quick start

1. Add a row under **Search by keyword** (what + location) and/or **Search vehicles** (make + location).
2. Optionally set **Filters** (price, condition, date listed, delivery, availability, sort) and **Vehicle filters** (year, mileage, transmission).
3. Set **Maximum listings per search** (default `10`). Turn on **Fetch detailed information** if you need descriptions and seller details.
4. Click **Start**.

```json
{
  "keywordSearches": [
    { "query": "sectional sofa", "locationSlug": "Toronto" },
    { "query": "sectional sofa", "locationSlug": "Austin, Texas" }
  ],
  "maxPrice": 800,
  "conditions": ["used_good", "used_like_new"],
  "dateListed": "last_7_days",
  "maxListings": 50
}
```

```json
{
  "vehicleSearches": [{ "make": "honda", "locationSlug": "Montreal" }],
  "searchRadiusKm": 200,
  "vehicleMinYear": 2015,
  "vehicleMaxMileage": 120000,
  "vehicleTransmission": "automatic",
  "sortBy": "price_ascend",
  "maxListings": 100,
  "fetchDetails": true
}
```

***

### Input

#### What to search

**Search by keyword:** one row per search, **Search for** + **Location**.
**Search vehicles:** one row per search, **Make** (or All) + **Location**.

**Location** accepts a city name (`Toronto`, `Austin, Texas`, `Lahore`), a postal code, or the city part of a Marketplace link (`sanfrancisco` from `facebook.com/marketplace/sanfrancisco`). If Facebook does not know a location, the log says so and the other searches carry on.

#### Area

Facebook shows logged-out visitors listings within about **65 km** of one point, even when its own page offers a bigger radius. **Search radius (km)** (default `65`, up to `500`) covers a wider area for you: the region is searched as several overlapping 65 km areas, one page from each in turn, and duplicates are removed. **Maximum listings per search** still caps each row.

#### Filters (keyword and vehicle rows)

| Field               | Options                                                       |
| ------------------- | ------------------------------------------------------------- |
| **Minimum / Maximum price** | In the local currency                                 |
| **Condition**       | New, used – like new, used – good, used – fair (keyword rows only: most vehicle listings have no condition set) |
| **Date listed**     | Any time, last 24 hours, last 7 days, last 30 days            |
| **Delivery method** | All, local pickup, shipping (shipping is mostly a US option)  |
| **Availability**    | Available or sold                                             |
| **Sort**            | Suggested, newest, price, distance; mileage and year for vehicles |
| **Exact keyword match** | Stricter matching of the search words                     |

#### Vehicle filters (vehicle rows)

**Year from / to**, **Mileage from / to**, **Transmission**.

Body style, colours, vehicle history, bedrooms and similar filters exist on Facebook only for logged-in visitors; Facebook ignores them for logged-out searches, so they are not offered here. If a pasted link contains them, the log says so.

#### Links

- **Marketplace search links:** set up any search on Facebook (any category, city and filters, including the extra filters some searches show, such as colour or material), copy the link and paste it. Each link is scraped as it is; the form filters do not apply to links.
- **Listing links:** `facebook.com/marketplace/item/...`. Each returns the full listing and is billed as a listing detail.

Rentals: paste a `facebook.com/marketplace/<city>/propertyrentals` link, or search by keyword (`2 bedroom apartment`).

#### Results

| Field | Default | What it does |
| ----- | ------- | ------------ |
| **Maximum listings per search** | `10` | Limit per search row and per search link |
| **Fetch detailed information** | off | Full listing for each result (billed as listing detail) |
| **Remove duplicates across searches** | off | Save each listing once; the first search that finds it sets `sourceUrl` |
| **Only new listings (monitoring)** | off | Save only listings posted since the previous run of the same search |

**Monitoring:** schedule the Actor (for example every hour) with this on. The first run saves the current listings; later runs save only new ones. Each search is tracked on its own, so adding a search to a scheduled task starts that search fresh. Nothing extra is charged.

***

### What you will see during a run

Plain-language progress, for example:

- `Starting: 2 searches (up to 50 listings each, with full details).`
- `honda vehicles in Montreal: 200 km area, searched as 19 overlapping 65 km circles ...`
- `sectional sofa in toronto: 50 listings.`
- `Still working... 120 listings so far.`
- `Done: 150 listings.`

One search that cannot be finished never stops the others.

***

### Output overview

#### Dataset structure

- Results are saved to a **single Apify dataset**
- Each row is one listing object with nested sections (`price`, `location`, etc.)
- Use **`sourceUrl`** on each row to see which search or item URL produced it

Field presence varies by listing and category: not every listing includes a price, full description, or seller details. Empty arrays (`[]`) or `null` mean no data was published for that listing — not necessarily an error.

#### Output modes

| Mode                  | When                                                               | What you get                                                                            |
| --------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| **Summary** (default) | `fetchDetails: false` on search results                            | Core fields: id, url, title, price, location, images, status flags, category, sourceUrl |
| **Detailed**          | `fetchDetails: true` on search results, or any **direct item URL** | Full listing data — all fields Facebook exposes on the detail page                      |

***

### Output fields

#### Summary mode (default)

| Field        | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| `id`         | Unique Marketplace listing identifier                            |
| `url`        | Direct link to the listing page                                  |
| `title`      | Listing title                                                    |
| `price`      | Object with `formatted`, `amount`, and `currency` when available |
| `is_free`    | `true` for free listings (their `price.amount` is `0.0`)         |
| `location`   | Object with `city`, `state`, and `full` when available           |
| `images`     | Array of image URLs                                              |
| `is_sold`    | Whether the listing is marked sold                               |
| `is_pending` | Whether the listing is marked pending                            |
| `category`   | Marketplace category identifier when available                   |
| `sourceUrl`  | The search URL or item URL that produced this listing            |

#### Additional fields in detailed mode

| Field                    | Description                                                                         |
| ------------------------ | ----------------------------------------------------------------------------------- |
| `description`            | Full listing description text                                                       |
| `seller`                 | Seller object — see [Seller and dealership details](#seller-and-dealership-details) |
| `condition`              | Item condition (for example `USED`)                                                 |
| `creation_time`          | When the listing was posted (timestamp and formatted)                               |
| `is_live`                | Whether the listing is currently live                                               |
| `videos`                 | Video URLs when available                                                           |
| `delivery_options`       | Delivery or pickup options when listed                                              |
| `accessibility_captions` | Image accessibility captions when available                                         |
| `latitude` / `longitude` | Coordinates when available (inside `location`)                                      |

Vehicle and category-specific listings may include additional metadata fields depending on what Facebook publishes for that item.

#### Seller and dealership details

In detailed mode every row has a `seller` object with the same keys. On **vehicle listings** it tells you whether the seller is a **private seller or a dealership**, and dealerships include their business contact details.

| Field                        | Description                                                         |
| ---------------------------- | ------------------------------------------------------------------- |
| `seller.type`                | `private` or `dealership` for vehicles; `null` for other categories |
| `seller.dealership_name`     | Dealership name                                                     |
| `seller.phone`               | Dealership phone number, e.g. `+1 832-582-6655`                     |
| `seller.phone_international` | The same number in international format, e.g. `+18325826655`        |
| `seller.address`             | Object with `street`, `city`, `region`, `postal_code`, `country`    |
| `seller.website`             | Dealership website when listed                                      |
| `seller.name` / `seller.id`  | Seller profile, only when Facebook publishes it (usually `null`)    |

`seller.type` reflects what the seller selected when listing the vehicle. Dealers who list as individuals appear as `private`.

```json
"seller": {
  "name": null,
  "id": null,
  "profile_url": null,
  "type": "dealership",
  "dealership_name": "Texas Car Direct",
  "phone": "+1 832-582-6655",
  "phone_international": "+18325826655",
  "address": {
    "street": "5707 Schumacher Ln",
    "city": "Houston",
    "region": "Texas",
    "postal_code": "77057-7106",
    "country": "United States"
  },
  "website": null
}
```

***

### Example output

The excerpts below come from a real run with keyword searches, vehicle searches, direct search URLs, and a direct item URL. Full output is available in the run dataset.

#### Example input

```json
{
  "keywordSearches": [
    {
      "query": "sectional sofa",
      "locationSlug": "montreal"
    }
  ],
  "vehicleSearches": [
    {
      "make": "lucid",
      "locationSlug": "montreal"
    }
  ],
  "itemUrls": [
    {
      "url": "https://www.facebook.com/marketplace/item/2082392026023664"
    }
  ],
  "minPrice": 500,
  "maxPrice": 75000,
  "conditions": ["used_good", "used_like_new"],
  "dateListed": "last_30_days",
  "fetchDetails": false,
  "maxListings": 50
}
```

#### Excerpt — keyword search listing (summary mode)

```json
{
  "id": "1718926402591769",
  "url": "https://www.facebook.com/marketplace/item/1718926402591769/",
  "title": "Reversible Must Grey Sectional Sofa GREAT CONDITION",
  "price": {
    "amount": "1500.0",
    "currency": null,
    "formatted": "CA$1,500"
  },
  "location": {
    "city": "Westmount",
    "state": "QC",
    "full": "Westmount, Quebec"
  },
  "images": [
    "https://scontent-lhr6-2.xx.fbcdn.net/v/t39.84726-6/724350627_1214969875027207_4872060484073252579_n.jpg?..."
  ],
  "is_sold": false,
  "is_pending": false,
  "category": "1583634935226685",
  "sourceUrl": "https://www.facebook.com/marketplace/montreal/search/?query=sectional%20sofa&exact=false&minPrice=500&maxPrice=75000&itemCondition=used_good%2Cused_like_new&daysSinceListed=30"
}
```

#### Excerpt — vehicle search listing (summary mode)

```json
{
  "id": "1004923282488083",
  "url": "https://www.facebook.com/marketplace/item/1004923282488083/",
  "title": "2027 Artisanal 4x8",
  "price": {
    "amount": "1400.0",
    "currency": null,
    "formatted": "CA$1,400"
  },
  "location": {
    "city": "St-Sauveur",
    "state": "QC",
    "full": "Saint-Sauveur-des-monts, Quebec"
  },
  "images": [
    "https://scontent.fsap12-1.fna.fbcdn.net/v/t39.30808-6/718297817_10230478000924332_5433532330628870229_n.jpg?..."
  ],
  "is_sold": false,
  "is_pending": false,
  "category": "807311116002614",
  "sourceUrl": "https://www.facebook.com/marketplace/montreal/vehicles?make=1392638391528793&exact=false&minPrice=500&maxPrice=75000&sortBy=vehicle_year_descend&itemCondition=used_good%2Cused_like_new&daysSinceListed=30&minYear=2015&maxYear=2026&maxMileage=120000&carType=sedan%2Csuv%2Cwagon&transmissionType=automatic"
}
```

#### Excerpt — direct item URL (always detailed)

```json
{
  "id": "2082392026023664",
  "url": "https://www.facebook.com/marketplace/item/2082392026023664/",
  "sourceUrl": "https://www.facebook.com/marketplace/item/2082392026023664",
  "title": "2010 Audi Q5",
  "price": {
    "formatted": "CA$2,400",
    "amount": "2400.0",
    "currency": "CAD"
  },
  "description": "Audi q5 2010 moins de 177 000 km\nQuelle trace de rouille ,direction et bearing de roue (4) changer \nc'était mon véhicule d'hiver j'ai 3000$ de pièce neuve que je peux donner avec si tu négocie pas ",
  "location": {
    "city": "Lévis",
    "state": "QC",
    "full": "Lévis, QC",
    "latitude": 46.760559082031,
    "longitude": -71.240844726562
  },
  "images": [
    "https://scontent.fasu11-2.fna.fbcdn.net/v/t39.30808-6/735018237_10242986274651025_6251349529862557825_n.jpg?..."
  ],
  "category": "807311116002614",
  "condition": "USED",
  "creation_time": {
    "timestamp": 1782779408,
    "formatted": "2026-06-30 00:30:08",
    "iso": "2026-06-30T00:30:08"
  },
  "is_live": true,
  "is_sold": false,
  "is_pending": false,
  "delivery_options": ["IN_PERSON"]
}
```

***

### Combining input modes

You can use **multiple** input modes in a single run.

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/marketplace/montreal/search?query=iphone%2013"
    }
  ],
  "keywordSearches": [
    {
      "query": "desk",
      "locationSlug": "sanfrancisco"
    }
  ],
  "vehicleSearches": [
    {
      "make": "honda",
      "locationSlug": "montreal"
    }
  ],
  "itemUrls": [
    {
      "url": "https://www.facebook.com/marketplace/item/2082392026023664"
    }
  ],
  "minPrice": 500,
  "maxPrice": 75000,
  "deduplicateListings": true,
  "maxListings": 50
}
```

- Each search URL, keyword row, and vehicle row is processed independently, up to **Maximum listings per search** each
- Direct item URLs each produce one listing regardless of that cap
- Enable **Deduplicate listings across searches** to save each listing only once across overlapping results
- Use `sourceUrl` on each row to see which input produced it
- If one search fails or returns no results, others can still complete

***

### Free plan limits

On the Apify **free plan**, the Actor may automatically apply:

| Limit                       | Value                                    |
| --------------------------- | ---------------------------------------- |
| Searches per run (rows + links) | **3** (the first ones in your input) |
| Maximum listings per search | **20**                                   |
| Listing links per run       | **20**                                   |
| Search radius               | **200 km**                               |

Paid Apify plans can use the full input without these caps. If limits apply, the run log will include a short notice.

***

### Data quality and limitations

**Public listing data**\
The Actor reads the same listing data shown on Facebook Marketplace search and item pages. It does not access private seller accounts or unpublished listings.

**Coverage varies by listing and category**\
Prices, descriptions, seller details, and images are not always published. Some fields may be `null` or empty even when the listing is live on Marketplace.

**Links vs search rows**\
The form filters apply only to **keyword** and **vehicle** rows. Search links and listing links are scraped exactly as provided.

**Search radius**\
Facebook shows logged-out visitors about **65 km** around one point. **Search radius** covers more by searching several overlapping areas.

**Logged-in-only filters**\
Body style, colours, vehicle history, bedrooms, bathrooms, size and property type are applied by Facebook only for logged-in visitors. Links containing them are still scraped, without that narrowing, and the log says so.

**Active listings change**\
Listings are posted, updated, sold, and removed on the live site. Re-run on a schedule to track changes over time.

**Free listings**\
Free listings have `price.amount` set to `0.0` and `is_free: true`, so they sort and filter as zero.

**Search area**\
Keyword and vehicle rows only keep listings inside the searched area (a little past the radius is allowed). Listings Facebook shows from much farther away are left out and not charged; the run log says how many.

**Compliance**\
You are responsible for using collected data in line with applicable laws and [Facebook's terms of service](https://www.facebook.com/legal/terms). Output can include seller and dealership contact details such as names, phone numbers, and addresses; handling personal data lawfully (for example under GDPR or CCPA) is your responsibility.

***

### Tips for best results

1. **Copy URLs from the site** — Use real Marketplace search URLs after setting keywords, location, and filters in the browser.
2. **Use keyword searches for quick setup** — Enter what and where (`Toronto`, `Austin, Texas`) without building URLs.
3. **Use vehicle searches for cars and trucks** — Pick a make and location, then apply year, mileage and transmission filters. Condition is not used for vehicle rows.
4. **Sort by newest for alerts** — Newest-first searches return listings posted minutes ago.
5. **Start with a small `maxListings`** — Test your search with 10–20 listings before large exports.
6. **Enable deduplication for overlapping searches** — Turn on **Deduplicate listings across searches** when multiple searches may return the same items.
7. **Use direct item URLs for known listings** — Paste `/marketplace/item/...` links when you need full detail for specific listings.
8. **Filter in the dataset** — Export to JSON, CSV, or Excel, then filter on `title`, `price.formatted`, `location.full`, or `sourceUrl`.
9. **Schedule recurring runs** — Use Apify schedules with **Only new listings** on to get just what was posted since the last run.

***

### Frequently asked questions

**Why was my search URL skipped?**\
The URL may not be a valid Facebook Marketplace page, or it could not be processed in that run. Check the run log for warnings.

**Why do global filters not affect my direct search URL?**\
Direct search URLs are scraped exactly as provided. Use **Keyword searches** or **Vehicle searches** if you want to control filters from the input form.

**Why is price `null`?**\
Items without a listed price and some categories may not expose a numeric price. The formatted price appears in `price.formatted` when shown on the site. Free listings are not `null`: they have amount `0.0` and `is_free: true`.

**Why does a direct item URL return more fields than a search result?**\
Direct item URLs always fetch the full listing page. Search results use summary mode unless **Fetch detailed information** is enabled.

**Why did a search return zero listings?**\
The search may have no matching inventory for the selected filters, or Facebook returned no results for that query and location. Try relaxing filters or a different location.

**Will the same listing appear twice?**\
Yes, if you use multiple searches that overlap and deduplication is off. Enable **Deduplicate listings across searches** or deduplicate on `id` in your export.

**Can I scrape a single listing by URL?**\
Yes — add the `/marketplace/item/<id>` link under **Direct item URLs**.

**What can I type as Location?**\
A city name (`Toronto`, `Austin, Texas`), a postal code, or the city part of a Marketplace link (`montreal` in `facebook.com/marketplace/montreal/search`, or a numeric location ID).

**Which makes are supported for vehicle searches?**\
The input form includes a full dropdown of manufacturers — from Acura and Audi to Tesla, Rivian, Lucid, and Volvo. Choose **All** to search every make in a location.

***

### Support

For Actor-specific issues, use the **Issues** tab on the Apify store listing or contact the publisher through Apify.

For platform questions (runs, billing, API, schedules), see [Apify documentation](https://docs.apify.com) and Apify support.

# Actor input Schema

## `keywordSearches` (type: `array`):

One row per search: what you are looking for and where. Example: `iphone 13` in `Toronto`.

**Location** accepts a city name (`Toronto`, `Austin, Texas`), a postal code, or the city part of a Marketplace link (`sanfrancisco` from facebook.com/marketplace/sanfrancisco).

## `vehicleSearches` (type: `array`):

One row per vehicle search: a make (or All) and where. Vehicle filters (year, mileage, transmission) below apply to these rows.

## `searchRadiusKm` (type: `integer`):

How far around each row's location to search. Facebook shows logged-out visitors about 65 km around one point, whatever radius the site offers; a larger value here searches several overlapping areas and removes duplicates. **Maximum listings per search** still applies per row.

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

In the local currency. Leave empty for no minimum.

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

In the local currency. Leave empty for no maximum.

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

Leave empty for any condition.

## `dateListed` (type: `string`):

Only listings posted within this time.

## `deliveryMethod` (type: `string`):

Shipping is mostly offered in the US.

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

Available listings, or listings already sold.

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

Order of results. Mileage and year sorts apply to vehicle rows only.

## `exactMatch` (type: `boolean`):

Match the search words more strictly.

## `vehicleMinYear` (type: `integer`):

Earliest model year. Vehicle rows only.

## `vehicleMaxYear` (type: `integer`):

Latest model year. Vehicle rows only.

## `vehicleMinMileage` (type: `integer`):

Odometer, in the units local listings use. Vehicle rows only.

## `vehicleMaxMileage` (type: `integer`):

Odometer, in the units local listings use. Vehicle rows only.

## `vehicleTransmission` (type: `string`):

Vehicle rows only.

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

Set up a search on Facebook Marketplace (any category, any filters), copy the link from the address bar and paste it here. Each link is scraped as it is: the filters above do not apply to links.

Example: `https://www.facebook.com/marketplace/toronto/search?query=sofa&maxPrice=300`

## `itemUrls` (type: `array`):

Links to single listings (`facebook.com/marketplace/item/...`). Each one returns the full listing and is billed as a listing detail.

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

Limit for each search row and each search link. Total cost grows with this value times the number of searches.

## `fetchDetails` (type: `boolean`):

Adds the full description, all photos and videos, seller type and dealership contacts, vehicle specs and every other listing field. Each detailed listing is billed as a listing detail.

## `deduplicateListings` (type: `boolean`):

Save each listing once, even when several searches find it.

## `monitoringMode` (type: `boolean`):

For scheduled runs: save only listings posted since the previous run of the same search. Nothing extra is charged; you pay only for the new listings saved.

## Actor input object example

```json
{
  "keywordSearches": [
    {
      "query": "iphone 13",
      "locationSlug": "Toronto"
    }
  ],
  "searchRadiusKm": 65,
  "dateListed": "all",
  "deliveryMethod": "all",
  "availability": "available",
  "sortBy": "best_match",
  "exactMatch": false,
  "vehicleTransmission": "all",
  "maxListings": 10,
  "fetchDetails": false,
  "deduplicateListings": false,
  "monitoringMode": false
}
```

# Actor output Schema

## `results` (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 = {
    "keywordSearches": [
        {
            "query": "iphone 13",
            "locationSlug": "Toronto"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("calm_builder/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 = { "keywordSearches": [{
            "query": "iphone 13",
            "locationSlug": "Toronto",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("calm_builder/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 '{
  "keywordSearches": [
    {
      "query": "iphone 13",
      "locationSlug": "Toronto"
    }
  ]
}' |
apify call calm_builder/facebook-marketplace-scraper --silent --output-dataset

```

## MCP server setup

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