DataNavoAPI / ANSWERS / META AD LIBRARY

How do I research Meta ads through an API?

How do I research Meta ads through an API? Follow concrete contracts, examples and reviewable steps using Meta Ad Library.

LOCAL SIMULATIONAll displayed records are fictional fixtures. Live APIs, payments and external email are disabled.中文版 ↗
01

Answer

Start by inspecting the contracts and local samples for Meta Ad Library search, Meta ad detail, Meta advertiser's ads. Establish the input for meta.ads.search, then check whether its ad object contains the fields your task needs.

Document the input scope, sampling rule and intended use, and preserve request IDs and missing-field markers. An API supplies the contracted sample; interpretation still requires checks of context and representativeness.

02

Relevant contracts

CapabilityObjectShapePagination
meta.ads.searchAditemsExplicit cursor
meta.ads.getAditemNo cursor
meta.advertisers.ads.listAditemsExplicit cursor
03

Input contract

Inspect meanings, examples and conditional rules for the selected method. view and fields control the response without changing the TEST unit price.

  • Only send fields defined for this method; unknown fields are rejected before execution.
MethodFieldTypeRequirementMeaningEnum or boundExample
GETquerystringRequiredSearch terms—"running shoes"
GETregionstringOptional / conditionalOnly ads delivered in this country or region, by its two-letter code; all of them when left out——
GETsortstringOptional / conditionalBy impressions, highest first, or newest first["popular","latest"]—
GETtypestringOptional / conditionalOnly image ads or only video ads; all of them when left out["image","video"]—
GETcursorstringOptional / conditionalThe `next_cursor` of the previous page. A new page is a new call.——
GETviewstringOptional / conditionalHow much of each item: compact (the most used fields, long text cut short), standard, or full (adds `ext`).["compact","standard","full"]—
GETfieldsarrayOptional / conditionalReturn only these fields of each item, by path (`author.name`).maxItems: 64—
04

Complete one verification

Run one local fixture for a listed capability and inspect the object structure. Then filter, classify or export according to the question. A local sample cannot replace evidence for a real-platform conclusion.

json
{
  "capability": "meta.ads.search",
  "method": "GET",
  "params": {
    "query": "running shoes"
  }
}
TRY THE CONTRACT

Clear inputs. Inspectable output.

Each click runs a local fixture. Advanced JSON inputs are checked against the selected method. Editing does not execute a request.

Copying does not execute. CLI quote is read-only and needs a local customer TEST key. Configure MCP in demo mode first. GET and POST batches both return only fictional local fixtures.

Download contract example (no execution) ↗

For TEST budgets, Key scopes or failure scenarios, open the account console. Customer sandbox ↗