We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
As a developer I want to search all posts by calling next(500) and either receive 500 posts or 0 posts if the rate limit is reached.
next(500)
Issue: I am getting <500 posts unexpectedly.
To Reproduce
Please indicate all steps that lead to this bug:
err.toJSON()
err
const xAPI = new TwitterApi({ appKey: '...', appSecret: '...' }) const client = (await xAPI.appLogin()).readOnly.v2 let processed = 0 let searchResults = null while (processed < 10000) { searchResults = !searchResults ? await xClient.searchAll(query, { "max_results":500, "expansions":["attachments.media_keys"], "tweet.fields":["created_at","public_metrics"], "media.fields":["media_key","type","url","duration_ms","preview_image_url","variants"], "start_time":"2006-12-31T00:00:00.000Z", "end_time":"2025-01-01T09:59:59.999Z" }) : await searchResults.next(Math.min(500, 10000 - processed)) console.log(searchResults.data.data) processed += searchResults.data.data.length }
Expected behavior A clear and concise description of what you expected to happen.
The console.log should output 20 lines where each line contains 500 posts.
console.log
Version
Additional context
N/A
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
As a developer I want to search all posts by calling
next(500)
and either receive 500 posts or 0 posts if the rate limit is reached.Issue: I am getting <500 posts unexpectedly.
To Reproduce
Please indicate all steps that lead to this bug:
err.toJSON()
whenerr
is the caught error; take care of removing authentication HTTP headers)Expected behavior
A clear and concise description of what you expected to happen.
The
console.log
should output 20 lines where each line contains 500 posts.Version
Additional context
N/A
The text was updated successfully, but these errors were encountered: