Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to fetch more than 10 users for a particular keyword #1148

Open
SunnyChopra7 opened this issue May 6, 2024 · 0 comments
Open

Not able to fetch more than 10 users for a particular keyword #1148

SunnyChopra7 opened this issue May 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SunnyChopra7
Copy link

I am using api.search.users to search for a keyword

My goal is to fetch all the accounts for that keyword but the code is returning only 10 results for any keyword

sandbox code func.

async def get_users():
    cursor = 0
    async with TikTokApi() as api:
        
        await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, headless=False)
        while cursor <= 50:
            async for user in api.search.users(search_term='axis bank', count=30, cursor=cursor):
                print(user)
                ite(json.dumps(users, indent=4))
            cursor += 30

Expected behavior

Let's say if the keyword is 'abcd' and there are 100 accounts that matches with this it should return all 100 accounts

Error trace:
In search.py file
if not resp.get("has_more", False):
This has_more is coming false from response even if more data is present

@SunnyChopra7 SunnyChopra7 added the bug Something isn't working label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@SunnyChopra7 and others