No reply on Enterprise Access request

enterprise

#1

Hello there,

we already use the API “Full Archive / Premium” to get a bunch of Tweets.

With premium, we can shift the search back in time, but only getting a set of 31 days (Available Timeframe). We need to get the Full Archive with one request, estimated 50 tweets.
So we assumed that we have to get Enterprise Access.
On February 28th we had already sent a request over the link “https://developer.twitter.com/en/enterprise-application”.
Still waiting for a reply.

Could someone tell us how long we have to wait, or what to do for getting Enterprise Access.

Thank you.

Best regards
COMKOM14


#2

Why can’t you use the Full archive search past 31 days with your premium account? It sounds like you could already do what you need without enterprise access, for an estimated 50 tweets you could probably do it with just the free sandbox access to fullarchive search if you get the query / paging right.


#3

Hey,

thank you for your reply.
The Problem is, I only get the last 31 days of tweets. If I change the from and toDate, I can shift the given tweet results. When I type December.31.2014 to December.31.2018 I just get the complete December from 2018, not the whole bunch of Tweets, back to 2014.

search_url: https://api.twitter.com/1.1/tweets/search/fullarchive/dev.json
from_date: 201412310000
to_date: 201812310000
first i create a Bearer token and use it in $headers
search_string is a request like (from:SOMETHING #SOMETHING) OR (from:SOMETHING #SOMETHING)

The following is my curl request.

$curl = curl_init();
$input = '{
    "fromDate":"'.$this->cleanDate($value['from_date']).'",
    "toDate":"'.$this->cleanDate($value['to_date']).'",
    "query":"'.$value['search_string'].'"
}';

curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_URL, $value['search_url']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $input);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLINFO_HEADER_OUT, true);

array_push($result,curl_exec($curl)); //filling an array everything is in a loop
if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
}
curl_close($curl);

#4

I’m not very good at PHP, but i can see that you’re not using any kind of pagination with your requests, like described here: https://developer.twitter.com/en/docs/tweets/search/api-reference/premium-search.html#Pagination implementing this properly will give you the older tweets you need.

Maybe the reference python implementation will help: https://github.com/twitterdev/search-tweets-python


#5

Hey,

thank you for your time. But when I understand the pagination part correct, it is only needed for 500+ Tweets (100+ for Sandbox). I am far away from 500 Tweets with my request, and want to get a single json response with all tweets from 2014 to present (maybe 50 tweets in total).
I also can’t fill my own json by getting each month separate, would work, but when the customer wants to change the search_string a bit, we have to make 50+ single request. To much for current 100 requests per month.

Under https://developer.twitter.com/en/docs/tweets/search/api-reference/enterprise-search#RequestResponseBehavior (Enterprise) I can find the following text.

For example, say you are using Full-Archive search and want all Tweets matching your query from January 1, 2017 to June 30, 2017. You will specify that full six-month time period in your request using the fromDate and toDate parameters. The search API will respond with the first ‘page’ of Tweets, with the number of Tweets matching your maxResults parameter (which defaults to 100).

I want this single page, I have less than 100 Tweets. In the premium api https://developer.twitter.com/en/docs/tweets/search/api-reference/premium-search#DataEndpoint under Available Timeframe is written “Last 31 days”, so I assume, I can’t get more then 31 days with premium in one single ‘page’.


#6

Oh, maybe that documentation makes it confusing - Yes, for fullarchive endpoint, it’s last 31 days by default, if you don’t specify a date range. If you do specify a date range, you also have to use pagination.

Also, even if it’s 50 tweets, if they’re spread over a long period of time, you will need more than 1 request to get them, because each request is paginated by 100 tweet pages or 31 day pages, eg this reply: Full Historic Stream API


#7

Okay, that makes sense for the Premium Access.
Do you know if I could get a single response (single ‘page’ over two or more months) on Enterprise, how I described above. Or is the behavior the same as Premium with 31 day limit and a next token.


#8

I’m not sure but i think Enterprise is almost the exact same API as Premium.

Just my opinion, but I don’t think it’s even worth thinking about Enterprise access until you’ve exhausted the limits of paid premium.


#9

There are two APIs in the Enterprise subscription:
Full archive search
https://developer.twitter.com/en/docs/tweets/search/overview/enterprise

And historical powertrack
https://developer.twitter.com/en/docs/tweets/batch-historical/api-reference/historical-powertrack.html

The former is pretty much the same as the Premium API, the latter you get to submit one query and the response is in a bunch of files that you download.

I would stick with the Premium API and as @IgorBrigadir said, you should consider Enterprise access once you exhausted paid Premium, because from my experience the cost is much higher than any of the Premium plans.


#10

Thank you @IgorBrigadir and @Connexinet for your help.
I’ll give it a try and collect each month separate.


#11

Update: It was an issue with my timeformat. I messed up my cleanDate() so I just used php Datetime and it worked. I didn’t recognised the error, because of a valid json response (but only one month).

It is possible to get all news “back in time” without pagination. Sandbox and Premium, both work fine with fullarchive. The limit is maxResults.

Here is the php snipped, if someone has the same problem.

$fromDate = new DateTime($value['from_date']);
...
$input = '{
   "fromDate":"'.$fromDate->format('YmdHi').'",
   "query":"'.$value['search_string'].'"
}';