Conferences
Tbilisi, Georgia
26-27
June
Yerevan, Armenia
24
May
Yerevan, Armenia
24
May
Yerevan, Armenia
25-27
May
Yerevan, Armenia
25-28
May
Yerevan, Armenia
25-28
May
Manila, Philippines
01-03
June
Moscow, Russia
10
June
Saint Petersburg, Russia
10-11
June
Tbilisi, Georgia
26-27
June
Budapest, Hungary
09-10
July
Limassol, Cyprus
23-24
July
Saint Petersburg, Russia
12-13
August
Mexico City, Mexico
01-03
September
01
September
Cancún, Mexico
07-08
September
Rome, Italy
02-05
November
Bangkok, Thailand
30-02
November -
December
Bangkok, Thailand
09-10
December
Ta’ Qali, Malta
03-07
May

Meta launches Ads CLI for managing adverts via command line


Meta has introduced Ads CLI — a command-line interface for working with Meta Ads and Commerce. The tool is designed for developers and AI agents who work with the Meta Marketing API and wish to manage advertising campaigns directly from the terminal, without writing their own code.

According to Meta, the Marketing API remains a powerful tool, but when working with it, developers constantly have to write the same technical code: authorisation, pagination, output formatting, and error handling. The Ads CLI solves this problem by consolidating the Meta Marketing API into a single tool with predictable commands for managing ads.

For example, you can retrieve a list of campaigns via the command line:

meta ads campaign list

Or export campaign statistics for the last 7 days:

meta ads insights get --campaign_id COMPAIGN_ID --date-preset last_7d —-fields conversions,impressions

Ads CLI supports several output formats, including JSON and plain text with tab-separated values. This is necessary for the tool to be used not only manually, but also in automation, scripts, internal tools, and CI/CD pipelines.

What you can do with Ads CLI

Using Ads CLI, you can create, view, update, and delete campaigns, ad sets, ads, and creatives. By default, new objects are created with a PAUSED status, so a campaign will not start immediately until it is manually switched to an active status.

Example of creating a campaign with a daily budget of 50.00 in the advertising account currency:

meta ads campaign create --name "Summer Sale" --objective OUTCOME_SALES --daily-budget 5000

Creating an ad set:

 meta ads adset create CAMPAIGN_ID --name "My Ad Set"

 --optimization-goal LINK_CLICKS --billing-event IMPRESSIONS 
 --bid-amount 500 --targeting-countries US 

Creating a creative with an image and a button:

meta ads creative create --name "Hero Banner"

 --page-id 111222333 --image ./banner.jpg 
 --body "50% off everything!" --title "Shop Now"

 --link-url https://example.com/sale --call-to-action SHOP_NOW 

Creating an ad based on an ad set and creative:

meta ads ad create ADSET_ID --name "Hero Banner Ad" --creative-id CREATIVE_ID 

Once verified, the campaign, ad set, and ad can be set to active status:

 meta ads campaign update CAMPAIGN_ID --status ACTIVE 
 meta ads adset update ADSET_ID --status ACTIVE 
 meta ads ad update AD_ID --status ACTIVE

Analytics and statistics

The Ads CLI also allows you to view advertising metrics: spend, impressions, CTR, ROAS, and other metrics. Queries can use date ranges, breakdowns by age, gender, platform, and various levels of aggregation.

Example of  campaign statistics export for the last 7 days:

meta ads insights get --campaign_id COMPAIGN_ID --fields=impressions,conversions --date-preset last_7d

This is useful for teams who want to generate reports automatically, without manually exporting data from Ads Manager.

Catalogues and products

The Ads CLI allows you to manage not only advertising campaigns but also catalogues. The tool supports the creation and management of catalogues, products, and product sets.

Creating a catalogue:

meta ads catalog create --name "My Catalog"

Adding a product to the catalogue:

meta ads product-item create --catalog-id 123456 
 --retailer-id sku_a --name "Blue Shirt"

 --url https://example.com/blue_shirt --price "999" --currency "USD"

 --image-url https://example.com/blue_shirt.jpg

View product sets:

meta ads product-set list --catalog-id 123456

Pixels and datasets

A separate section covers datasets. Using the Ads CLI, you can create pixels for conversion tracking, link them to advertising accounts and product catalogues, and configure the connection for conversion tracking.

Creating a dataset:

meta ads dataset create --name "Website Pixel"

Connecting the dataset to an advertising account and catalogue:

meta ads dataset connect 111222 --ad-account-id 333444 --catalog-id 555666

Automation and AI agents

Meta specifically states that meta ads are designed for autonomous execution in CI/CD pipelines, interactive use in the terminal, and use in scripts.

Three output formats are provided for this purpose:

  • table — human-readable output;
  • json — a format for processing via jq and other tools;
  • plain — simple tab-separated values, which are convenient to pass to sort, awk, cut, and other commands.

There are also the —no-input and —force parameters, which disable all interactive requests.

Standard exit codes are used for error handling: for example, 0 for successful execution, 3 for an authorisation error, and 4 for an API error. Environment variables are also supported for tokens, secrets, and advertising account IDs, so as not to store sensitive data in the command history and version control system.

Essentially, Ads CLI provides an official way to work with the Meta Marketing API via commands: creating campaigns, ad sets, ads, and creatives, working with catalogues, gathering statistics, and automating routines without manual work in the interface.

  • Ads CLI requires Python 3.12+ and pip/uv.

Like it? Share with your friends!
0 Comments
Affiliate - Our assessment
Verticals
Min. sum
Site
It’s an affiliate program of the eponymous online casino. A direct advertiser as of 2017. They work by RevShare (up to 50%) partnership strategy.
1,000 rubles/$20/€20 pay
фото
фото
фото
фото
фото
фото
фото
фото
фото
фото
фото
фото
фото
фото
It’s a direct advertiser of Parimatch gambling and betting offers. They provide everything you need for profitable promotion: high and competitive partner rates (with a CPA of up to $200 and RevShare of up to 45%), competent customer support, and unique product. GEO: CIS, Tier 1, Asia, LATAM.
$100 pay
фото
фото
фото
фото
Official affiliate program and direct iGaming advertiser of the international betting company 1win. It has been working in the betting and gambling verticals. It pays out up to 60% using the RevShare model, besides there are customized terms for CPA and Hybrid models.
$100 pay
фото
фото
фото
фото
фото
фото
фото
iGaming affiliate program and direct advertiser of famous licensed gambling offers: FLAGMAN, IRWIN, GIZBO, LEX, MONRO, 1GO, STARDA, IZZI, DRIP, LEGZO, VOLNA, JET, FRESH, SOL and ROX.
$20 pay
фото
фото
фото
фото
фото
фото
StarCrown Partners is an affiliate program in the gambling and betting verticals. It is a direct advertiser of Golden Star and Golden Crown brands. It work with tier-1 GEOs and cooperates on CPA, RevShare, Hybrid models. It accepts all types of traffic except illegal sources and methods.
€50 pay
фото
фото
фото
Direct advertiser of popular European casino and betting brands: Vulkan Vegas, ICE Casino, VERDE Casino, Vulkan Bet, Vulkan Spiele, Slotoro and Hit'N'Spin. Established in 2016, they work on CPA, RevShare, and Hybrid models, accepting traffic from over 55 countries.
€100 pay
фото
фото
фото
фото
фото
фото
It’s our affiliate program with gambling and betting offers. We are currently in beta but we accept traffic.
$20 pay
фото
865
Go to offers