# Facebook 市集商品 API (facebook.marketplace)

- Canonical page: https://everyinfra.com/facebook-api/marketplace
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "facebook", "action": "marketplace", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 200 per call
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=facebook&action=marketplace

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | search 查公开帖子；ads 查广告关键词，也可传广告库/主页 URL；marketplace 查商品词，也可传完整 Marketplace 搜索 URL。三个入口范围不同，不是同一份结果换字段。 |
| location | not declared | no | not declared | marketplace 的城市路径标识，例如 nyc，默认 nyc；不是自由文本街道地址。keyword 为完整 Marketplace URL 时以该 URL 为准，不再应用 location。 |
| limit | integer (1–200) | no | 20 | 这次调用最多返回的条数，整数，1–200；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| price | 价格数值，不含货币符号；币种见 currency。 |
| currency | 价格币种代码（如 CNY、USD）。price 存在但 currency 为 null 时不要假定币种。 |
| city | 城市名，用原平台的语言书写，未做中英归一。 |
| state | 所在州/状态。 |
| condition | 商品成色（Marketplace 用）。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "facebook",
  "action": "marketplace",
  "params": {
    "keyword": "coffee"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "facebook",
        "action": "marketplace",
        "params": {
            "keyword": "coffee",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "facebook",
  "action": "marketplace",
  "results": [
    {
      "id": "•••",
      "url": "https://www.facebook.com/marketplace/item/1397900569221956",
      "name": "Cooper’s Coffee beans",
      "price": "15.00",
      "city": "Brooklyn",
      "state": "NY",
      "image_url": "https://scontent-dfw6-2.xx.fbcdn.net/v/t39.84726-6/796439990_1610692394038073_2004419954068794895_n.jpg?stp=c0.43.261.261a_dst-jpg_p261x260_tt6&_nc_cat=109&ccb=1-7&_nc_sid=92e707&_nc_ohc=U0AcUFUIaGUQ7kNvwGcaEge&_nc_oc=AdqnUNwPMcOnYed1UYcPib3Fv648ODglqYlcUbuIASkyeEsdullVJrXtq3GqU7…",
      "platform": "facebook"
    },
    {
      "id": "•••",
      "url": "https://www.facebook.com/marketplace/item/27339435099065922",
      "name": "Coffee",
      "price": "2.00",
      "city": "Lyndhurst",
      "state": "NJ",
      "image_url": "https://scontent-dfw6-1.xx.fbcdn.net/v/t39.84726-6/808176602_1559325292043996_1043941526513956246_n.jpg?stp=c0.43.261.261a_dst-jpg_p261x260_tt6&_nc_cat=103&ccb=1-7&_nc_sid=92e707&_nc_ohc=qlChSijkPf4Q7kNvwHtTFaW&_nc_oc=AdpAWkgxEOQV-FjosxDHaTdJcGMoryZEC3da8NcXYB7Cn0OpUURph8OvIR4M1K…",
      "platform": "facebook"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=facebook
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
