GET /v1/crawl/x/tweet
X (Twitter) tweet API: text, author and likes by tweet id
Send a numeric tweet id in id and get the tweet's text, author name and handle, like count, language and creation date, read from X's public syndication CDN.
- Price
- $0.0005 per call
- Batch
- Yes, through /v1/batch
- Failed calls
- Not charged
Example request
curl
curl 'https://api.virev.ai/v1/crawl/x/tweet?id=20' \
-H "Authorization: Bearer $VIREV_API_KEY"python
import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/crawl/x/tweet",
params={
"id": "20",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | query | string | The numeric tweet id. |
Example response
The example response of the API reference.
json
{
"data": {
"final_url": "https://cdn.syndication.twimg.com/tweet-result?id=20&token=a",
"status": 200,
"content_type": "application/json; charset=utf-8",
"payload_kind": "json",
"response_headers": {
"etag": "W/\"398-ZPvV33LRPRUKP5O5F0oixrLN/qE\"",
"content-type": "application/json; charset=utf-8",
"cache-control": "must-revalidate, max-age=60"
},
"body": {
"__typename": "Tweet",
"favorite_count": 307521,
"lang": "en",
"created_at": "2006-03-21T20:50:14.000Z",
"display_text_range": [
0,
24
],
"entities": {},
"id_str": "20",
"text": "just setting up my twttr",
"user": {
"id_str": "12",
"name": "jack",
"screen_name": "jack",
"is_blue_verified": true,
"profile_image_shape": "Circle",
"verified": false,
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1661201415899951105/azNjKOSH_normal.jpg",
"highlighted_label": {
"badge": {
"url": "https://pbs.twimg.com/profile_images/1285655593592791040/HtwPZgej_bigger.jpg"
},
"description": "Square",
"url": {
"url": "https://twitter.com/Square",
"url_type": "DeepLink"
},
"user_label_display_type": "Badge",
"user_label_type": "BusinessLabel"
}
},
"edit_control": {
"edit_tweet_ids": [
"20"
],
"editable_until_msecs": "1142976014000",
"edits_remaining": "5",
"is_edit_eligible": true
},
"conversation_count": 17962,
"news_action_type": "conversation",
"isEdited": false,
"isStaleEdit": false
},
"extracted": {
"values": {
"text": "just setting up my twttr",
"likes": 307521,
"author": "jack",
"name": "jack",
"created": "2006-03-21T20:50:14.000Z"
},
"errors": []
}
},
"meta": {
"cost": "$0.0005",
"balance": "$3.0725",
"request_id": "req_e504efc1059c0ccd0bcea15edccca9fa"
}
}How it works
One tweet by numeric id — text, author, like count, and created date — via the public syndication CDN.
Errors
| Status | When |
|---|---|
400 | The request parameters are invalid. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
404 | The page does not exist: its site answered 404 or 410 for this input. You are not charged. |
429 | Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged. |
502 | The upstream fetch failed. You are not charged. |
503 | Billing could not be confirmed, so no upstream data was returned. |
504 | The upstream request timed out. You are not charged. |