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

searchStream with backfill_minutes results in Invalid Request error #46

Open
apecollector opened this issue Oct 13, 2022 · 0 comments
Open

Comments

@apecollector
Copy link

One line summary of the issue here.

Trying to search a stream with backfill_minutes results in an error:

  error: {
    errors: [ [Object] ],
    title: 'Invalid Request',
    detail: 'One or more parameters to your request was invalid.',
    type: 'https://api.twitter.com/2/problems/invalid-request'
  }

Example code:

async function main() {
  const client = new Client(process.env.BEARER_TOKEN as string);
  const rules = await client.tweets.getRules();
    const stream = client.tweets.searchStream({ backfill_minutes: 1 });
    for await (const tweet of stream) {
      console.log(tweet.data?.author_id, tweet.data?.text);
    }
}

Expected behavior

Get the tweets starting from 1 minute ago.

Actual behavior

The error with invalid request.

Steps to reproduce the behavior

Run the code above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant