Xquik Java SDK: Twitter Search, Followers & X Automation

August 20, 2026 ยท View on GitHub

CI OpenSSF Best Practices

Search Twitter, read timelines, fetch profiles & export followers with Xquik. Use typed Java methods for media, webhooks & X automation.

API Reference | Authentication | Javadocs

Maven Central Javadocs

Java Client

Use this SDK for Java services with builders and typed models. Use synchronous calls or client.async() for CompletableFuture pipelines.

Common Twitter & X Tasks

TaskREST RouteJava Service
Run an advanced Twitter searchGET /x/tweets/searchclient.x().tweets()
Retrieve tweets, threads, replies, or quotesGET /x/tweets/{id}, GET /x/tweets/{id}/threadclient.x().tweets()
Search X or Twitter usersGET /x/users/searchclient.x().users()
Scrape an X profile timelineGET /x/users/{id}/tweetsclient.x().users()
Export X followersGET /x/users/{id}/followersclient.x().users()
Export X following accountsGET /x/users/{id}/followingclient.x().users()
Collect verified followersGET /x/users/{id}/verified-followersclient.x().users()
Collect mentions, likes, replies, or mediaGET /x/users/{id}/mentions, GET /x/users/{id}/likesclient.x().users()
Extract an X home timelineGET /x/timelineclient.x()
Extract list tweets, members, or followersGET /x/lists/{id}/tweets, GET /x/lists/{id}/membersclient.x().lists()
Search communities and collect their tweetsGET /x/communities/search, GET /x/communities/{id}/tweetsclient.x().communities()
Read bookmarks and bookmark foldersGET /x/bookmarks, GET /x/bookmarks/foldersclient.x().bookmarks()
Read notifications or direct messagesGET /x/notifications, GET /x/dm/{userId}/historyclient.x(), client.x().dm()
Discover X trendsGET /x/trendsclient.x().getTrends()
Export large X datasetsPOST /extractionsclient.extractions()
Monitor tweet keywords or accountsPOST /monitors/keywords, POST /monitorsclient.monitors()
Receive signed event deliveriesPOST /webhooksclient.webhooks()
Post, like, retweet, or followPOST /x/tweets, POST /x/users/{id}/followclient.x().tweets(), client.x().users()
Send media or update a profilePOST /x/media, PATCH /x/profileclient.x().media(), client.x().profile()
Manage connected X accountsGET /x/accounts, POST /x/accountsclient.x().accounts()

Install

Gradle:

implementation("com.xquik.api:x-twitter-scraper-java:0.10.3")

Maven:

<dependency>
  <groupId>com.xquik.api</groupId>
  <artifactId>x-twitter-scraper-java</artifactId>
  <version>0.10.3</version>
</dependency>

Verify Maven Signatures

Every Maven Central file has a detached OpenPGP signature. Set VERSION, then verify the artifact:

version=VERSION
artifact="x-twitter-scraper-java-$version.jar"
base="https://repo.maven.apache.org/maven2/com/xquik/api/x-twitter-scraper-java/$version"
curl --fail --location --remote-name "$base/$artifact"
curl --fail --location --remote-name "$base/$artifact.asc"
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 0xD2037E4157E62A59
gpg --verify "$artifact.asc" "$artifact"

Confirm fingerprint 6965 E561 C0AC EE32 060A B961 D203 7E41 57E6 2A59.

Authenticate

Create an API key in the Xquik dashboard. Then set:

export X_TWITTER_SCRAPER_API_KEY="your-api-key"

OAuth users can set X_TWITTER_SCRAPER_BEARER_TOKEN instead.

Create one client and reuse it:

import com.x_twitter_scraper.api.client.XTwitterScraperClient;
import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient;

XTwitterScraperClient client = XTwitterScraperOkHttpClient.fromEnv();

Pass credentials directly when needed:

XTwitterScraperClient client = XTwitterScraperOkHttpClient.builder()
    .apiKey("your-api-key")
    .build();

Supported client settings:

SettingSystem PropertyEnvironment VariableDefault
API keyxtwitterscraper.apiKeyX_TWITTER_SCRAPER_API_KEYNone
OAuth tokenxtwitterscraper.bearerTokenX_TWITTER_SCRAPER_BEARER_TOKENNone
Base URLxtwitterscraper.baseUrlX_TWITTER_SCRAPER_BASE_URLhttps://xquik.com/api/v1

System properties override environment variables.

Search Tweets

import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams;
import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;

TweetSearchParams params = TweetSearchParams.builder()
    .q("from:elonmusk")
    .limit(10L)
    .build();

TweetSearchResponse result = client.x().tweets().search(params);

Close the client when your application stops:

client.close();

Use Async Calls

Call async() to receive CompletableFuture results:

import java.util.concurrent.CompletableFuture;

CompletableFuture<TweetSearchResponse> result =
    client.async().x().tweets().search(params);

Configure Retries

The client retries eligible failures twice by default.

XTwitterScraperClient client = XTwitterScraperOkHttpClient.builder()
    .fromEnv()
    .maxRetries(4)
    .build();

Successful HTTP responses can contain structured API errors. Handle documented codes.

Read Raw Responses

Use withRawResponse() when you need headers or status codes:

import com.x_twitter_scraper.api.core.http.HttpResponseFor;
import com.x_twitter_scraper.api.models.account.AccountRetrieveResponse;

HttpResponseFor<AccountRetrieveResponse> response =
    client.account().withRawResponse().retrieve();

int status = response.statusCode();
AccountRetrieveResponse account = response.parse();

Binary endpoints return HttpResponse. Close each response after reading it.

Support

License

Apache License 2.0

Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.