# Facebook Marketplace

Extract Facebook Marketplace listings — title, price, condition, location, attributes, and photos — from any category or search URL.

**Pricing:** $9.5 / 1k listings

**Endpoint:** `POST /api/v1/agents/facebook/marketplace/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | A Facebook Marketplace category or search URL. Examples: https://www.facebook.com/marketplace/nyc/electronics or https://www.facebook.com/marketplace/london/search/?query=bicycle |
| `maxResults` | integer | No | Number of listings to pull from the URL. |

## Example

```bash
curl -X POST https://api.mindcase.co/api/v1/agents/facebook/marketplace/run \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{"url":"..."}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/api/v1/agents/facebook/marketplace/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "url": "..."
}},
)
data = resp.json()
```

## Get the results

`run` is async and returns a `job_id`. Poll until `status` is `completed`, then read the rows:

```bash
# 1) check status
curl https://api.mindcase.co/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/api/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, endpoints): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `listingTitle` | Listing Title | text |
| `listingUrl` | Listing URL | text |
| `description` | Description | text |
| `price` | Price | number |
| `currency` | Currency | text |
| `originalPrice` | Original Price | number |
| `condition` | Condition | text |
| `attributes` | Attributes | object_array |
| `mileage` | Mileage | text |
| `location` | Location | text |
| `city` | City | text |
| `state` | State | text |
| `postalCode` | Postal Code | text |
| `country` | Country | text |
| `latitude` | Latitude | number |
| `longitude` | Longitude | number |
| `deliveryOptions` | Delivery Options | array |
| `listedAt` | Listed At | text |
| `primaryPhoto` | Primary Photo | text |
| `photos` | Photos | object_array |
| `videoUrl` | Video URL | text |
