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

# Ads API: Boost Facebook and Instagram Posts and Manage Google Ads

> Boost your Meta posts and create Google Ads using Ayrshare's API.

## Introduction to the Ads API

The Ayrshare Ads API provides programmatic access to create, manage, and analyze social media ads.

The Ayrshare Ads API supports **Facebook / Instagram and Google**. For Google, create and manage [Search campaigns](https://www.ayrshare.com/docs/apis/ads/google/search-campaigns.md) or [Performance Max campaigns](https://www.ayrshare.com/docs/apis/ads/google/performance-max-campaigns.md).

For Facebook and Instagram, the Facebook Ads API, also known as the Facebook Marketing API, allows you to transform existing posts into paid advertisements.
This includes boosting posts (transforming a post into an ad), managing ads, tracking performance, and analyzing ad spend.

Ads created and updated via Ayrshare can always be found in the Facebook Ads Manager.
Ayrshare handles all of the settings at the ad, ad set, and campaign levels.
There is never a need to manually edit any of the settings directly in the Facebook Ads Manager.

> [!NOTE]
>
> For Instagram connection requirements and request examples, see [Instagram Ads](https://www.ayrshare.com/docs/apis/ads/instagram/boost-post.md). The walkthrough below uses Facebook.

> [!NOTE]
>
> 1. The Ads capabilities require the paid Ads add-on which can be enabled on the
>    Account page of the [web dashboard](https://app.ayrshare.com/account).
>
> 2. The ad account you boost from must have a [payment method](https://business.facebook.com/billing_hub/payment_settings/?placement=ads_manager) attached at Facebook (Meta) before you create an ad. One saved only on the business portfolio is not enough. For Meta's other account prerequisites, see [Boost Post](https://www.ayrshare.com/docs/apis/ads/facebook/boost-post.md).
>
> 3. User Profiles linked with a Facebook Page prior to April 1, 2025 should be
>    re-linked to enable ads.

For more information, see our [Facebook Ads API guide](https://www.ayrshare.com/blog/facebook-ads-api-boosting-with-the-marketing-api/).

## Supported Platforms

Each Ads endpoint takes the network as its path segment, for example `/ads/facebook/accounts` or `/ads/instagram/accounts`.
`code: 101` means the network is not an Ads network or does not offer that endpoint. `code: 424` means ads on that network are temporarily unavailable.

| Endpoint | Platforms |
| - | - |
| `GET /ads/{platform}/accounts` | `facebook`, `instagram`, `google` |
| `GET /ads/{platform}/interests` | `facebook`, `instagram` |
| `GET /ads/{platform}/campaigns` | `facebook`, `instagram` |
| `POST /ads/{platform}/campaigns` | `google` |
| `GET /ads/{platform}/campaigns/{id}` | `google` |
| `PUT /ads/{platform}/campaigns/{id}` | `google` |
| `POST /ads/{platform}/boost` | `facebook`, `instagram` |
| `GET /ads/{platform}/ads` | `facebook`, `instagram` |
| `PUT /ads/{platform}/ads` | `facebook`, `instagram` |
| `GET /ads/{platform}/history` | `facebook`, `instagram` |
| `GET /ads/{platform}/insights` | `facebook`, `instagram`, `google` |
| `GET /ads/{platform}/dsaRecommendations` | `facebook`, `instagram` |
| `GET /ads/{platform}/regions` | `facebook`, `instagram` |
| `GET /ads/{platform}/cities` | `facebook`, `instagram` |

## Create an Ad Flow

![Ads Flow](https://mintcdn.com/ayrshare-docs/Nmrhj2Gh7WSf62Bh/images/apis/ads/ads-flow.webp?fit=max\&auto=format\&n=Nmrhj2Gh7WSf62Bh\&q=85\&s=3e57ee2134ddc3bb0937acf5b3d31781)

Boosting a post on Facebook is a quick and simple way to turn one of your
existing posts into an ad. Here is a high-level flow of how to implement it in
your platform:

**1. Choose the Facebook Ad Account**

Your user will choose the Facebook ad account which has all the billing details already configured.

> [card] [Get Facebook Ad Accounts](https://www.ayrshare.com/docs/apis/ads/facebook/get-ad-accounts.md)

**2. Select the Post**

Select a post from your Facebook page. It can be a photo, video, status update, etc.

> **Tip:** Posts with good organic engagement (likes, shares, comments) tend to perform better when boosted.

**3. Click “Boost Post”**

Your user will click a button such as "Boost Post" in your platform to start
setting up the ad.

> [card] [Boost a post by submitting it to Facebook's ad platform](https://www.ayrshare.com/docs/apis/ads/facebook/boost-post.md)

**4. Set the Goal, Audience, Budget, & Duration**

The user can set a number of parameters.

<ul>
  <li>
    Choose the goal strategy for this
    boosted post by selecting a goal.
  </li>

  <li>Customize the audience based on age, gender,
  location, interests, etc.</li>
  <li>Choose how much to spend total.</li>
  <li>Set the
  time period to run the ad.</li>
</ul>

**5. Review & Boost**

Double-check all the settings. If everything looks good, the user will click a button such as **"Boost Post Now"** button.

**6. Ad Review & Launch**

Facebook will review the ad — this usually takes anywhere from a few minutes
to a few hours. Once approved, the boosted post goes live and runs according
to the setup.

**7. Track Spend & Performance**

Monitor the following:

* Reach
* Engagement
* Clicks
* Spend
* Budget Remaining

> [card] [Get Facebook Ad Spend & Analytics](https://www.ayrshare.com/docs/apis/ads/facebook/get-ad-history.md)

## Ads API Best Practices

1. **Budget Management**: Start with small test budgets (e.g., \$5-10/day) to optimize performance before scaling.
2. **Ad Duration**: Facebook requires a minimum ad runtime of approximately 30 hours between start and end times.
3. **Interest Targeting**: Choose 2-5 relevant interests for optimal targeting precision.
4. **Creative Guidelines**: Use high-quality images and concise messaging to improve engagement rates.
5. **Performance Monitoring**: Regularly check your ad performance and adjust targeting or creative elements as needed.

For detailed information about each endpoint, including request parameters, response formats, and examples, please refer to the individual API endpoint documentation pages.


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