Tweets.Actions
Likes a specific tweet on behalf of the user associated with the provided cookie,$0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.LikeActionBody;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsLikeRequest;
import io.twexapi.sdk.models.operations.TweetsActionsLikeResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
TweetsActionsLikeRequest req = TweetsActionsLikeRequest.builder()
.tweetId("<id>")
.body(LikeActionBody.builder()
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.proxy("http://username:password@ip:port")
.build())
.build();
TweetsActionsLikeResponse res = sdk.tweets().actions().like()
.request(req)
.call();
if (res.tweetActionResponse().isPresent()) {
System.out.println(res.tweetActionResponse().get());
}
}
}
TweetsActionsLikeResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Unlike a tweet, $0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.UnfavoriteTweetQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsUnlikeRequest;
import io.twexapi.sdk.models.operations.TweetsActionsUnlikeResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
TweetsActionsUnlikeRequest req = TweetsActionsUnlikeRequest.builder()
.tweetId("<id>")
.body(UnfavoriteTweetQuery.builder()
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.build())
.build();
TweetsActionsUnlikeResponse res = sdk.tweets().actions().unlike()
.request(req)
.call();
if (res.tweetActionResponse().isPresent()) {
System.out.println(res.tweetActionResponse().get());
}
}
}
TweetsActionsUnlikeResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
retweet
Retweets a specific tweet on behalf of the user associated with the provided cookie,$0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.RetweetActionBody;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsRetweetRequest;
import io.twexapi.sdk.models.operations.TweetsActionsRetweetResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
TweetsActionsRetweetRequest req = TweetsActionsRetweetRequest.builder()
.tweetId("<id>")
.body(RetweetActionBody.builder()
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.proxy("http://username:password@ip:port")
.build())
.build();
TweetsActionsRetweetResponse res = sdk.tweets().actions().retweet()
.request(req)
.call();
if (res.tweetActionResponse().isPresent()) {
System.out.println(res.tweetActionResponse().get());
}
}
}
TweetsActionsRetweetResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
unretweet
Delete a retweet, $0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.DeleteRetweetQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsUnretweetRequest;
import io.twexapi.sdk.models.operations.TweetsActionsUnretweetResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
TweetsActionsUnretweetRequest req = TweetsActionsUnretweetRequest.builder()
.tweetId("<id>")
.body(DeleteRetweetQuery.builder()
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.build())
.build();
TweetsActionsUnretweetResponse res = sdk.tweets().actions().unretweet()
.request(req)
.call();
if (res.tweetActionResponse().isPresent()) {
System.out.println(res.tweetActionResponse().get());
}
}
}
TweetsActionsUnretweetResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Create a tweet thread from an ordered list of texts, $0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.CreateThreadQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsCreateThreadResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CreateThreadQuery req = CreateThreadQuery.builder()
.items(List.of(
"1/ hello",
"2/ world"))
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.proxy("http://username:password@ip:port")
.build();
TweetsActionsCreateThreadResponse res = sdk.tweets().actions().createThread()
.request(req)
.call();
if (res.createThreadResponse().isPresent()) {
System.out.println(res.createThreadResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
CreateThreadQuery |
✔️ |
The request object to use for the request. |
TweetsActionsCreateThreadResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Posts a new tweet. To create a reply, provide the reply_tweet_id. This endpoint does not handle quote tweets,$0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.PostTweetQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsCreateResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
PostTweetQuery req = PostTweetQuery.builder()
.tweetContent("Hello, Twitter! 🐦")
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.mediaUrl("https://example.com/image.jpg")
.mediaUrls(List.of(
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"))
.delegatedAccountUsername("elonmusk")
.schedule("2024-01-01T12:00:00Z")
.replyTweetId("1234567890123456789")
.communityName("Python Developers or 1234567890123456789")
.proxy("http://username:password@ip:port")
.build();
TweetsActionsCreateResponse res = sdk.tweets().actions().create()
.request(req)
.call();
if (res.postTweetResponse().isPresent()) {
System.out.println(res.postTweetResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
PostTweetQuery |
✔️ |
The request object to use for the request. |
TweetsActionsCreateResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Posts a new tweet that quotes an existing tweet. Requires the URL of the tweet to be quoted and the new content,$0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.QuoteTweetQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsQuoteResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
QuoteTweetQuery req = QuoteTweetQuery.builder()
.tweetContent("Hello, Twitter! 🐦")
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.mediaUrl("https://example.com/image.jpg")
.mediaUrls(List.of(
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"))
.delegatedAccountUsername("elonmusk")
.communityName("Python Developers or 1234567890123456789")
.quoteTweetUrl("https://twitter.com/user/status/1234567890123456789")
.proxy("http://username:password@ip:port")
.build();
TweetsActionsQuoteResponse res = sdk.tweets().actions().quote()
.request(req)
.call();
if (res.postTweetResponse().isPresent()) {
System.out.println(res.postTweetResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
QuoteTweetQuery |
✔️ |
The request object to use for the request. |
TweetsActionsQuoteResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Post a tweet using a random cookie from the pool, cookie management
$0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.PostTweetWithoutCookieQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsCreateWithoutCookieResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
PostTweetWithoutCookieQuery req = PostTweetWithoutCookieQuery.builder()
.tweetContent("Hello, Twitter! 🐦")
.mediaUrl("https://example.com/image.jpg")
.mediaUrls(List.of(
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"))
.schedule("2024-01-01T12:00:00Z")
.replyTweetId("1234567890123456789")
.communityName("Python Developers or 1234567890123456789")
.quoteTweetUrl("https://twitter.com/user/status/1234567890123456789")
.build();
TweetsActionsCreateWithoutCookieResponse res = sdk.tweets().actions().createWithoutCookie()
.request(req)
.call();
if (res.postTweetResponse().isPresent()) {
System.out.println(res.postTweetResponse().get());
}
}
}
TweetsActionsCreateWithoutCookieResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Adds a specific tweet to the bookmarks of the user associated with the provided cookie,$0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.BookmarkBody;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsBookmarkRequest;
import io.twexapi.sdk.models.operations.TweetsActionsBookmarkResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
TweetsActionsBookmarkRequest req = TweetsActionsBookmarkRequest.builder()
.tweetId("<id>")
.body(BookmarkBody.builder()
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.proxy("http://username:password@ip:port")
.build())
.build();
TweetsActionsBookmarkResponse res = sdk.tweets().actions().bookmark()
.request(req)
.call();
if (res.tweetActionResponse().isPresent()) {
System.out.println(res.tweetActionResponse().get());
}
}
}
TweetsActionsBookmarkResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Delete a bookmark, $0.001 per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.DeleteBookmarkQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsUnbookmarkRequest;
import io.twexapi.sdk.models.operations.TweetsActionsUnbookmarkResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
TweetsActionsUnbookmarkRequest req = TweetsActionsUnbookmarkRequest.builder()
.tweetId("<id>")
.body(DeleteBookmarkQuery.builder()
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.build())
.build();
TweetsActionsUnbookmarkResponse res = sdk.tweets().actions().unbookmark()
.request(req)
.call();
if (res.tweetActionResponse().isPresent()) {
System.out.println(res.tweetActionResponse().get());
}
}
}
TweetsActionsUnbookmarkResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Deletes one or more tweets from a specified user account. This endpoint supports two modes:
- Single Tweet Deletion: Provide a
target_id to delete a specific tweet.
- Bulk Deletion: Omit the
target_id to delete all tweets from the user's account.
Warning: The bulk deletion mode is irreversible and will permanently remove all tweets from the account. Use with extreme caution.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.DeleteTweetQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.TweetsActionsDeleteBatchResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
DeleteTweetQuery req = DeleteTweetQuery.builder()
.cookie("ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7")
.username("myusername")
.targetId("1234567890123456789")
.build();
TweetsActionsDeleteBatchResponse res = sdk.tweets().actions().deleteBatch()
.request(req)
.call();
if (res.deleteTweetResponse().isPresent()) {
System.out.println(res.deleteTweetResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
DeleteTweetQuery |
✔️ |
The request object to use for the request. |
TweetsActionsDeleteBatchResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |