# Facebook Marketplace Scraper - Listings, Prices & Price Drops (`topapi/facebook-marketplace-scraper`) Actor

Scrape Facebook Marketplace listings by keyword + city, category or URL: price, original price, location, photos, category, date listed, sold status. Add-on: description, all photos, condition, coordinates, vehicle and property data. Monitor mode returns only new listings and price drops. No login.

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

## Pricing

from $0.40 / 1,000 listing scrapeds

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

### What does Facebook Marketplace Scraper do?

**Facebook Marketplace Scraper** extracts Facebook Marketplace listings from [facebook.com/marketplace](https://www.facebook.com/marketplace/) by keyword and city, by category, or by listing URL. Each listing becomes one row with title, price, original price, location, photo, category and listing date. Resellers, dealers, property managers and researchers use it to price items and catch new listings without scrolling Marketplace.

Also known as: FB Marketplace scraper, Facebook Marketplace API, Marketplace listings extractor, Marketplace price tracker.

<a href="https://console.apify.com/actors/munzPs4APJ4gGVqlu"><img src="https://api.apify.com/v2/key-value-stores/qNQ9zP0xaj2yxGeMY/records/facebook-marketplace-scraper-source.png" alt="Facebook Marketplace search results page that Facebook Marketplace Scraper turns into rows" style="width:70%"></a>

- **Every listing in a search:** title, price, original price, city, photo, category, date listed, sold/pending, delivery options.
- **Search the way Marketplace does:** keyword, city or postal code, radius, 18 categories, price, condition, date listed and sort, all sent to Facebook itself.
- **Listing details add-on:** description, every photo, condition, coordinates and distance, vehicle data (year, make, model, mileage, transmission) and property data (beds, baths, street).
- **Price-drop monitor:** scheduled runs return only new listings and price drops, with `previousPrice` and `priceDelta`.
- **No login, cookies or Facebook API key:** you give a keyword and a place.
- **Pay only for delivered rows:** no start fee.
- **Export anywhere:** JSON, CSV, Excel; schedules, webhooks, Make, Zapier, n8n, Google Sheets, the Apify API and MCP.

### What data can you get from Facebook Marketplace?

<table>
<tr>
<td>🆔 Listing id and URL (`listingUrl`)</td>
<td>📝 Title</td>
<td>💲 Price and currency</td>
</tr>
<tr>
<td>🏷️ Original price and discount %</td>
<td>📍 City, state, `locationText`</td>
<td>📅 Date listed (`listedAt`)</td>
</tr>
<tr>
<td>🖼️ Primary photo (`photoUrl`)</td>
<td>🗂️ Category (`categoryName`)</td>
<td>✅ Sold / pending flags</td>
</tr>
<tr>
<td>🚚 Delivery options</td>
<td>📄 Full description ➕</td>
<td>📸 Every photo ➕</td>
</tr>
<tr>
<td>⭐ Condition and attributes ➕</td>
<td>🌐 Latitude, longitude, distance ➕</td>
<td>🚗 Vehicle: year, make, model, mileage ➕</td>
</tr>
<tr>
<td>🏠 Property: beds, baths, street ➕</td>
<td>📉 Price drop: `previousPrice`, `priceDelta`</td>
<td>🔎 Search keyword and location</td>
</tr>
</table>

➕ = with **Include listing details** on. On a 25-listing live run ("desk" near Austin, details on) every row had a title, price, currency, city, photo, category, listing date, condition, coordinates and distance; 92% had a description, 40% an original price, and listings had 1 to 8 photos (3.4 on average).

### How to scrape Facebook Marketplace with Facebook Marketplace Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up): $5 of monthly credit, no card needed.
2. Open [Facebook Marketplace Scraper](https://apify.com/topapi/facebook-marketplace-scraper) and click **Try for free**.
3. Type what you want into **Search keywords** (e.g. `bike`) and a place into **Location** (e.g. `Austin, TX`).
4. Set **Max listings per search**, and turn on **Include listing details** if you need descriptions, all photos or vehicle data.
5. Click **Start**. Rows stream into the dataset as they are found.
6. Open the **Storage** tab and **Export** as JSON, CSV or Excel, or let a schedule run it for you.

### ⬇️ Input

| Parameter | Type | Description |
|---|---|---|
| **🔍 What to scrape** | | |
| `searchQueries` | List | Keywords, one per line, e.g. `bike`, `iphone 15`, `honda civic`. Prefill: `bike`. |
| `location` | String | City, `City, State`, postal code or `lat,lng`; several places separated by `;`. Default: New York, NY. |
| `radiusKm` | Integer | Search radius (1-500 km). Facebook's own filter; exact with listing details. |
| `categories` | Select (multi) | 18 Marketplace categories (Vehicles, Property Rentals, Home Sales, Electronics, Free Stuff and more). Without keywords each is browsed. |
| `listingUrls` | List | Listing URLs or ids, or Marketplace search/category URLs copied from your browser. |
| **🎯 Filters** (applied by Facebook) | | |
| `minPrice`, `maxPrice` | Integer | Price window in the local currency. `maxPrice: 0` = free items. |
| `condition` | Select (multi) | New, Used - like new, Used - good, Used - fair. Default: any. |
| `sortBy` | Select | Best match (default), newest first, price low/high, distance. |
| `daysSinceListed` | Select | Any time (default), last 24 hours, 7 days, 30 days. |
| **✂️ Refine results** | | |
| `mustContainQuery` | Boolean | Keep only listings whose title contains every word of the keyword. Default: `false`. |
| `excludeKeywords` | String | Drop listings whose title (or description, with details) contains any of these words. |
| **➕ Extra data** | | |
| `includeListingDetails` | Boolean | Description, all photos, condition, coordinates, vehicle and property data, charged as **Listing details** per row that gets it. Default: `false`. |
| **🔁 Monitoring** | | |
| `monitorMode` | Boolean | Return only listings not delivered by previous runs, plus price drops. Pair with a schedule. |
| `monitorStoreName` | String | Name of the store that remembers delivered listings. Default: `facebook-marketplace-monitor`. |
| **📦 Output** | | |
| `maxResultsPerQuery` | Integer | Cap per keyword x category x location. Default `100`, prefill `24`, `0` = up to 5,000. |
| `maxItems` | Integer | Cap for the whole run. `0` = no total cap. |
| `compact` | Boolean | Core fields only, sized for AI agents and MCP. |
| **⚙️ Advanced** | | |
| `proxyConfiguration` | Proxy | Default: Apify RESIDENTIAL (US). Other choices fall back to it automatically. |

#### Input JSON

```json
{
  "searchQueries": ["desk", "office chair"],
  "location": "Austin, TX",
  "maxPrice": 150,
  "sortBy": "newest",
  "daysSinceListed": "7",
  "includeListingDetails": true,
  "maxResultsPerQuery": 50
}
```

#### Write the location as "City, State" or a postal code

Facebook's own location search resolves the place. **Do:** `Austin, TX`, `Manchester, UK`, `90210`, `30.27,-97.74`. **Don't:** `Austin` alone when you mean Texas (several towns share the name; the log prints the place used).

#### Paste a Marketplace search URL to keep your browser filters

Copy the address bar of a Marketplace search into `listingUrls`. The actor reads its city, keyword, category and filters (`minPrice`, `maxPrice`, `sortBy`, `daysSinceListed`, `itemCondition`); the form's filters do not override it.

#### Sort by newest for alerts, by distance for "near me"

`newest` is the order for monitoring; Facebook widens the area slightly for it. `distance` keeps results closest to you. Facebook treats the radius as a hint (about 65 km), so turn on listing details when it must be exact: farther rows are removed.

#### Turn on "Only listings that contain the keyword" for strict results

Marketplace search is fuzzy: `bike` also returns bike racks. With `mustContainQuery` every keyword word must appear in the title.

### ⬆️ Output

Every listing becomes one dataset item. Here is the table view of the 25-listing live run for `desk` near Austin, TX with listing details on:

<a href="https://console.apify.com/actors/munzPs4APJ4gGVqlu"><img src="https://api.apify.com/v2/key-value-stores/qNQ9zP0xaj2yxGeMY/records/facebook-marketplace-scraper-output.png" alt="Facebook Marketplace Scraper output table with listings, prices and details" style="width:70%"></a>

And one row as JSON (trimmed):

```json
{
  "id": "960824729657551",
  "listingUrl": "https://www.facebook.com/marketplace/item/960824729657551/",
  "title": "Black Desk (with drawer stand)",
  "price": 25,
  "priceFormatted": "$25",
  "currency": "USD",
  "originalPrice": 50,
  "discountPct": 50,
  "city": "Austin",
  "state": "TX",
  "latitude": 30.270080566406,
  "longitude": -97.684936523438,
  "distanceKm": 6,
  "categoryName": "Furniture",
  "condition": "Used - like new",
  "listedAt": "2026-09-16T13:33:48.000Z",
  "photoCount": 5,
  "description": "Black desk with drawers\n\n48 inches wide\n22 inches deep\n30 inches tall",
  "isSold": false,
  "deliveryTypes": ["IN_PERSON", "DOOR_PICKUP"],
  "searchQuery": "desk",
  "searchLocation": "Austin, Texas",
  "detailsFetched": true
}
```

Rows also keep Facebook's own field names (`marketplace_listing_title`, `listing_price`, `primary_listing_photo`, `location`, `redacted_description`, `listing_photos`, `vehicle_*`), as other Marketplace scrapers do, so existing pipelines keep working.

#### Fields

| Field | Type | What it is | Fill on test run |
|---|---|---|---|
| `id`, `listingUrl`, `title` | string | Listing id, link, title | 100% |
| `price`, `priceFormatted`, `currency` | number, string | Price as a number, as shown, ISO currency | 100% |
| `originalPrice`, `discountPct` | number | Struck-through price and markdown % | 40% (only marked-down items) |
| `city`, `state`, `locationText` | string | Where the item is | 100% |
| `photoUrl` | string (URL) | Primary photo | 100% |
| `categoryName`, `categoryId` | string | Marketplace category | 100% |
| `listedAt`, `listedHoursAgo` | ISO date, number | When it was posted | 100% |
| `isSold`, `isPending`, `deliveryTypes` | boolean, array | Status and delivery options | 100% |
| `description` ➕ | string | Full description | 92% |
| `photoUrls`, `photoCount` ➕ | array, integer | Every photo | 100% |
| `condition`, `attributes` ➕ | string, array | Condition and listing attributes | 100% |
| `latitude`, `longitude`, `distanceKm` ➕ | number | Coordinates and distance from the search point | 100% |
| `vehicle` ➕ | object | year, make, model, mileage, transmission, exterior colour, seller type 100%; trim 92%; fuel 88%; MPG 68%; owners 56%; title status 40% | vehicles (25-car run) |
| `property` ➕ | object | Property type, beds, baths, street, walk/transit scores | rentals and home sales |
| `changeType`, `previousPrice`, `priceDelta` | string, number | Monitor mode: `NEW` or `PRICE_DROP` | monitor runs |

### How can I use Facebook Marketplace data?

- 💸 **Resellers and flippers:** an alert when an item is listed under your price, or a seller cuts the price.
- 🚗 **Car dealers and buyers:** private-party cars with year, make, model, mileage and asking price for trade-in pricing.
- 🏠 **Property managers and renters:** rentals and homes for sale with beds, baths, street and price.
- 📊 **Market researchers and brands:** second-hand prices, supply and discounting across cities.
- 🤖 **AI and data teams:** `compact` rows for an LLM or MCP agent ("a used road bike under $300 near Denver").

### How much does it cost to scrape Facebook Marketplace?

Facebook Marketplace Scraper is pay-per-result: **$0.40 per 1,000 listings**, no start fee. Listing details are **$0.80 per 1,000 listings** that receive them.

| Listings | Cost | With listing details |
|---:|---:|---:|
| 10 | $0.004 | $0.012 |
| 100 | $0.04 | $0.12 |
| 1,000 | $0.40 | $1.20 |
| 10,000 | $4.00 | $12.00 |

Measured on the platform: 24 listings in 5-13 seconds, 100 listings in 15 seconds, 25 listings with details in 22 seconds, all on 256 MB with a peak of 42-52 MB.

### Facebook Marketplace in your tools: integrations, API, scheduling & MCP

- **Schedules:** run it hourly or daily from the **Schedules** tab with `monitorMode` and `sortBy: newest` to receive only new listings and price drops.
- **Webhooks:** fire a URL when a run finishes and push the new listings to Slack, a CRM or a sheet.
- **No-code:** Make, Zapier, n8n, Google Sheets, Airtable, Slack via [Apify integrations](https://docs.apify.com/integrations).
- **API:** call it from Node.js or Python with `apify-client`; code is on the [API tab](https://apify.com/topapi/facebook-marketplace-scraper/api/python) and in the [Apify API reference](https://docs.apify.com/api/v2).
- **MCP / AI agents:** connect Claude, Cursor or any MCP client through the [MCP tab](https://apify.com/topapi/facebook-marketplace-scraper/api/mcp) and ask for Marketplace listings in plain language; set `compact: true` to keep rows small.

### More scrapers by TopApi

<table>
<tr>
<td>📰 <a href="https://apify.com/topapi/facebook-search-posts-scraper">Facebook Search Posts Scraper</a> - public Facebook posts by keyword, date and place</td>
<td>📸 <a href="https://apify.com/topapi/instagram-scraper">Instagram Scraper</a> - posts, reels and profiles without login</td>
<td>🎵 <a href="https://apify.com/topapi/tiktok-scraper">TikTok Scraper</a> - videos, hashtags and profiles</td>
</tr>
<tr>
<td>🎬 <a href="https://apify.com/topapi/tiktok-video-scraper">TikTok Video Scraper</a> - one row per video URL</td>
<td>🐦 <a href="https://apify.com/topapi/x-profile-scraper">Twitter Profile Scraper</a> - X followers, bio and verified badge</td>
<td>💼 <a href="https://apify.com/topapi/indeed-jobs-scraper">Indeed Jobs Scraper</a> - job listings by keyword and location</td>
</tr>
<tr>
<td>📈 <a href="https://apify.com/topapi/similarweb-scraper">Similarweb Scraper</a> - website traffic and rankings</td>
<td>📍 <a href="https://apify.com/topapi/google-maps-reviews-scraper">Google Maps Reviews Scraper</a> - reviews, ratings and owner replies</td>
<td>🔎 <a href="https://apify.com/topapi">All TopApi actors</a> - scrapers built for schedules, APIs and AI agents</td>
</tr>
</table>

### Limits & empty runs

- **Listings per search:** 24 per request; one search paged to 734 unique listings with no duplicates. Cap up to 5,000 per search.
- **No seller name or profile:** Facebook does not show the seller to signed-out visitors (empty on every listing tested); scrapers that return it ask for your cookies.
- **Dealer contacts and vehicle feature lists** appeared on none of 121 vehicle listings tested (all private sellers); they are added only when Facebook shows them.
- **Radius:** visitors get about 65 km whatever the radius; the exact radius applies with listing details on.
- **Currency** comes from the listing (details) or the price symbol plus the listing's state; empty when ambiguous.
- **Postal code** only for vehicles and property. The few eBay items inside Marketplace are flagged `isPartnerListing`, with the eBay seller in `partner`.
- **Photo links** are signed Facebook URLs that expire after some days.
- **Empty dataset:** no listings match, the place was not found (the log says so), or monitor mode found nothing new.

### FAQ

#### How many listings can Facebook Marketplace Scraper collect in one run?

As many as you allow: each keyword x category x location is one search with its own cap (`maxResultsPerQuery`, up to 5,000), and `maxItems` caps the whole run. One search paged to 734 listings in testing. For more, split by city, category or price range.

#### Can I run Facebook Marketplace Scraper on a schedule to get new listings automatically?

Yes. Save your input as a task, turn on `monitorMode`, set `sortBy` to `newest` and add a schedule. Each run returns only listings not delivered before and listings whose price dropped; a run with nothing new delivers nothing.

#### How does Facebook Marketplace Scraper detect price drops?

It remembers the price of every listing it delivered (in the store named by `monitorStoreName`). When a known listing reappears cheaper, the row comes back with `changeType: PRICE_DROP`, `previousPrice` and `priceDelta`.

#### Can I integrate Facebook Marketplace Scraper with other apps?

Yes: Make, Zapier, n8n, Google Sheets, Slack and more via [Apify integrations](https://docs.apify.com/integrations), or [webhooks](https://docs.apify.com/integrations/webhooks) that fire when a run finishes.

#### Can I use Facebook Marketplace Scraper with the Apify API?

Yes. Start runs, read datasets and manage schedules with `apify-client` for [Node.js](https://apify.com/topapi/facebook-marketplace-scraper/api/javascript) or [Python](https://apify.com/topapi/facebook-marketplace-scraper/api/python); the API tab has ready-to-paste code.

#### Can I use Facebook Marketplace Scraper through an MCP server?

Yes. Open the [MCP tab](https://apify.com/topapi/facebook-marketplace-scraper/api/mcp), connect your MCP client (Claude Desktop, Cursor and others) and ask for Marketplace listings in plain language. `compact: true` keeps each row to the core fields.

#### Do I need a Facebook account, cookies or an API key for Facebook Marketplace Scraper?

No. The actor reads what Marketplace shows any visitor; you give a keyword, a place or a URL and nothing else. It uses Apify's residential proxy by default because Facebook sends datacenter IPs to its login page.

#### Can Facebook Marketplace Scraper scrape cars and rentals?

Yes. Pick the Vehicles, Property Rentals or Home Sales category (with or without a keyword) and turn on listing details for year, make, model, mileage and transmission, or beds, baths, street and walk score.

#### Why did my Facebook Marketplace Scraper run return no results?

Usually the filters are too narrow (price window, condition, last 24 hours), the location was not found (write `City, State`), or monitor mode found nothing new since the last run. The status message and the `RUN_SUMMARY` record say which.

#### How is Facebook Marketplace Scraper different from other Marketplace scrapers?

It keeps the field names of the largest Marketplace scrapers and adds flat fields (price as a number, currency, discount %, distance, listing age), a price-drop monitor, exact radius, vehicle and property blocks, and keyword filters, at $0.40 per 1,000 listings with no start fee.

#### Is it legal to scrape Facebook Marketplace?

Facebook Marketplace Scraper extracts only publicly available listing data and does not log in. Results can still contain personal data, which laws such as the GDPR protect, so make sure you have a legitimate reason before you use it.

#### Your feedback

We keep improving Facebook Marketplace Scraper. Found a bug or missing a field? Open an issue on the [Issues tab](https://apify.com/topapi/facebook-marketplace-scraper/issues/open) and we will get back to you.

# Actor input Schema

## `searchQueries` (type: `array`):

What to search for on Marketplace, one per line, e.g. "bike", "iphone 15", "honda civic". Leave empty to browse the categories below instead. Facebook's search is fuzzy: turn on 'Only listings that contain the keyword' for strict results.

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

City, "City, State", postal code or "lat,lng", e.g. "Austin, TX", "London, UK", "90210", "40.71,-74.00". Several places: separate with ; ("Austin, TX; Dallas, TX"). Empty = New York, NY.

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

Search radius around the location in km (Facebook's own filter; for visitors Facebook treats it as a hint, ~65 km). With 'Include listing details' on, listings farther than this are removed. Empty = Facebook's default.

## `categories` (type: `array`):

Marketplace categories. Without keywords, each category is browsed; with keywords, each keyword is searched inside each category. Leave empty for all categories.

## `listingUrls` (type: `array`):

Marketplace listing URLs or ids (e.g. https://www.facebook.com/marketplace/item/1720207995949881/ or 1720207995949881), or a Marketplace search/category URL copied from your browser, which keeps its own filters (e.g. https://www.facebook.com/marketplace/la/search?query=sofa\&maxPrice=300).

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

Only listings priced at or above this amount, e.g. 50. Empty = no minimum.

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

Only listings priced at or below this amount, e.g. 500. 0 = free items only. Empty = no maximum.

## `condition` (type: `array`):

Only listings in these conditions. Leave empty for any condition.

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

"Newest first" is the one for monitoring new listings (Facebook widens the area a little for it). "Distance" keeps results closest to the location.

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

Only listings posted within this window (Facebook's own filter; every row also carries listedAt). Pairs well with a daily schedule.

## `mustContainQuery` (type: `boolean`):

Keep only listings whose title contains every word of the keyword (case-insensitive). Facebook also returns related items ("bike" finds bike racks and helmets); this makes results strict.

## `excludeKeywords` (type: `string`):

Drop listings whose title (and description, when details are on) contains any of these words, comma-separated, e.g. "parts, broken, wanted, rent". Leave empty for no exclusions.

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

Adds the full description, every photo, condition and attributes, exact coordinates and distance, postal code, shipping flag, vehicle data (year, make, model, mileage, transmission, fuel, colours, title status, owners) and property data (type, beds, baths, address, walk/transit scores).

## `monitorMode` (type: `boolean`):

Remembers every listing per search (in the named store below) and returns only listings not delivered before, plus known listings whose price dropped (changeType PRICE_DROP with previousPrice and priceDelta). Pair with 'Newest first' and an hourly or daily schedule.

## `monitorStoreName` (type: `string`):

Name of the key-value store that keeps what earlier runs delivered, e.g. "bikes-austin". Use one name per alert; change it to start over.

## `maxResultsPerQuery` (type: `integer`):

Cap per keyword x category x location. Facebook pages 24 listings per request and paged 734 for one search in testing. 0 = no cap (up to 5,000).

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

Cap for the whole run across all searches and listing URLs. 0 = no total cap.

## `compact` (type: `boolean`):

Core fields only (title, price, location, photo, date, category, details, monitor fields) - small rows for AI agents, MCP and spreadsheets.

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

Facebook serves Marketplace to residential IPs and redirects datacenter IPs to its login page, so residential is the default. Any other choice falls back to residential automatically when Facebook walls it.

## Actor input object example

```json
{
  "searchQueries": [
    "bike"
  ],
  "location": "New York, NY",
  "sortBy": "best_match",
  "daysSinceListed": "",
  "mustContainQuery": false,
  "includeListingDetails": false,
  "monitorMode": false,
  "monitorStoreName": "facebook-marketplace-monitor",
  "maxResultsPerQuery": 24,
  "maxItems": 0,
  "compact": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `listings` (type: `string`):

The dataset of Facebook Marketplace listings (one item per listing).

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

Per-search counts (read, filtered, already delivered, price drops, delivered), pages, requests, sessions, egress and bytes transferred.

# 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 = {
    "searchQueries": [
        "bike"
    ],
    "location": "New York, NY",
    "maxResultsPerQuery": 24
};

// Run the Actor and wait for it to finish
const run = await client.actor("topapi/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 = {
    "searchQueries": ["bike"],
    "location": "New York, NY",
    "maxResultsPerQuery": 24,
}

# Run the Actor and wait for it to finish
run = client.actor("topapi/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 '{
  "searchQueries": [
    "bike"
  ],
  "location": "New York, NY",
  "maxResultsPerQuery": 24
}' |
apify call topapi/facebook-marketplace-scraper --silent --output-dataset

```

## MCP server setup

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