0

To request tweets from the Standard search API with a specific hashtag, I've done

twurl "/1.1/search/tweets.json?q=#jesus"

Tht worked fine. Now wanting to use the Premium search APIs to count the tweets from the past 30 days with the hashtag jesus.

In it, there's a Counts endpoint, /search/:label/counts.

For the tweets from the past 30 days, that's the endpoint pattern, /search/30day/:label/counts.json.

I've created a Search Tweets: 30-Days Sandbox with name stackoverflow (that is the label).

Then, when running the following

twurl "/1.1/tweets/search/30day/stackoverflow/counts.json?query=#jesus"

I get

{"error":{"message":"Unauthorized: Stream is not enabled for count requests","sent":"2020-02-26T13:26:57+00:00","transactionId":"00f67ea10058270b"}}

From this, decided to go to the app keys and tokens and regenerated both Consumer API keys and Access token & access token secret.

After

twurl authorize --consumer-key ************** --consumer-secret *****************

and using the PIN code I get

Authorization successful

If I do again

twurl "/1.1/tweets/search/30day/stackoverflow/counts.json?query=#jesus"

Then get

{"error":{"message":"Invalid or expired token.","sent":"2020-02-26T13:39:44+00:00","transactionId":"00dea42000a8a098"}}

Regenerated again both Consumer API keys and Access token & access token secret but still no success.

How can I do it then?

Tiago Martins Peres
  • 14,289
  • 18
  • 86
  • 145
  • 2
    Counts is not available in the sandbox, it is only available to paid premium accounts. – Andy Piper Feb 28 '20 at 16:20
  • @AndyPiper That's not what the pricing page points to. From it one understands that using the Premium search we wouldn't need to pay if: (1) Tweets from the past 30 days, up to 250 requests / month, 100 tweets / request (total of 250000 tweets), (2) Tweets since 2006, up to 50 requests / month, 100 tweets / request (total of 5000 tweets) – Tiago Martins Peres Feb 28 '20 at 16:35

1 Answers1

2

Counts is only available to paid premium accounts, and one needs to pay for premium access.

Use this link to Apply for access.

Gonçalo Peres
  • 11,752
  • 3
  • 54
  • 83