search_demographics
Retrieve demographic targeting options like life events, income, or family statuses for Meta Ads campaigns. Specify the demographic class and limit results to optimize ad audience selection and improve campaign performance.
Instructions
Get demographic targeting options.
Args:
access_token: Meta API access token (optional - will use cached token if not provided)
demographic_class: Type of demographics to retrieve. Options: 'demographics', 'life_events',
'industries', 'income', 'family_statuses', 'user_device', 'user_os' (default: 'demographics')
limit: Maximum number of results to return (default: 50)
Returns:
JSON string containing demographic targeting options with id, name, audience_size bounds, path, and description
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_token | No | ||
| demographic_class | No | demographics | |
| limit | No |
Implementation Reference
- meta_ads_mcp/core/targeting.py:479-503 (handler)The core handler function for the 'search_demographics' tool. It searches Meta Ads API for demographic targeting options using the /search endpoint with adTargetingCategory type and specified class (default 'demographics'). Returns formatted JSON response.@mcp_server.tool() @meta_api_tool async def search_demographics(access_token: Optional[str] = None, demographic_class: str = "demographics", limit: int = 50) -> str: """ Get demographic targeting options. Args: access_token: Meta API access token (optional - will use cached token if not provided) demographic_class: Type of demographics to retrieve. Options: 'demographics', 'life_events', 'industries', 'income', 'family_statuses', 'user_device', 'user_os' (default: 'demographics') limit: Maximum number of results to return (default: 50) Returns: JSON string containing demographic targeting options with id, name, audience_size bounds, path, and description """ endpoint = "search" params = { "type": "adTargetingCategory", "class": demographic_class, "limit": limit } data = await make_api_request(endpoint, access_token, params) return json.dumps(data, indent=2)
- meta_ads_mcp/core/__init__.py:14-14 (registration)Import statement that brings search_demographics into the core namespace, triggering registration via the @mcp_server.tool() decorator.from .targeting import search_interests, get_interest_suggestions, estimate_audience_size, search_behaviors, search_demographics, search_geo_locations
- meta_ads_mcp/__init__.py:59-59 (registration)Re-export of search_demographics from core module at package level, making it available when importing the package.search_demographics,