question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`max_results=500` incompatible with `tweet.fields=context_annotations`

See original GitHub issue

Twitter now restricts max_results to be 100 instead of 500 if tweet.fields=context_annotations is used.

{
  "errors": [
    {
      "parameters": {
        "tweet.fields": [
          "context_annotations"
        ],
        "max_results": [
          "500"
        ]
      },
      "message": "when requesting `tweet.fields=context_annotations` `max_results` must be less than or equal to `100`"
    }
  ],
  "title": "Invalid Request",
  "detail": "One or more parameters to your request was invalid.",
  "type": "https://api.twitter.com/2/problems/invalid-request"
}

Currently twarc requests all fields and expansions, so this effectively limits us to only request 100 tweets per call.

The trade-off here is: request 500 tweets without the context annotations, or request 100 with. Requesting 100 will make retrieval slower.

Related to #493

As a stopgap, i committed a change to make the limit 100.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
igorbrigadircommented, Jul 3, 2021

It’s fixed in main already, so a new release will do it. And we can do #493 later

1reaction
edsucommented, Jul 3, 2021

This will be an interesting one for Twitter to explain in their documentation. We should have some fun with this when we implement “support” for it in twarc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tweet annotations - Twitter Developers
Context annotations : Derived from the analysis of a Tweet's text and will include a domain and entity pairing which can be used...
Read more >
Max_results and context_annotations - Academic Research
Twitter now restricts max_results to be 100 instead of 500 if tweet.fields=context_annotations is used in the academic access endpoint.
Read more >
twarc2 (en) - twarc
This leaves out context annotations (Twitter API limits --max-results to 100 if these are requested). Setting this makes --max-results 500 the default.
Read more >
Notes on Downloading Conversations through Twitter's V2 API
One promising new feature of Twitter's new, free V2 API for academic researchers is the ... max="500" vars="&tweet.fields=conversation_id" ...
Read more >
Search API Reference - Cloudinary
Find assets containing 'cat' in any field (attribute), include context metadata and tags in the details of each resource, and limit the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found