- 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.
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.articles.fetch(request=[
"1803006263529541838",
])
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
request |
List[str] |
✔️ |
The request object to use for the request. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.XArticleResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
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.
import os
from x_api_scraper import XapiScraper
with XapiScraper(
bearer_auth=os.getenv("X_API_SCRAPER_BEARER_AUTH", ""),
) as xapi_scraper:
res = xapi_scraper.articles.markdown(tweet_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
tweet_id |
str |
✔️ |
The tweet ID of the article to get. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
str
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.XapiScraperDefaultError |
4XX, 5XX |
*/* |