Adlyfy Academy
Guides

Getting your Meta Marketing API credentials, step by step

Before you can pull a single campaign from Meta, you need a developer app, the Marketing API product, and an access token carrying the right scopes. Here's the full credential setup — walked through on video and written out below.

The Meta Marketing API is the gateway to Facebook and Instagram advertising — campaigns, ad sets, creatives, and insights. But before your very first call returns data, you have to get through Meta's credential setup: a developer account, an app, the Marketing API product, and an access token carrying the right permissions. This guide walks through exactly that. Follow along with the video, or use the written steps underneath it.

What you're working towardBy the end you'll have four values: an App ID, an App Secret, an access token with the right scopes, and your ad account ID. With those in hand, every later API call is just a request away.

Before you start

  • A Facebook account you can sign in with.
  • A Meta Business account (Business Manager) — advertising apps are tied to a business, not a personal profile.
  • Access to the ad account you want to read from or manage.

Step 1 — Register as a Meta developer

Go to developers.facebook.com and click Get Started in the top-right. Sign in with your Facebook account, accept Meta's Platform Terms and Developer Policies, and verify your account. This turns your normal Facebook login into a developer account — a one-time step.

Step 2 — Create an app

From the App Dashboard, click Create App. When Meta asks what you're building, choose the Business app type — it's the one wired for advertising and exposes the Marketing API. Give the app a name and a contact email, then connect it to your Business account.

Step 3 — Add the Marketing API product

Inside your new app, open Add Product and add Marketing API. This is the step that unlocks the ads endpoints and the token tools you'll use next — without it, the app can authenticate but can't touch campaign data.

Step 4 — Grab your App ID and App Secret

Open Settings → Basic. Your App ID and App Secret live here. The App ID is public; the App Secret is not — treat it like a password and never expose it in client-side code. You'll pair these with an access token on every call.

Step 5 — Generate an access token with the right scopes

In the Marketing API tools (or the Graph API Explorer), generate a user access token and grant the permissions the API actually needs:

  • ads_read — read campaigns, ad sets, ads, and insights.
  • ads_management — create and edit campaigns (only if you need write access).
  • business_management — manage assets owned by your Business account.
Short-lived vs. long-lived tokensThe token the Explorer hands you expires in about an hour. Exchange it for a long-lived token — or better, use a System User token from Business Settings for anything running in production. System User tokens aren't tied to a person logging in and out, so they don't quietly expire on you.

Step 6 — Note your ad account ID

The last piece is the ad account you'll query, formatted as act_<id>. You'll find it in Meta Ads Manager or under your Business account's ad accounts. With the App ID, App Secret, access token, and ad account ID together, you have everything you need to make your first call.

# Verify your credentials by reading the ad account back
curl -G "https://graph.facebook.com/v20.0/act_<AD_ACCOUNT_ID>" \
  -d "fields=name,account_status,currency" \
  -d "access_token=$META_ACCESS_TOKEN"

The part nobody warns you about: app review

By default your app starts with development/standard access, which only works for people who have a role on the app. To call the Marketing API on behalf of real customers at scale, you need Advanced Access — which means submitting the app for review and justifying each permission you request. Plan for this early: approval is the step that most often blocks a launch.

Or skip all of this with Adlyfy

If you'd rather not manage developer apps, secrets, tokens, scopes, and review cycles — for Meta and then again for every other platform — that's exactly what Adlyfy removes. You connect Meta once through our portal; we handle the app credentials, token refresh, scope management, and Business-account plumbing, then hand you one clean API that speaks Meta, Google, TikTok, Pinterest, Snapchat, and LinkedIn the same way.

The hardest part of the Meta Marketing API isn't making the calls — it's getting to the point where you're allowed to make them.

Stop maintaining six integrations.

Adlyfy gives you one unified API for every major ad platform — auth, syncing, and rate limits handled for you.

Get started free