- fetch - Batch Fetch X Articles
- markdown - Fetch Article as Markdown
Retrieves detailed article content for a specified list of X (Twitter) IDs. Use this endpoint to fetch full text, metadata, and media links for multiple posts in a single request. The maximum input quantity is limited by your plan's QPS. To pass larger input quantity limits, upgrade your plan to get higher QPS.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ArticlesFetchResponse;
import java.lang.Exception;
import java.lang.String;
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();
List<String> req = List.of(
"1803006263529541838");
ArticlesFetchResponse res = sdk.articles().fetch()
.request(req)
.call();
if (res.xArticleResponse().isPresent()) {
System.out.println(res.xArticleResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
List |
✔️ |
The request object to use for the request. |
ArticlesFetchResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |
Retrieves the content of an X (Twitter) article formatted as clean, valid Markdown. The response body is delivered as a raw UTF-8 string, optimized for direct import into static site generators, Obsidian, Notion, or any standard Markdown editor.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ArticlesMarkdownRequest;
import io.twexapi.sdk.models.operations.ArticlesMarkdownResponse;
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();
ArticlesMarkdownRequest req = ArticlesMarkdownRequest.builder()
.tweetId("<id>")
.build();
ArticlesMarkdownResponse res = sdk.articles().markdown()
.request(req)
.call();
if (res.res().isPresent()) {
System.out.println(res.res().get());
}
}
}
ArticlesMarkdownResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |