home / skills / openclaw / skills / facebook

facebook skill

/skills/mrgoodb/facebook

This skill helps you manage Facebook Pages by posting content, reading comments, and analyzing engagement via Graph API.

npx playbooks add skill openclaw/skills --skill facebook

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.9 KB
---
name: facebook
description: Manage Facebook Pages, posts, and insights via Graph API. Post content, read comments, and analyze engagement.
metadata: {"clawdbot":{"emoji":"👤","requires":{"env":["FACEBOOK_ACCESS_TOKEN","FACEBOOK_PAGE_ID"]}}}
---

# Facebook

Social media platform (Pages API).

## Environment

```bash
export FACEBOOK_ACCESS_TOKEN="xxxxxxxxxx"  # Page Access Token
export FACEBOOK_PAGE_ID="xxxxxxxxxx"
```

## Get Page Info

```bash
curl "https://graph.facebook.com/v18.0/$FACEBOOK_PAGE_ID?fields=name,followers_count,fan_count" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"
```

## Get Page Posts

```bash
curl "https://graph.facebook.com/v18.0/$FACEBOOK_PAGE_ID/posts?fields=message,created_time,shares,likes.summary(true)" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"
```

## Create Post

```bash
curl -X POST "https://graph.facebook.com/v18.0/$FACEBOOK_PAGE_ID/feed" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -d "message=Hello from automation!"
```

## Post with Image

```bash
curl -X POST "https://graph.facebook.com/v18.0/$FACEBOOK_PAGE_ID/photos" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -F "url=https://example.com/image.jpg" \
  -F "caption=Check this out!"
```

## Get Post Comments

```bash
curl "https://graph.facebook.com/v18.0/{post_id}/comments" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"
```

## Get Page Insights

```bash
curl "https://graph.facebook.com/v18.0/$FACEBOOK_PAGE_ID/insights?metric=page_impressions,page_engaged_users&period=day" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"
```

## Reply to Comment

```bash
curl -X POST "https://graph.facebook.com/v18.0/{comment_id}/comments" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -d "message=Thanks for your comment!"
```

## Links
- Business: https://business.facebook.com
- Docs: https://developers.facebook.com/docs/graph-api

Overview

This skill manages Facebook Pages, posts, comments, and insights using the Facebook Graph API. It enables automated publishing, media uploads, comment handling, and basic engagement analytics for a Page access token and Page ID. Use it to centralize routine social tasks and extract actionable metrics.

How this skill works

The skill issues Graph API requests authenticated with a Page Access Token and targets the specified Page ID. It can fetch page metadata, list posts with engagement summaries, publish text and photo posts, read and reply to comments, and retrieve daily page insights like impressions and engaged users. Endpoints are used directly for lightweight automation or integration into larger workflows.

When to use it

  • Automate posting of announcements, promotions, or scheduled updates to a Facebook Page.
  • Monitor and respond to audience comments to maintain engagement and customer service.
  • Aggregate page metrics for daily or weekly reporting on impressions and engaged users.
  • Backup page content, post histories, and comment threads for archival purposes.
  • Integrate Facebook Page actions into a broader CRM or social dashboard.

Best practices

  • Store and rotate Page Access Tokens securely; avoid embedding tokens in source control.
  • Use fields and summaries in API queries to minimize payload size and rate usage.
  • Respect rate limits and implement retry/backoff logic for transient API errors.
  • Only request permissions your workflow needs and follow Facebook platform policies.
  • Batch metric requests where possible and cache frequently used page metadata.

Example use cases

  • Post a daily status update and attach an image via the photos endpoint for higher engagement.
  • Fetch recent posts with like and share summaries to identify top-performing content.
  • Reply automatically to new comments with templated responses for common inquiries.
  • Pull daily page_impressions and page_engaged_users to populate a performance dashboard.
  • Export posts and comments periodically to an archive store for compliance or backup.

FAQ

What credentials are required to run the skill?

A valid Facebook Page Access Token and the Page ID are required. Set them as environment variables or provide them securely to your integration.

Can I post images and captions?

Yes. Use the photos endpoint to upload by URL or file and include a caption for the post.