# facebook-business

> Facebook Business SDK

- **URL**: https://www.freshcrate.ai/projects/facebook-business
- **Author**: Facebook
- **Category**: Frameworks
- **Latest version**: `25.0.1` (2026-04-21)
- **License**: non-standard
- **Source**: https://github.com/facebook/facebook-python-business-sdk/tarball/25.0.1
- **Homepage**: https://github.com/facebook/facebook-python-business-sdk
- **Language**: Python
- **GitHub**: 1,523 stars, 668 forks
- **Registry**: pypi (`facebook-business`)
- **Tags**: `pypi`

## Description

# Facebook Business SDK for Python

[![PyPI](https://img.shields.io/pypi/v/facebook-business)](https://pypi.org/project/facebook-business/)
[![Build Status](https://img.shields.io/github/actions/workflow/status/facebook/facebook-python-business-sdk/ci.yml)](https://github.com/facebook/facebook-python-business-sdk/actions/workflows/ci.yml)
[![License](https://img.shields.io/badge/license-Facebook%20Platform-blue.svg?style=flat-square)](https://github.com/facebook/facebook-python-business-sdk/blob/main/LICENSE.txt)

### Introduction

The Facebook <a href="https://developers.facebook.com/docs/business-sdk" target="_blank">Business SDK</a> is a one-stop-shop to help our partners better serve their businesses. Partners are using multiple Facebook API's to serve the needs of their clients. Adopting all these API's and keeping them up to date across the various platforms can be time consuming and ultimately prohibitive. For this reason Facebook has developed the Business SDK bundling many of its APIs into one SDK to ease implementation and upkeep. The Business SDK is an upgraded version of the Marketing API SDK that includes the Marketing API as well as many Facebook APIs from different platforms such as Pages, Business Manager, Instagram, etc.

## Quick Start

Business SDK <a href="https://developers.facebook.com/docs/business-sdk/getting-started" target="_blank">Getting Started Guide</a>

Python is currently the most popular language for our third-party developers. `facebook_business` is a Python package that provides an interface between your Python application and <a href="https://developers.facebook.com/docs/business-sdk/reference" target="_blank">Facebook's APIs within the Business SDK</a>. This tutorial covers the basic knowledge needed to use the SDK and provides some exercises for the reader.

**NOTE**: ``facebook_business`` package is compatible with Python 2 and 3!

## Pre-requisites

### Register An App

To get started with the SDK, you must have an app
registered on <a href="https://developers.facebook.com/" target="_blank">developers.facebook.com</a>.

To manage the Marketing API, please visit your
<a href="https://developers.facebook.com/apps/<YOUR APP ID>/dashboard"> App Dashboard </a>
and add the <b>Marketing API</b> product to your app.

**IMPORTANT**: For security, it is recommended that you turn on 'App Secret
Proof for Server API calls' in your app's Settings->Advanced page.

### Obtain An Access Token

When someone connects with an app using Facebook Login and approves the request
for permissions, the app obtains an access token that provides temporary, secure
access to Facebook APIs.

An access token is an opaque string that identifies a User, app, or Page.

For example, to access the Marketing API, you need to generate a user access token
for your app and ask for the ``ads_management`` permission; to access Pages API,
you need to generate a Page access token for your app and ask for the ``manage_page`` permission.

Refer to our
<a href="https://developers.facebook.com/docs/facebook-login/access-tokens" target="_blank">
Access Token Guide</a> to learn more.

For now, we can use the
<a href="https://developers.facebook.com/tools/explorer" target="_blank">Graph Explorer</a>
to get an access token.

## Install package

The easiest way to install the SDK is via ``pip`` in your shell.

**NOTE**: For Python 3, use ``pip3`` and ``python3`` instead.

**NOTE**: Use ``sudo`` if any of these complain about permissions. (This might
happen if you are using a system installed Python.)

If you don't have pip:

```
easy_install pip
```

Now execute when you have pip:

```
pip install facebook_business
```

If you care for the latest version instead of a possibly outdated version in the
<a href="https://pypi.python.org" target="_blank">pypi.python.org</a> repository,
<a href="https://github.com/facebook/facebook-python-business-sdk">check out the
repository from GitHub or download a release tarball</a>. Once you've got the
package downloaded and unzipped, install it:

```
python setup.py install
```

Great, now you are ready to use the SDK!

## Bootstrapping

### Create test.py
Create a test.py file with the contents below (assuming your system is using python 2.7 and installed under /opt/homebrew. Update to your proper python location.):

```python
import sys
sys.path.append('/opt/homebrew/lib/python2.7/site-packages') # Replace this with the place you installed facebookads using pip
sys.path.append('/opt/homebrew/lib/python2.7/site-packages/facebook_business-3.0.0-py2.7.egg-info') # same as above

from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.adaccount import AdAccount

my_app_id = 'your-app-id'
my_app_secret = 'your-appsecret'
my_access_token = 'your-page-access-token'
FacebookAdsApi.init(my_app_id, my_app_secret, my_access_token)
my_account = AdAccount('act_<your-adaccount-id>')
campaigns = my_account.get_campaigns()
print(campaigns)
```

### Test Your Install
Test you

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `25.0.1` | 2026-04-21 | Low | Imported from PyPI (25.0.1) |
| `25.0.0` | 2026-03-10 | Low | In this release, Advantage+ Shopping Campaigns (ASC) and Advantage+ App Campaigns (AAC) can no longer be created or updated via the Marketing API starting v25.0, extending to all versions by May 19, 2026, as part of the Automation Unification toward the streamlined Advantage+ setup. The Ads Insights Async API now returns detailed error information on report failures, and several legacy metrics including Page Reach, Impressions, and 3-second Viewers are planned for deprecation in June 2026 in fav |
| `24.0.1` | 2025-11-20 | Low | **Full Changelog**: https://github.com/facebook/facebook-python-business-sdk/compare/24.0.0...24.0.1 |
| `24.0.0` | 2025-10-24 | Low | In this release, there are major changes like Dynamic Media will be enabled by default for Advantage+ Catalog ads via the Marketing API, requiring developers to explicitly opt out if desired. The daily budget flexibility is increased from 25% to 75%, allowing higher spend on days with better opportunities while maintaining weekly spend limits. A new feature allows up to 20% of an ad set’s daily budget to be shared with other ad sets in the same campaign for improved performance without campaign |
| `23.0.3` | 2025-10-14 | Low | **Full Changelog**: https://github.com/facebook/facebook-python-business-sdk/compare/23.0.2...23.0.3 |
| `23.0.2` | 2025-09-26 | Low | **Full Changelog**: https://github.com/facebook/facebook-python-business-sdk/compare/23.0.1...23.0.2 |
| `23.0.1` | 2025-07-18 | Low | **Full Changelog**: https://github.com/facebook/facebook-python-business-sdk/compare/23.0.0...23.0.1 |
| `23.0.0` | 2025-06-17 | Low | In this release, we introduced version one of ThirdPartyAccount library in Python and Node.js SDKs to simplify the usage of the 2Tier APIs. Additionally, updated parameter list for the original_event_data parameter. We are planning to extend these features to other languages soon. **Full Changelog**: https://github.com/facebook/facebook-python-business-sdk/compare/22.0.5...23.0.0 |
| `22.0.5` | 2025-05-06 | Low | This release contains V1 of ThirdPartyAccount Library - SDK library to simplify the usage of the 2 Tier APIs  **Full Changelog**: https://github.com/facebook/facebook-python-business-sdk/compare/22.0.4...22.0.5 |
| `22.0.4` | 2025-04-11 | Low | **Full Changelog**: https://github.com/facebook/facebook-python-business-sdk/compare/22.0.3...22.0.4 |

## Citation

- HTML: https://www.freshcrate.ai/projects/facebook-business
- Markdown: https://www.freshcrate.ai/projects/facebook-business.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/facebook-business/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
