Get Meta Ad Sets by Campaign
meta_ads_get_adsets_by_campaignRetrieve ad sets for a Meta campaign with filtering and pagination. Supports status filters, field selection, and pagination cursors.
Instructions
Retrieve all ad sets belonging to a specific Meta campaign with filtering and pagination.
Args:
campaign_id (string): Campaign ID, e.g., '23843xxxxx'
fields (string[]): Fields per ad set. Common: id, name, account_id, campaign_id, status, effective_status, daily_budget, lifetime_budget, budget_remaining, bid_amount, bid_strategy, billing_event, optimization_goal, targeting, start_time, end_time, created_time, updated_time, pacing_type, destination_type
effective_status (string[]): Filter by status: ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, ARCHIVED, WITH_ISSUES
filtering (object[]): Additional filter objects, e.g., [{field: 'optimization_goal', operator: 'IN', value: ['OFFSITE_CONVERSIONS', 'VALUE']}]
limit (number): Results per page (1-100, default: 25)
after / before (string): Pagination cursors
date_format (string): Date format for response
Returns: Object with data (ad set array) and paging. Use meta_ads_fetch_pagination_url with paging.next for more results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes | Campaign ID, e.g., '23843xxxxx' | |
| fields | No | List of specific fields to retrieve. If omitted, default fields are returned | |
| filtering | No | List of filter objects. Each has 'field', 'operator', and 'value'. Example: [{field: 'spend', operator: 'GREATER_THAN', value: 50}] | |
| effective_status | No | Filter by effective status. Options: ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED, IN_PROCESS, WITH_ISSUES | |
| date_format | No | Format for date fields in response. 'U' = Unix timestamp (seconds), 'Y-m-d H:i:s' = MySQL datetime. Default: ISO 8601 | |
| limit | No | Maximum number of results to return per page (1-100, default: 25) | |
| after | No | Cursor for the next page of results, from response.paging.cursors.after | |
| before | No | Cursor for the previous page of results, from response.paging.cursors.before | |
| offset | No | Alternative pagination: number of results to skip |