---
title: "Profile"
description: "获取 Facebook 公共主页的资料：名称、类别、粉丝数、链接和联系方式。"
---

> Every apinoa docs page as markdown: https://apinoa.com/llms.txt (all in one file: https://apinoa.com/llms-full.txt; this API family in one file: https://apinoa.com/docs/social/llms.txt)

```http
GET | POST /v1/facebook/profile
```

参数可以用 `GET` 的查询字符串发送，也可以用 `POST` 的 JSON 请求体发送，两者等价。

## 请求

```bash tab="cURL"
curl "https://gateway.apinoa.com/v1/facebook/profile?username=nasa" \
  -H "x-api-key: $APINOA_API_KEY"
```

```js tab="JavaScript"
const params = new URLSearchParams({ username: "nasa" });
const res = await fetch(`https://gateway.apinoa.com/v1/facebook/profile?${params}`, {
  headers: { "x-api-key": process.env.APINOA_API_KEY },
});
const { success, data, error } = await res.json();
```

```python tab="Python"
import os

import requests

res = requests.get(
    "https://gateway.apinoa.com/v1/facebook/profile",
    params={"username": "nasa"},
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## 传入内容

| 传入 | 读取内容 | 说明 |
|---|---|---|
| `username` | 该主页 | 其自定义名称（`nasa`）、数字 id 或主页 URL |

所有标识符也都接受页面 URL。

## 参数

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `username` | string |  | The Page's vanity name (e.g. nasa), its numeric id, or the Page URL. |

The same parameters, and every response type, are in the OpenAPI document: https://apinoa.com/openapi.json

## 响应

在 `data` 中返回 [`Account`](/docs/api-reference/sns/response-schema#account)。 真实响应的节选：数组只保留前几项，长文本已截断。

```json
{
  "success": true,
  "data": {
    "platform": "facebook",
    "id": "54971236771",
    "handle": "NASA",
    "displayName": "NASA - National Aeronautics and Space Administration",
    "bio": "Explore the universe and discover our home planet. \nThere's space for everybody. ✨",
    "url": "https://www.facebook.com/NASA",
    "avatarUrl": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036…",
    "bannerUrl": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.99422-6/809146614_448401392…",
    "verified": true,
    "counts": {
      "followers": 28730940,
      "following": 52
    },
    "links": [
      {
        "url": "https://www.nasa.gov/nasa-app/",
        "title": "nasa.gov/nasa-app"
      },
      {
        "url": "https://www.nasa.gov/",
        "title": "nasa.gov"
      }
    ],
    "category": "Government organization",
    "ext": {
      "profileId": "100044561550831",
      "followersText": "28M followers",
      "followingText": "52 following",
      "talkingAbout": 116622,
      "email": "public-inquiries@hq.nasa.gov",
      "confirmedOwner": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION",
      "categoryText": "Page · Government organization",
      "cover": {
        "id": "1629624498532920",
        "width": 960,
        "height": 697
      },
      "intro": [
        {
          "type": "INTRO_CARD_INFLUENCER_CATEGORY",
          "text": "Page · Government organization"
        },
        {
          "type": "INTRO_CARD_CONFIRMED_OWNER_LABEL",
          "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION",
          "subtitle": "is responsible for this Page"
        }
      ]
    }
  }
}
```

## 错误

| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | `INVALID_PARAMS` | 参数缺失、未知或超出范围。消息中会指出是哪一个。 |
| 401 | `UNAUTHORIZED` | 缺少 `x-api-key` 请求头，或密钥已吊销或未知。 |
| 402 | `INSUFFICIENT_BALANCE` | 余额不足以支付本次调用。请在控制台充值。 |
| 404 | `NOT_FOUND` | 账号、帖子或分组不存在，或为私密、已删除、有年龄限制。 |
| 429 | `MARKETPLACE_SATURATED` | 并发调用过多。请等待 `Retry-After` 秒后重试。 |
| 502 | `UPSTREAM_ERROR` | 平台返回了无法使用的内容。请退避后重试。 |

全部错误代码见 [Errors](/docs/errors)。失败的调用不计费。

## 价格

**Price** $0.001 per call. [List price](https://apinoa.com/en/pricing); the rate steps down above 1,000 calls a day.

## 说明

- 共享字段之外的主页信息（邮箱、电话、地址、营业时间、价格区间、评分、已确认的所有者、简介中的每一项）放在 `ext` 中，沿用主页上显示的名称。
- `id` 就是 `ads` 的 `pageId` 所接受的主页 id。
