# 店铺 Meta 广告资料库 Facebook广告主页列表接口

## 接口信息

- **接口名称**: 获取店铺Facebook广告主页列表
- **请求方法**: POST
- **接口地址**: `/open-api/v1/data`
- **接口路径**: `/v3/api/open/ppspy/pp-stores/fb-page`
- **接口描述**: 获取指定店铺关联的Facebook广告主页（Page）列表，包括主页基本信息、粉丝数、广告数量、广告投放平台等，帮助分析店铺的广告主账号布局和投放策略
- **价格说明**: `免费`
**请求头:**

- Content-Type: application/json
- Accept: application/json

## 请求参数

### 请求结构

| 参数名 | 类型   | 描述                        | 示例                                    | 必填 | 默认值 |
| ------ | ------ | --------------------------- | --------------------------------------- | ---- | ------ |
| key    | string | 用户申请的外部 api 请求 key | "your_api_key_here"                     | 是   |        |
| uri    | string | 接口路径                    | "/v3/api/open/ppspy/pp-stores/fb-page"  | 是   |        |
| params | object | 接口入参对象                | 见参数列表                              | 是   |        |

### 请求体参数 (params 对象)

| 参数名 | 类型 | 必填 | 描述 |
| ------ | ---- | ---- | ---- |
| id | String | 是 | 店铺唯一标识ID，为13位字符串（例如：`c2d5b2547218a`），对应店铺榜单列表接口返回结果中的 `store_id` 字段 |
| page_size | Long | 否 | 每页记录数，指定单页返回的主页数量。默认值：20 |
| current_page | Long | 否 | 当前页码，页码从1开始。默认值：1 |

### 请求示例

```bash
curl -X POST "https://www.pipispy.com/open-api/v1/data" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "key": "your_api_key_here",
    "uri": "/v3/api/open/ppspy/pp-stores/fb-page",
    "params": {
        "id": "c2d5b2547218a",
        "page_size": 20,
        "current_page": 1
    }
  }'
```

## 响应参数

### 响应体结构

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "current_page": 1,
    "data": [],
    "first_page_url": "",
    "from": 1,
    "is_logged_in": false,
    "last_page": 1,
    "last_page_url": "",
    "next_page_url": null,
    "path": "",
    "per_page": 20,
    "prev_page_url": null,
    "to": 20,
    "total": 100
  },
  "version": "v1",
  "timestamp": null,
  "sign": null,
  "remaining_credits": 9980,
  "consumed_credits": 0,
  "success": true,
  "fail": false
}
```

### 响应字段说明

| 字段名    | 类型    | 描述                     |
| --------- | ------- | ------------------------ |
| code      | Integer | 响应状态码，200 表示成功 |
| message   | String  | 响应消息                 |
| data      | Object  | 响应数据                 |
| version   | String  | API 版本                 |
| timestamp | String  | 响应时间戳               |
| sign      | String  | 响应签名                 |
| remaining_credits | Long    | 当前请求后的剩余可用积分 |
| consumed_credits  | Long    | 本次请求消耗的积分 |
| success   | Boolean | 请求是否成功             |
| fail      | Boolean | 请求是否失败             |

### 分页数据字段 (data.data)

| 字段名 | 类型 | 描述 |
| ------ | ---- | ---- |
| current_page | Long | 当前页码 |
| data | Array | Facebook广告主页列表 |
| first_page_url | String | 第一页的URL地址 |
| from | Long | 起始记录位置（当前页第一条记录在总结果集中的位置） |
| is_logged_in | Boolean | 用户是否已登录，用于标识数据权限状态 |
| last_page | Long | 最后一页的页码（总页数） |
| last_page_url | String | 最后一页的URL地址 |
| next_page_url | String | 下一页的URL地址，如果没有下一页则为null |
| path | String | API请求路径 |
| per_page | Long | 每页记录数 |
| prev_page_url | String | 上一页的URL地址，如果没有上一页则为null |
| to | Long | 结束记录位置（当前页最后一条记录在总结果集中的位置） |
| total | Long | 总记录数 |

### Facebook广告主页字段 (Datum)

| 字段名 | 类型 | 描述 |
| ------ | ---- | ---- |
| id | String | Facebook主页唯一标识ID |
| name | String | Facebook主页名称 |
| profile_picture_url | String | Facebook主页头像图片URL |
| category_name | String | Facebook主页分类名称（例如：购物与零售、品牌、电子商务网站等） |
| like_count | Long | Facebook主页的点赞数（粉丝数） |
| creation_time | Long | Facebook主页创建时间，Unix时间戳（秒级） |
| ad_platform | Array | 广告投放平台列表，表示该主页在哪些平台投放了广告（例如：FACEBOOK、INSTAGRAM、MESSENGER、AUDIENCE_NETWORK等） |
| ad_count | Long | 该主页的广告总数量 |
| ad_source | Integer | 广告数据源类型。1-TikTok，2-Facebook，3-Meta广告资料库 |
| source_advertiser_id | String | 原始广告主ID（来源平台的广告主唯一标识） |
| store_ad_count | Long | 该主页为当前店铺投放的广告数量 |
| ads_library_link | String | Meta广告资料库链接，可直接跳转到Facebook官方广告资料库查看该主页的所有广告 |

## 响应示例

```json
{
  "code": 200,
  "message": "success",
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": "page_001",
        "name": "Fashion Store Official",
        "profile_picture_url": "https://example.com/images/page_avatar_001.jpg",
        "category_name": "购物与零售",
        "like_count": 125000,
        "creation_time": 1520000000,
        "ad_platform": [
          "FACEBOOK",
          "INSTAGRAM"
        ],
        "ad_count": 350,
        "ad_source": 3,
        "source_advertiser_id": "100123456789012",
        "store_ad_count": 280,
        "ads_library_link": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=100123456789012"
      },
      {
        "id": "page_002",
        "name": "Fashion Store - US",
        "profile_picture_url": "https://example.com/images/page_avatar_002.jpg",
        "category_name": "电子商务网站",
        "like_count": 45000,
        "creation_time": 1580000000,
        "ad_platform": [
          "FACEBOOK",
          "INSTAGRAM",
          "MESSENGER"
        ],
        "ad_count": 180,
        "ad_source": 3,
        "source_advertiser_id": "100987654321098",
        "store_ad_count": 150,
        "ads_library_link": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=100987654321098"
      },
      {
        "id": "page_003",
        "name": "Fashion Deals & Offers",
        "profile_picture_url": "https://example.com/images/page_avatar_003.jpg",
        "category_name": "品牌",
        "like_count": 8500,
        "creation_time": 1650000000,
        "ad_platform": [
          "FACEBOOK"
        ],
        "ad_count": 45,
        "ad_source": 3,
        "source_advertiser_id": "100111222333444",
        "store_ad_count": 45,
        "ads_library_link": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=100111222333444"
      }
    ],
    "first_page_url": "https://api.example.com/pages?page=1",
    "from": 1,
    "is_logged_in": false,
    "last_page": 2,
    "last_page_url": "https://api.example.com/pages?page=2",
    "next_page_url": "https://api.example.com/pages?page=2",
    "path": "https://api.example.com/pages",
    "per_page": 20,
    "prev_page_url": null,
    "to": 3,
    "total": 25
  },
  "version": "v1",
  "timestamp": null,
  "sign": null,
  "remaining_credits": 9980,
  "consumed_credits": 0,
  "success": true,
  "fail": false
}
```

## 错误码说明

| 错误码 | 描述           |
| ------ | -------------- |
| 200    | 成功           |
| 400    | 请求参数错误   |
| 401    | 未授权         |
| 403    | 权限不足       |
| 500    | 服务器内部错误 |