# Facebook 主页搜索 API (facebook.page_search)

- Canonical page: [https://everyinfra.com/facebook-api/page_search](https://everyinfra.com/facebook-api/page_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "facebook", "action": "page_search", "params": {...}}
- Price: $0.001597 per call ($1.6 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of up to 10 per call; the number of rows varies from page to page and a short page is not the end (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page; no next_page_token means the end)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- 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=page_search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 关键词，1 到 100 个字，如 coffee roasters。在 Facebook 的主页搜索里找公共主页，顺序照 Facebook 给的。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页（每页 10 个）；不传从第一页开始。令牌 24 小时有效，每页算一次调用。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| username | 用户名（@handle）。 |
| category | 分类名称，取值为原平台的分类体系，未做跨平台归一。 |
| is_verified | 是否为平台认证账号（蓝V等）。null 表示无法判定。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| snippet_text | 搜索结果里主页名字下面那行原文（page_search）：类别、推荐率、价位、地址、营业状态、粉丝数这些，语言跟着页面走。 |
| follower_count | 粉丝数。null 表示不公开，不等于 0。 |
| follower_count_label | 粉丝数原文（page_search），如 38K followers；follower_count 是从它换算的约数，准确的粉丝数用 profile 取。 |
| 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": "page_search",
  "params": {
    "keyword": "coffee roasters"
  }
}'
```

```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": "page_search",
        "params": {
            "keyword": "coffee roasters",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "facebook",
  "action": "page_search",
  "results": [
    {
      "id": …,
      "url": …,
      "name": …,
      "username": …,
      "category": …,
      "is_verified": …,
      "avatar_url": …,
      "snippet_text": …,
      "follower_count": …,
      "follower_count_label": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "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
