get_adsets_by_ids
Retrieve detailed Facebook ad set data for multiple IDs in one API call. Specify ad set IDs and optional fields to get performance insights and campaign details quickly.
Instructions
Retrieves detailed information about multiple Facebook ad sets by their IDs.
This function allows batch retrieval of multiple ad sets in a single API call, improving efficiency when you need data for several ad sets.
Args: adset_ids (List[str]): A list of ad set IDs to retrieve information for. fields (Optional[List[str]]): A list of specific fields to retrieve for each ad set. If None, a default set of fields will be returned. See get_adset_by_id for a comprehensive list of available fields. date_format (Optional[str]): Format for date responses. Options: - 'U': Unix timestamp (seconds since epoch) - 'Y-m-d H:i:s': MySQL datetime format - None: ISO 8601 format (default)
Returns: Dict: A dictionary where keys are the ad set IDs and values are the corresponding ad set details.
Example: ```python # Get information for multiple ad sets adsets = get_adsets_by_ids( adset_ids=["23843211234567", "23843211234568", "23843211234569"], fields=["name", "campaign_id", "effective_status", "budget_remaining"], date_format="U" # Get dates as Unix timestamps )
# Access information for a specific ad set
if "23843211234567" in adsets:
print(adsets["23843211234567"]["name"])
```
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | ||
| adset_ids | Yes | ||
| date_format | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |