Skip to content

Discovering Users

User Search API

API Documentation

Sample Response

The User Search API allows you to search for users related to a specific keyword.

import requests

result = requests.get(
    "https://ensembledata.com/apis/tt/user/search",
    params={
        "keyword": "tesla",
        "token": "API_TOKEN",
    }
).json()["data"]

users = result["users"]
next_cursor = result.get("nextCursor", None)
from ensembledata.api import EDClient

client = EDClient("API_TOKEN")
result = client.tiktok.user_search(keyword="tesla")

users = result.data["users"]
next_cursor = result.data.get("nextCursor")
import { EDClient } from "ensembledata";

const client = new EDClient({ token: "API_TOKEN" });
let result = await client.tiktok.userSearch({ 
    keyword: "tesla"
});

let users = result.data.users;
let nextCursor = result.data.nextCursor;

Fetching more results

To fetch more results you can use the cursor parameter, passing in the nextCursor value from the previous response.

result = requests.get(
    "https://ensembledata.com/apis/tt/user/search",
    params={
        "keyword": "tesla",
        "cursor": next_cursor,
        "token": "API_TOKEN",
    }
).json()["data"]

users = result["users"]
next_cursor = result.get("nextCursor", None)
result = client.tiktok.user_search(keyword="tesla", cursor=next_cursor)
users = result.data["users"]
next_cursor = result.data.get("nextCursor")
result = await client.tiktok.userSearch({ 
    keyword: "tesla",
    cursor: nextCursor
});
users = result.data.users;
nextCursor = result.data.nextCursor;