> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Facebook page

> Read a Facebook page as JSON with the facebook-page parser. $1 per 1,000 calls. Send the page to scrape. Examples in cURL, TypeScript and Python.

Reads a Facebook page, like facebook.com/NASA, and returns one profile as JSON.

## Make a request

Send the page's URL to [scrape](https://docs.stophy.dev/api-reference/endpoint/scrape.md) with a `json` format that names the parser. Get an API key in the [Quickstart](https://docs.stophy.dev/quickstart).

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.facebook.com/NASA","formats":[{"type":"json","parser":"facebook-page"}]}'
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.stophy.dev/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STOPHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.facebook.com/NASA",
    formats: [{ type: "json", parser: "facebook-page" }],
  }),
});
console.log(await response.json());
```

```python Python theme={null}
import os

import requests

response = requests.post(
    "https://api.stophy.dev/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['STOPHY_API_KEY']}"},
    json={
        "url": "https://www.facebook.com/NASA",
        "formats": [{"type": "json", "parser": "facebook-page"}],
    },
)
print(response.json())
```

## Read the response

The parser's data is in `data.json`. Its fields include `id`, `url`, `handle`, `name`, `bio`, `avatarUrl`, `isVerified`, `followers`, `following`, `posts`, `website`, `location` and `category`. This sample is cut to the first items.

```json theme={null}
{
  "success": true,
  "data": {
    "json": {
      "id": "54971236771",
      "url": "https://www.facebook.com/NASA",
      "handle": "NASA",
      "name": "NASA - National Aeronautics and Space Administration",
      "bio": "Explore the universe and discover our home planet. \nThere's space for everybody. ✨",
      "avatarUrl": "https://scontent.ffcm1-1.fna.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cs…",
      "isVerified": true,
      "followers": 28733329,
      "following": null,
      "posts": null,
      "website": "https://www.nasa.gov/nasa-app/",
      "location": null,
      "category": "Government organization",
      "likes": null,
      "talkingAboutThis": 76844,
      "phone": null,
      "email": "name@example.com",
      "websites": [
        "https://www.nasa.gov/nasa-app/",
        "https://www.nasa.gov/"
      ],
      "priceRange": null,
      "coverUrl": "https://scontent.ffcm1-1.fna.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_t…"
    }
  }
}
```

## Options

Send options in the `options` object of the `json` format.

| Option | What it does |
| - | - |
| `view` | Picks one of the answers this parser can give: `posts`. |

## Price

\$1 per 1,000 calls. See [Pricing](https://docs.stophy.dev/account/pricing.md).

## Limits and errors

* The URL must be a Facebook page, like facebook.com/NASA. Send options view posts for the page's posts. Any other URL fails with `invalidRequest`.
* The answer comes back in `data.json`. If the page cannot be read, the call fails with an error code from [Errors](https://docs.stophy.dev/api-reference/errors.md).

## Related

* [Pre-built parsers](https://docs.stophy.dev/scrape/prebuilt-parsers) lists every parser.
* [Scrape](https://docs.stophy.dev/scrape/overview) has the options every scrape takes.
* [Facebook post](https://docs.stophy.dev/scrape/prebuilt-parsers/social/facebook-post.md)
* [Facebook comments](https://docs.stophy.dev/scrape/prebuilt-parsers/social/facebook-comments.md)
* [Facebook marketplace](https://docs.stophy.dev/scrape/prebuilt-parsers/shopping/facebook-marketplace.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.