All connectors

Facebook Marketing

Facebook Marketing Connector for AI Agents

Give agents tools for secure, real-time access to fetch, search, write, and sync across every system, with replication, entity mapping, and auth built-in.

20,000+
community members
6,000+
daily active companies
2PB+
synced/month
900+
contributors

About this Connector

Facebook Marketing API connector for managing ad campaigns, ad sets, ads, creatives, and accessing performance insights, pixel configuration, and event quality data. This connector provides read access to Facebook Ads Manager data for analytics and reporting purposes.

CRM

Sales Analytics

Customer Data

digital advertising, ad campaign management, marketing analytics

Version Information

Package version

0.1.53

Connector version

1.0.19

SDK commit

44677ecbb4b815bb4fb2a54c6e5339681bcf36a8

Support Open Source

Check us out on Github and join the Airbyte community

Github

Installation & Usage

Get started with the Facebook Marketing connector in minutes

1

Install Package

Using uv or pip

bash

Copy
uv pip install airbyte-agent-facebook-marketing

2

Import

Initialize and use

python

Copy
from airbyte_agent_facebook_marketing import FacebookMarketingConnector
from airbyte_agent_facebook_marketing.models import FacebookMarketingServiceAccountKeyAuthenticationAuthConfig

connector = FacebookMarketingConnector(
    auth_config=FacebookMarketingServiceAccountKeyAuthenticationAuthConfig(
        account_key="<Facebook long-lived access token for Service Account authentication>"
    )
)

3

Tool

Add tools to your agent

python

Copy
@agent.tool_plain # assumes you're using Pydantic AI
@FacebookMarketingConnector.tool_utils
async def facebook_marketing_execute(entity: str, action: str, params: dict | None = None):
    return await connector.execute(entity, action, params or {})

Supported Entities & Actions

Access all your Facebook Marketing data through a unified API

Lorem ipsum

Lorem ipsum

| Entity | Actions |\n|--------|---------|\n| Current User | [Get](./REFERENCE.md#current-user-get) |\n| Ad Accounts | [List](./REFERENCE.md#ad-accounts-list), [Search](./REFERENCE.md#ad-accounts-search) |\n| Campaigns | [List](./REFERENCE.md#campaigns-list), [Create](./REFERENCE.md#campaigns-create), [Get](./REFERENCE.md#campaigns-get), [Update](./REFERENCE.md#campaigns-update), [Search](./REFERENCE.md#campaigns-search) |\n| Ad Sets | [List](./REFERENCE.md#ad-sets-list), [Create](./REFERENCE.md#ad-sets-create), [Get](./REFERENCE.md#ad-sets-get), [Update](./REFERENCE.md#ad-sets-update), [Search](./REFERENCE.md#ad-sets-search) |\n| Ads | [List](./REFERENCE.md#ads-list), [Create](./REFERENCE.md#ads-create), [Get](./REFERENCE.md#ads-get), [Update](./REFERENCE.md#ads-update), [Search](./REFERENCE.md#ads-search) |\n| Ad Creatives | [List](./REFERENCE.md#ad-creatives-list), [Search](./REFERENCE.md#ad-creatives-search) |\n| Ads Insights | [List](./REFERENCE.md#ads-insights-list), [Search](./REFERENCE.md#ads-insights-search) |\n| Ad Account | [Get](./REFERENCE.md#ad-account-get), [Search](./REFERENCE.md#ad-account-search) |\n| Custom Conversions | [List](./REFERENCE.md#custom-conversions-list), [Search](./REFERENCE.md#custom-conversions-search) |\n| Images | [List](./REFERENCE.md#images-list), [Search](./REFERENCE.md#images-search) |\n| Videos | [List](./REFERENCE.md#videos-list), [Search](./REFERENCE.md#videos-search) |\n| Pixels | [List](./REFERENCE.md#pixels-list), [Get](./REFERENCE.md#pixels-get) |\n| Pixel Stats | [List](./REFERENCE.md#pixel-stats-list) |\n| Ad Library | [List](./REFERENCE.md#ad-library-list) |

Example Prompts

The Facebook Marketing connector is optimized to handle prompts like these

Lorem ipsum

List all active campaigns in my ad account - What ads are currently running in a recent campaign? - List all ad creatives in my account - What is the status of my campaigns? - List all custom conversion events in my account - Show me all ad images in my account - What videos are available in my ad account? - Create a new campaign called 'Summer Sale 2026' with traffic objective - Pause my most recent campaign - Create a new ad set with a $50 daily budget in my latest campaign - Update the daily budget of my top performing ad set to $100 - Rename my most recent ad set to 'Holiday Promo' - Create a new ad in my latest ad set - Pause all ads in my most recent ad set - List all pixels in my ad account - Show me the event stats for my pixel - What events is my Facebook pixel tracking? - Search the Ad Library for political ads in the US - Find ads about climate change in the Ad Library - Show me Ad Library ads from a specific Facebook page - Show me the ad sets with the highest daily budget - Show me the performance insights for the last 7 days - Which campaigns have the most spend this month? - Show me ads with the highest click-through rate

Why Airbyte for AI Agents?

Built for production AI workloads with enterprise-grade reliability

Agent-Native Design

Structured, LLM-friendly schemas optimized for AI agent consumption with natural language query support.

Secure Authentication

Built-in OAuth 2.0 handling with automatic token refresh. No hard-coded credentials.

Production Ready

Battle-tested connectors with comprehensive error handling, logging, and retry logic.

Open Source

Fully open source under the MIT license. Contribute, customize, and extend freely.

Works with your favorite frameworks

Use the Facebook Marketing connector with any AI agent framework

🦜

LangChain

🦙

LlamaIndex

🤖

CrewAI

AutoGen

🧠

OpenAI Agents SDK

🔮

Claude Agents SDK

Frequently Asked Questions

Didn't find your answer? Please don't hesitate to reach out.

How do I authenticate with Facebook Marketing?

The facebook-marketing connector supports Service Account Key authentication using a Facebook long-lived access token. In hosted mode, credentials are stored securely in Airbyte Cloud and you authenticate using your Airbyte client credentials (client ID and client secret) along with your customer name and optional organization ID.

Can I use this connector with any AI agent framework?

The connector is compatible with any Python-based AI agent framework including LangChain, LlamaIndex, CrewAI, Pydantic AI, and custom implementations.

Does this connector support write operations?

The facebook-marketing connector supports several write operations including creating and updating campaigns, ad sets, and ads. However, delete operations are not currently supported — you cannot delete ad creatives, campaigns, ad sets, or ads through this connector.

How is this different from the Airbyte data connector?

Agent connectors are specifically designed for AI agents and LLM applications. They provide natural language interfaces, optimized response formats, and seamless integration with agent frameworks, unlike traditional ETL-focused connectors.

Will there be a platform for agent connectors?

The hosted version with secure credential storage through Airbyte Cloud is already available. See the hosted usage section in the documentation for setup instructions.

20,000+
community members
6,000+
daily active companies
2PB+
synced/month
900+
contributors