Live Data

Search Users

Searches accounts on a platform by keyword.

query and pageToken work the same on every platform. region and language are hints: applied where a platform's search supports them and ignored elsewhere. The filters of a search route (sortBy, dateRange, accountType) change which results come back, so a platform that cannot apply one refuses the request with a validation error instead of ignoring it.

PlatformFindsPagesAppliesFollower count
TikTokaccountspagedyes
Instagramaccountsone pageno
YouTubechannelspagedregion, languagerounded
Facebookpages, or personal profiles with accountType=personpagedaccountTypeno
Snapchatpublic profiles and accountsone pageexact, for public profiles

Examples:

  • GET /live/tiktok/search/users?query=fitness%20coach
  • GET /live/youtube/search/users?query=fitness&region=DE&language=de
  • GET /live/facebook/search/users?query=nike&accountType=page
  • GET /live/tiktok/search/users?query=nike&accountType=page is refused with 400: "accountType is supported for Facebook only, where pages and personal profiles are separate searches."

On Facebook and Snapchat a one-word query is also looked up as an exact handle; when that account exists it is the first result, with its full profile. A Facebook result without a vanity name has its numeric id as username. A pageToken on a platform that has one page returns an empty page and is not charged.

Optional live endpoint. You do not need this endpoint for normal API integrations; prefer tracked accounts, tracked videos, analytics, projects, and Creator Hub endpoints when working with viral.app data.

⚠️ Consumes extra credits: 3 credits per request. Additional charges may apply.

Headers:

  • X-Viral-Credits-Consumed
  • X-Viral-Credits-Meter
  • X-Viral-Credits-Benefited-Remaining
  • X-Viral-Credits-Can-Purchase-Extra
  • Retry-After (on 429 responses)

A page past the only one of a one-page lookup costs nothing: it carries X-Viral-Credits-Consumed: 0 and X-Viral-Credits-Meter, without the two balance headers.

get/live/{platform}/search/users

Request

  • Base URL: https://viral.app/api/v1
  • URL: https://viral.app/api/v1/live/{platform}/search/users
  • Auth: API key in header x-api-key

Path parameters

platform'facebook' | 'instagram' | 'tiktok' | 'youtube' | 'snapchat' required

Social media platform (facebook, instagram, tiktok, youtube, snapchat)

Example:facebook

Query parameters

querystring required

Search query string

Example:nike
pageTokenstring nullable

Opaque cursor token used to fetch the next page

Example:v2:eyJvZmZzZXQiOjIwLCJsaW1pdCI6MjB9
regionstring nullable

Region code (2-letter ISO country code)

Example:US
languagestring nullable

Language code for localized search results (BCP 47 style)

Example:en
accountType'page' | 'person' nullable

Facebook only: page searches pages (the default), person personal profiles. Refused on other platforms.

Example:page

Response

OK

nextPageTokenstring nullable required

Example response

{
  "users": [
    {
      "platform": "facebook",
      "platform_account_id": "7123456789012345678",
      "profile_picture_url": "https://www.myproject.com"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.