# AI Facebook Post Analyzer (`devninja/ai-facebook-post-analyzer`) Actor

This actor transforms Facebook posts into actionable business insights. Search for posts about any topic, analyze them with AI, and get intelligent answers to your business questions. Perfect for market research, brand monitoring, trend analysis, and competitive intelligence.

- **URL**: https://apify.com/devninja/ai-facebook-post-analyzer.md
- **Developed by:** [Devinja](https://apify.com/devninja) (community)
- **Categories:** AI, E-commerce, Social media
- **Stats:** 139 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## AI Facebook Post Analyzer

This actor transforms Facebook posts into actionable business insights. Search for posts about any topic, analyze them with AI, and get intelligent answers to your business questions. Perfect for market research, brand monitoring, trend analysis, and competitive intelligence.

### What It Does

Our platform automatically finds, extracts, and analyzes Facebook posts about any topic you specify, then provides intelligent answers to your business questions.

### Key Features

#### 🔍 Smart Post Discovery
- Search Facebook for posts about any topic (AI, robots, climate change, etc.)
- Automatically collect relevant posts from multiple authors
- Focus on the most recent and engaging content

#### 🤖 AI-Powered Analysis
- Ask any questions about the collected posts
- Get intelligent summaries and insights
- Understand sentiment, trends, and key themes
- Identify what people are really saying about your topic

#### 📊 Complete Traceability
- Every answer links back to the original Facebook posts
- See which authors contributed to each insight
- Direct links to source posts for verification
- Full transparency in AI reasoning

#### 🔗 Business Integration
- Webhook notifications for automated workflows
- Structured data output for easy integration
- Real-time processing for timely insights
- Compatible with existing business systems

### Use Cases

#### Market Research
- **"What are people saying about our product?"**
- **"How do customers feel about our competitors?"**
- **"What features do users want most?"**

#### Trend Analysis
- **"What's trending in artificial intelligence?"**
- **"How is public opinion changing on climate policies?"**
- **"What emerging technologies are people excited about?"**

#### Brand Monitoring
- **"What's the sentiment around our brand launch?"**
- **"Are there any concerns about our service?"**
- **"How are influencers talking about our industry?"**

#### Content Strategy
- **"What type of content gets the most engagement?"**
- **"Which topics resonate with our audience?"**
- **"How should we position our messaging?"**

### How It Works

1. **Define Your Topic** - Specify what you want to research (e.g., "artificial intelligence")
2. **Set Your Scope** - Choose how many posts to analyze (5, 50, 500+)
3. **Ask Your Questions** - Define what insights you need from the data
4. **Get AI Answers** - Receive intelligent analysis with full source attribution

### Sample Output

**Topic:** Artificial Intelligence  
**Posts Analyzed:** 5  
**Questions:** 
- "What AI can do to human?"
- "What is the future of AI?"

**Results:**
````

Question: What AI can do to human?
Answer: Based on recent Facebook discussions, people are excited about AI's potential to enhance human capabilities, automate routine tasks, and solve complex problems. However, there are also concerns about job displacement and the need for responsible AI development.

Source: Post by Tech Enthusiast (facebook.com/post/123456)

````

### Business Benefits

- **Save Time** - No more manual social media monitoring
- **Gain Insights** - Understand public opinion at scale
- **Stay Informed** - Track trends and sentiment changes
- **Make Decisions** - Data-driven insights for strategy
- **Reduce Risk** - Early detection of reputation issues
- **Competitive Edge** - Monitor competitor discussions

### Getting Started

1. Configure your search topic and question scope
2. Run the analysis
3. Review AI-generated insights
4. Take action based on findings

### Perfect For

- **Marketing Teams** - Understanding customer sentiment
- **Product Managers** - Identifying user needs and pain points
- **Business Analysts** - Market research and competitive intelligence
- **Content Creators** - Finding trending topics and audience interests
- **Brand Managers** - Monitoring brand reputation and perception
- **Research Teams** - Collecting and analyzing social media data

---

**Transform social media noise into business intelligence with AI-powered Facebook post analysis.**

# Actor input Schema

## `topic` (type: `string`):

Search term to find Facebook posts (e.g., 'technology', 'marketing', 'news')
## `questions` (type: `array`):

Enter questions as JSON array: ["What is this about?", "Who wrote this?"]
## `limit` (type: `integer`):

Maximum number of posts to scrape (1-10000)
## `answer_webhook` (type: `string`):

URL to submit answer results after processing completes (optional)
## `webhook_token` (type: `string`):

Bearer token for webhook authentication (optional but recommended if using webhook). Can be any custom string (e.g., 'my-secret-token-123').
## `webhook_method` (type: `string`):

HTTP method to use for webhook submission

## Actor input object example

```json
{
  "topic": "artificial intelligence",
  "questions": [
    "What are the most popular opinions in these posts?",
    "What trends are people talking about?"
  ],
  "limit": 20,
  "answer_webhook": "https://your-api.com/webhook/answers",
  "webhook_method": "POST"
}
````

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "questions": [
        "What are the most popular opinions in these posts?",
        "What trends are people talking about?"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("devninja/ai-facebook-post-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "questions": [
        "What are the most popular opinions in these posts?",
        "What trends are people talking about?",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("devninja/ai-facebook-post-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "questions": [
    "What are the most popular opinions in these posts?",
    "What trends are people talking about?"
  ]
}' |
apify call devninja/ai-facebook-post-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=devninja/ai-facebook-post-analyzer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AI Facebook Post Analyzer",
        "description": "This actor transforms Facebook posts into actionable business insights. Search for posts about any topic, analyze them with AI, and get intelligent answers to your business questions. Perfect for market research, brand monitoring, trend analysis, and competitive intelligence.",
        "version": "1.0",
        "x-build-id": "Zfd9qs14dt4mVDH1L"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/devninja~ai-facebook-post-analyzer/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-devninja-ai-facebook-post-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/devninja~ai-facebook-post-analyzer/runs": {
            "post": {
                "operationId": "runs-sync-devninja-ai-facebook-post-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/devninja~ai-facebook-post-analyzer/run-sync": {
            "post": {
                "operationId": "run-sync-devninja-ai-facebook-post-analyzer",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "topic",
                    "questions"
                ],
                "properties": {
                    "topic": {
                        "title": "Topic is about?",
                        "minLength": 5,
                        "maxLength": 30,
                        "type": "string",
                        "description": "Search term to find Facebook posts (e.g., 'technology', 'marketing', 'news')",
                        "default": "technology"
                    },
                    "questions": {
                        "title": "Questions",
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "description": "Enter questions as JSON array: [\"What is this about?\", \"Who wrote this?\"]"
                    },
                    "limit": {
                        "title": "Maximum Posts",
                        "minimum": 1,
                        "maximum": 250,
                        "type": "integer",
                        "description": "Maximum number of posts to scrape (1-10000)",
                        "default": 20
                    },
                    "answer_webhook": {
                        "title": "Webhook URL For Answers",
                        "type": "string",
                        "description": "URL to submit answer results after processing completes (optional)",
                        "default": ""
                    },
                    "webhook_token": {
                        "title": "Webhook Authentication Token",
                        "type": "string",
                        "description": "Bearer token for webhook authentication (optional but recommended if using webhook). Can be any custom string (e.g., 'my-secret-token-123')."
                    },
                    "webhook_method": {
                        "title": "Webhook HTTP Method",
                        "enum": [
                            "POST",
                            "PUT"
                        ],
                        "type": "string",
                        "description": "HTTP method to use for webhook submission",
                        "default": "POST"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
