# Facebook Marketplace Search & Listing Data (`cmfapps/facebook-marketplace-search`) Actor

Search Facebook Marketplace by keyword, location, radius, price, listing age, and sort order. Export structured listings with prices, images, seller data, and optional listing details.

- **URL**: https://apify.com/cmfapps/facebook-marketplace-search.md
- **Developed by:** [Cody F](https://apify.com/cmfapps) (community)
- **Categories:**
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 marketplace listing 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/actors/running/actors-in-store.md#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 Search

Returns raw Facebook Marketplace search cards through the FindFlip backend. This Actor does not run OCR, AI, product identity, comp validation, deal scoring, kit handling, or normal application ingestion.

Required Actor environment variables (configure them as secrets in Apify):

- `BACKEND_BASE_URL`: public HTTPS base URL of the FindFlip API.
- `BACKEND_ACTOR_SECRET`: value matching the backend's `APIFY_ACTOR_SHARED_SECRET`.

The default dataset contains one item per Marketplace result card.

Set `collectAdditionalDetails` to `true` to open each result using the normal
listing-detail parsing flow. It adds the description, listed time, structured
item or vehicle details, and seller name, Marketplace profile URL, rating, and
review data. It defaults to `false` because detail-page visits make searches
substantially slower.

Set `onlyNewListings` to `true` for scheduled or repeated monitoring. The first
run returns all matches; later completed runs return only listing IDs not
previously returned to the same Apify user for the same search settings. The
worker continues scrolling past known cards while looking for new results.

# Actor input Schema

## `query` (type: `string`):

The exact search phrase to send to Facebook Marketplace.

## `searchZip` (type: `string`):

Optional Marketplace location. If omitted, the worker account's current location is used.

## `maxRadius` (type: `integer`):

Search radius in miles when searchZip is supplied.

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

Optional maximum listing price.

## `maxListingAgeHours` (type: `integer`):

Optional listing age filter.

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

Facebook Marketplace sort order.

## `maxResults` (type: `integer`):

Maximum number of raw cards to return.

## `maxScrollSeconds` (type: `integer`):

Maximum seconds spent loading search cards.

## `collectAdditionalDetails` (type: `boolean`):

Open each result just like the normal listing-detail flow to collect its description, listed time, structured item or vehicle details, and seller profile, rating, and review data. This makes the run slower.

## `onlyNewListings` (type: `boolean`):

Return only listing IDs that this Apify user has not received in earlier completed runs of the same search. The first run returns all matching listings.

## `maxWaitSeconds` (type: `integer`):

Maximum seconds the Actor waits for backend capacity.

## Actor input object example

```json
{
  "query": "Nintendo Switch games",
  "maxRadius": 100,
  "sortBy": "best_match",
  "maxResults": 20,
  "maxScrollSeconds": 30,
  "collectAdditionalDetails": false,
  "onlyNewListings": false,
  "maxWaitSeconds": 900
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("cmfapps/facebook-marketplace-search").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("cmfapps/facebook-marketplace-search").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 '{}' |
apify call cmfapps/facebook-marketplace-search --silent --output-dataset

```

## MCP server setup

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

```

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/yHx5QsWp0r4lbgUQK/builds/NdC9F7IOCDww1aWX1/openapi.json
