# Instagram Text-based AI Search (deprecated)

Find influencers whose posts semantically (what appears in photos and videos) match the text query. Put language, locations, and similar criteria in filters. query does not support negations—use positive descriptions only. Fixed 1 RPS limit. Each resulting profile costs 0.025 credits.

Endpoint: POST /ai/text-search
Security: accessToken

## Request fields (application/json):

  - `page` (number)
    Page number (0-indexed). The offset is calculated as page  pageSize, so changing pageSize between pages will shift the window and may cause duplicate or missed results. The total number of results that can be accessed is limited to 1500 — that is, (page + 1)  pageSize must not exceed 1500. Requests beyond this limit will receive a 400 error.

  - `pageSize` (number)
    Number of results per page. Each result costs 0.025 credits. The maximum total depth of results (page * pageSize + pageSize) is 1500. For example, with pageSize 50 you can paginate up to page 29.

  - `filters` (object)
    Additional filters to refine the search results
    Example: {"followersCount":{"min":10000},"gender":"MALE","lastPostedInDays":90,"accountType":"creator","language":"es","age":{"min":"18"},"engagementRate":{"min":0.01},"postingFrequency":{"min":2},"hasEmail":true,"maxPostAgeMonths":3}

  - `filters.followersCount` (object)
    Filter by followers count
    Example: {"min":10000}

  - `filters.followersCount.min` (number)
    Minimum followers count. Number will be approximated to the nearest range lower or equal to the given number. Ranges are: 1000, 3000, 5000, 10000, 15000, 20000, 25000, 35000, 50000, 75000, 100000, 125000, 150000, 175000, 200000, 250000, 300000, 350000, 500000, 1000000, 2000000, 3000000.
    Example: 10000

  - `filters.followersCount.max` (number)
    Maximum followers count. Number will be approximated to the nearest range higher or equal to the given number. Ranges are: 1000, 3000, 5000, 10000, 15000, 20000, 25000, 35000, 50000, 75000, 100000, 125000, 150000, 175000, 200000, 250000, 300000, 350000, 500000, 1000000, 2000000, 3000000.

  - `filters.locations` (array)
    Filter by locations (use Locations dictionary endpoint to get the location IDs)

  - `filters.gender` (string)
    Filter by gender; KNOWN -> male or female, UNKNOWN -> gender neutral
    Enum: "MALE", "FEMALE", "KNOWN", "UNKNOWN"

  - `filters.lastPostedInDays` (number)
    Filter by influencers with latest post date, in days. P.S. we update profiles every 4 weeks and this lag should be considered when using this field.
    Example: 90

  - `filters.accountType` (string)
    Filter by account type
    Enum: "creator", "brand"

  - `filters.language` (string)
    Filter by language (use Languages dictionary endpoint to get the language IDs)
    Example: "es"

  - `filters.age` (object)
    Filter by age range
    Example: {"min":"18"}

  - `filters.age.min` (string)
    Minimum age range
    Enum: "13", "18", "25", "35", "45", "65"

  - `filters.age.max` (string)
    Maximum age range
    Enum: "18", "25", "35", "45", "65"

  - `filters.engagementRate` (object)
    Filter by engagement rate
    Example: {"min":0.01}

  - `filters.engagementRate.min` (number)
    Minimum engagement rate (in percentage, 0.01 = 1%)
    Example: 0.01

  - `filters.postingFrequency` (object)
    Filter by average monthly posting frequency
    Example: {"min":2}

  - `filters.postingFrequency.min` (number)
    Minimum average posts per 30-day month
    Example: 2

  - `filters.postingFrequency.max` (number)
    Maximum average posts per 30-day month
    Example: 20

  - `filters.viewsCount` (object)
    Filter by average per-post view count (median or mean)

  - `filters.viewsCount.min` (number)
    Minimum average per-post view count. Number will be approximated to the nearest range lower or equal to the given number. Ranges are: 1000, 3000, 5000, 10000, 15000, 20000, 25000, 35000, 50000, 75000, 100000, 125000, 150000, 175000, 200000, 250000, 300000, 350000, 500000, 1000000, 2000000, 3000000.

  - `filters.viewsCount.max` (number)
    Maximum average per-post view count. Number will be approximated to the nearest range higher or equal to the given number. Ranges are: 1000, 3000, 5000, 10000, 15000, 20000, 25000, 35000, 50000, 75000, 100000, 125000, 150000, 175000, 200000, 250000, 300000, 350000, 500000, 1000000, 2000000, 3000000.

  - `filters.viewsCount.calculationMethod` (string)
    Whether to filter on median or mean per-post view count (from in-house post_views_stats over the last 60 days).
    Enum: "median", "average"

  - `filters.hasEmail` (boolean)
    Filter by whether the influencer has an email
    Example: true

  - `filters.brands` (array)
    Filter by brands (Use AI search's Brand Dictionary endpoint to get the brand names. P.S. this is a different endpoint than existing Brand Dictionary endpoint).

  - `filters.username` (string)
    Username to search for

  - `filters.maxPostAgeMonths` (number)
    Filter by the maximum age of the posts in months. Used to request more recent posts.
    Enum: 3, 6, 9, 12

  - `filters.contentType` (string)
    Filter by content type. Allowed values: video, image. If not provided, both video and image content will be returned.
    Enum: "video", "image"

  - `filters.textTags` (array)
    Filter by influencers who have used the defined hashtags or mentions in their posts. Values should be without # or @ prefix.
    Example: [{"type":"hashtag","value":"carsofinstagram"},{"type":"mention","value":"topgear"}]

  - `filters.textTags.type` (string, required)
    Type of text tag
    Enum: "hashtag", "mention"

  - `filters.textTags.value` (string, required)
    Value of the text tag (without # or @ prefix)
    Example: "carsofinstagram"

  - `filters.textTags.mode` (string)
    Whether to include or exclude posts with this tag. Defaults to include.
    Enum: "include", "exclude"

  - `filters.audience` (object)
    Filter by Audience

  - `filters.audience.credibility` (number)
    Filter by Audience Credibility. The value is the inverse of fake followers, meaning 25% fake followers would translate to 0.75 of audience credibility.

  - `query` (string)
    Natural-language text describing the creator and/or the type of content. Use this for querying content semantics (what appears in photos and videos).

Avoid using criteria for which a filter exists, e.g., language, locations, age ranges.

Negation is not supported - do not rely on "no", "not", "without", or "exclude" to remove topics.

Queries may be in any language, but different languages may yield different results; English usually yields the strongest matches.

Limit: 8192 characters or 512 words. If omitted, results are sorted by follower count.
    Example: "Sporty stay at home mom sharing kids gut health tips and family wellness"

## Response 200 fields (application/json):

  - `error` (boolean)
    If there is an error

  - `total` (number, required)
    Total number of profiles matching the search query

  - `profiles` (array, required)
    List of influencer profiles matching the search query and filters

  - `profiles.userId` (string)
    User ID
    Example: "173560420"

  - `profiles.fullName` (string)
    Full name
    Example: "Instagram"

  - `profiles.username` (string, required)
    Username
    Example: "instagram"

  - `profiles.profilePicture` (string, required)
    Profile Picture
    Example: "https://imgigp.modash.io/22159423_1794482210565499_9190891265074397184_n.jpg"

  - `profiles.followersCount` (number, required)
    Followers count
    Example: 313560626

  - `profiles.engagementRate` (number, required)
    Engagement rate
    Example: 0.01

  - `profiles.postingFrequency` (number, required)
    Average posts per 30-day month
    Example: 12

  - `profiles.viewsCountMedian` (number)
    Median per-post view count over the last 60 days
    Example: 25000

  - `profiles.viewsCountMean` (number)
    Mean per-post view count over the last 60 days
    Example: 32000

  - `profiles.matchedPosts` (array, required)
    Posts ordered by relevance to the search query

  - `profiles.matchedPosts.id` (string, required)
    Post ID

  - `profiles.matchedPosts.url` (string, required)
    Post URL

  - `profiles.matchedPosts.thumbnail` (string, required)
    Post thumbnail URL

  - `profiles.matchedPosts.stats` (object, required)
    Post statistics

  - `profiles.matchedPosts.stats.likesCount` (number, required)
    Likes count; -1 if likes count is hidden

  - `profiles.matchedPosts.stats.commentsCount` (number, required)
    Comments count; -1 if comments count is hidden

  - `profiles.matchedPosts.stats.playsCount` (number, required)
    Plays count

  - `profiles.recentPosts` (array, required)
    Recent posts (not necessarily relevant to the search query). P.S. we update profiles every 4 weeks and this lag should be considered when using this field.

  - `profiles.accountCategory` (string, required)
    Account category
    Example: "Sportsperson / Digital creator etc."


