# Facebook Marketplace Item Scraper (`thenetaji/facebook-marketplace-item-scraper`) Actor

Look up individual Facebook Marketplace listings by ID or URL and collect the title, price, location and full detail record, with related listings on request.

- **URL**: https://apify.com/thenetaji/facebook-marketplace-item-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** E-commerce, Marketing
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 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.
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 Item Scraper — Listing Lookup

The Actor looks up individual public Facebook Marketplace listings by ID or URL exactly as a logged-out visitor sees them, and returns each listing's full detail record. No Facebook account, login, or session cookie is used at any point.

### Accepted input

`itemId` is required and accepts a list of Marketplace listing IDs, or full `facebook.com/marketplace/item/<id>/` URLs, one per line; a URL is reduced to its numeric ID before the request is made. `includeRelated` (default `false`) adds the related listings Facebook shows alongside the requested one, under `related`.

```json
{
  "itemId": ["1234567890123456"],
  "includeRelated": true
}
```

### Result fields

Each row carries `id`, `title`, `price`, `location`, `url`, `related`, and `raw`. Unlike a browse result, a lookup row does not carry `imageUrl` as its own field; a listing's images live inside `raw`. `related` is `null` when `includeRelated` is off, and otherwise the list of listings Facebook renders alongside the requested one, each carrying `id`, `title`, `price`, `location`, `url` and `imageUrl`.

That list is about twenty entries — whatever Facebook puts in the tray on the item page. Measured at 19 and 20 across four live listings. There is no way to ask for more: the tray has no paginator, and `maxItems` counts the listings you supply, not the related ones each brings back. They are attached to the requested listing's own row rather than saved as rows of their own, and they add no charge — they arrive in the same single request as the listing itself.

```json
{
  "id": "1234567890123456",
  "title": "iPhone 13 Pro, 256GB, unlocked",
  "price": "$450",
  "location": "Austin, TX",
  "url": "https://www.facebook.com/marketplace/item/1234567890123456/",
  "related": null
}
```

`price` is the formatted string Facebook displays, currency symbol included, rather than a parsed number and currency code. `maxItems` (default `50`) trims how many of the supplied listings are saved once resolved; `0` collects every listing supplied.

### Behaviour on partial results

A listing ID or URL that does not resolve to a valid numeric ID is logged as a warning and skipped without a request being made for it. A listing that resolves but has been removed, or otherwise returns no data, is logged and skipped the same way. The run continues with the rest of the list in both cases.

### Public, logged-out data only

Everything returned here — the listing page and its related listings alike — is visible to a Marketplace visitor who is not signed in. There is no logged-out Marketplace search: this Actor covers direct listing lookups by ID or URL, not a keyword search across listings.

### Frequently asked questions

**Why is there no `imageUrl` field here?**
A lookup already returns the listing's full detail record, and its images live inside `raw` rather than being lifted into a separate field the way a lighter browse row's `imageUrl` is. A browse result and a lookup result are not the same shape.

**Does this need an add-on to get the full detail record?**
No. A full detail record is what this Actor returns by default for every listing it resolves; there is nothing extra to turn on. The equivalent add-on on the [Facebook Marketplace Scraper](https://apify.com/thenetaji/facebook-marketplace-scraper) exists to bring that same depth to a browse run, not to this one.

**Can a listing ID found while browsing be looked up here directly?**
Yes. The `id` on a Facebook Marketplace Scraper browse row is exactly what `itemId` here accepts, so listings worth going deeper on can be fed straight into this Actor without any conversion.

**Is a Facebook account or login required?**
No. Only the Marketplace listing pages that Facebook already shows to a logged-out visitor are read.

### What this is useful for

Tracking specific listings — availability, price changes — over the life of a scheduled run; pulling full detail, including related listings, for a known shortlist of listing IDs; and following up on listings surfaced elsewhere with a single, targeted request per listing.

### Related Actors

| Actor | Purpose |
| --- | --- |
| [Facebook Marketplace Scraper](https://apify.com/thenetaji/facebook-marketplace-scraper) | Browse listings by category |
| [Facebook Page Scraper](https://apify.com/thenetaji/facebook-page-scraper) | Profile, About and Transparency details for a Page |
| [Facebook Posts Scraper](https://apify.com/thenetaji/facebook-posts-scraper) | Timeline posts for a Page |

# Actor input Schema

## `itemId` (type: `array`):

Marketplace listing IDs or full facebook.com/marketplace/item/<id>/ URLs, one per line.

## `includeRelated` (type: `boolean`):

Adds the related listings Facebook shows alongside the requested Marketplace listing — roughly twenty of them, attached to that listing's own row. Facebook offers no way to request more, and they cost no extra charge because they arrive in the same request.

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

Maximum listings to save. Set `0` to collect every listing supplied. This counts the listings YOU supply above — it does not change how many related listings each one brings back, which is fixed by Facebook at whatever its tray shows (about twenty).

## Actor input object example

```json
{
  "itemId": [
    "2266436407487624"
  ],
  "includeRelated": false,
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

All records scraped by this run

# 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 = {
    "itemId": [
        "2266436407487624"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/facebook-marketplace-item-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 = {
    "itemId": ["2266436407487624"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/facebook-marketplace-item-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 '{
  "itemId": [
    "2266436407487624"
  ],
  "maxItems": 20
}' |
apify call thenetaji/facebook-marketplace-item-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenetaji/facebook-marketplace-item-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/snivCVBCI9NHeocnC/builds/sBwVf7qYov5gauuAG/openapi.json
