API Reference

Targeting

The Targeting API controls how Outfame finds and engages your target audience. Configure targeting sources, apply demographic filters, and use AI suggestions to refine audience quality.

Scopes requiredtargeting:write for mutations, accounts:read for retrieving configuration.


The TargetingConfig object

{
  "account_id": "acc_7Gx2kLm9Qr",
  "competitor_accounts": ["competitor1", "competitor2", "competitor3"],
  "hashtags": ["fitness", "healthylifestyle", "nutrition", "workout"],
  "locations": [
    { "name": "Los Angeles, CA", "radius_km": 50 },
    { "name": "New York, NY", "radius_km": 30 }
  ],
  "interests": ["health", "wellness", "gym", "yoga"],
  "filters": {
    "age_range": { "min": 18, "max": 44 },
    "gender": "all",
    "language": "en",
    "activity_level": "high",
    "min_followers": 100,
    "max_followers": 50000,
    "min_engagement_rate": 1.5,
    "has_profile_picture": true,
    "is_business_account": null,
    "exclude_private": true
  },
  "ai_optimization": {
    "enabled": true,
    "mode": "balanced",
    "quality_threshold": 0.7
  },
  "updated_at": "2026-02-09T11:45:22Z"
}

Targeting sources

SourceTypeDescription
competitor_accountsstring[]Instagram/TikTok handles whose followers match your target audience. Max 20.
hashtagsstring[]Hashtags your ideal followers use or follow. Max 30.
locationsobject[]Geographic areas. Each with name (city/region) and radius_km (1-200). Max 10.
interestsstring[]Interest categories from Outfame's taxonomy. Max 15.

Filter options

FilterTypeDefaultDescription
age_rangeobject{ min: 13, max: 65 }Estimated age range of target users.
genderstringallall, male, or female.
languagestringnullISO 639-1 language code. null targets all languages.
activity_levelstringmediumlow, medium, high, or very_high. Based on posting frequency and engagement.
min_followersinteger0Minimum follower count for target users.
max_followersintegernullMaximum follower count. null for no limit.
min_engagement_ratefloat0Minimum engagement rate percentage.
has_profile_picturebooleantrueExclude users without profile pictures (likely inactive or bot accounts).
exclude_privatebooleanfalseSkip private accounts.

Get targeting configuration

GET /v1/targeting/config?account_id=acc_7Gx2kLm9Qr

Request

curl https://api.outfame.com/v1/targeting/config?account_id=acc_7Gx2kLm9Qr \
  -H "Authorization: Bearer sk_live_your_api_key"

Returns the full TargetingConfig object for the specified account.


Update targeting configuration

PUT /v1/targeting/config

Replaces the entire targeting configuration for an account. Any fields not included will be reset to defaults. Use this for full reconfiguration. For partial updates, use PATCH /v1/accounts/:id with a targeting_config object.

Request

curl -X PUT https://api.outfame.com/v1/targeting/config \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "acc_7Gx2kLm9Qr",
    "competitor_accounts": ["newcompetitor1", "newcompetitor2"],
    "hashtags": ["travel", "digitalnomad", "remotework"],
    "locations": [
      { "name": "Bali, Indonesia", "radius_km": 100 }
    ],
    "interests": ["travel", "remote work", "entrepreneurship"],
    "filters": {
      "age_range": { "min": 22, "max": 38 },
      "language": "en",
      "activity_level": "high",
      "min_engagement_rate": 2.0
    },
    "ai_optimization": {
      "enabled": true,
      "mode": "aggressive",
      "quality_threshold": 0.8
    }
  }'

Response 200 OK

Returns the updated TargetingConfig object.


AI targeting suggestions

POST /v1/targeting/suggestions

Analyzes your account's audience, content, and engagement patterns to generate targeting recommendations. The model uses growth data from 65,000+ accounts to score suggestions.

Request body

ParameterTypeRequiredDescription
account_idstringYesThe account to generate suggestions for.
goalstringNogrowth (maximize followers), engagement (maximize engagement rate), or balanced (default).
include_reasoningbooleanNoReturn explanations for each suggestion. Default: false.

Request

curl -X POST https://api.outfame.com/v1/targeting/suggestions \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "acc_7Gx2kLm9Qr",
    "goal": "balanced",
    "include_reasoning": true
  }'

Response

{
  "account_id": "acc_7Gx2kLm9Qr",
  "suggestions": {
    "add_competitors": [
      {
        "username": "suggested_rival",
        "relevance_score": 0.94,
        "audience_overlap": 0.32,
        "reasoning": "High audience overlap with your existing followers. Their followers have 3.2x higher engagement rate than average."
      }
    ],
    "add_hashtags": [
      {
        "tag": "fitnessmotivation",
        "relevance_score": 0.89,
        "monthly_volume": 2400000,
        "reasoning": "Frequently used by your most engaged followers. Medium competition with strong conversion potential."
      }
    ],
    "adjust_filters": [
      {
        "filter": "activity_level",
        "current": "medium",
        "recommended": "high",
        "impact_estimate": "+15% engagement rate",
        "reasoning": "Your best-converting followers have high activity levels. Narrowing this filter will improve audience quality."
      }
    ],
    "remove_suggestions": [
      {
        "type": "hashtag",
        "value": "followforfollow",
        "reasoning": "Low-quality audience. Users from this hashtag have 80% higher unfollow rate."
      }
    ]
  },
  "estimated_impact": {
    "growth_rate_change": "+23%",
    "engagement_rate_change": "+0.8%",
    "audience_quality_change": "+12%"
  },
  "confidence": 0.87,
  "generated_at": "2026-02-09T14:30:00Z"
}

AI optimization modes

ModeDescriptionBest for
conservativeMinimal AI adjustments. Sticks closely to your manual configuration.Accounts with very specific, curated audiences.
balancedAI refines targeting within your defined parameters. Default mode.Most accounts. Good balance of growth and quality.
aggressiveAI actively explores new audience segments and adjusts filters for maximum growth.New accounts or accounts looking to scale quickly.

Error codes

StatusCodeDescription
400too_many_competitorsMaximum 20 competitor accounts allowed.
400too_many_hashtagsMaximum 30 hashtags allowed.
400invalid_locationLocation could not be resolved. Provide a valid city, region, or country name.
400invalid_radiusRadius must be between 1 and 200 km.
422insufficient_dataAccount has insufficient data for AI suggestions. Requires at least 7 days of activity.