Get Twitter Article - API Reference
Returns tweet with an article attached to it. Output contains the same properies as tweet details endpoint, article content is returned within “article” attribute of the response.
GET https://api.socialdata.tools/twitter/article/{article_id}
Headers
Authorization string required
Authorization Bearer header containing your SocialData API key
Example: Bearer YOUR_API_KEY
Parameters
article_id integer required
The numerical ID of the desired article tweet.
Example: 1799137410284134858
Code Examples
curl "https://api.socialdata.tools/twitter/article/1799137410284134858" -H 'Authorization: Bearer API_KEY' -H 'Accept: application/json'
const articleId = '1799137410284134858';const API_KEY = 'YOUR_API_KEY_HERE';
fetch(`https://api.socialdata.tools/twitter/article/${articleId}`, { method: 'GET', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Accept': 'application/json' }}).then(response => response.json()).then(response => console.log(response)).catch(err => console.error(err));
import requests
articleId = '1799137410284134858'API_KEY = 'YOUR_API_KEY_HERE'
url = f'https://api.socialdata.tools/twitter/article/{articleId}'
headers = { 'Authorization': f'Bearer {API_KEY}', 'Accept': 'application/json'}
response = requests.get(url, headers=headers)
if response.status_code == 200: data = response.json() print(data)else: print(f"Error: {response.status_code}") print(response.text)
$articleId = '1729591119699124560';$API_KEY = 'YOUR_API_KEY_HERE';
$url = "https://api.socialdata.tools/twitter/article/{$tweetId}";
$ch = curl_init();
curl_setopt_array($ch, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer $API_KEY", "Accept: application/json" ]]);
$response = curl_exec($ch);$data = json_decode($response, true);print_r($data);
curl_close($ch);
Example Responses
-
{ "status": "error", "message": "Insufficient balance"}
{ "status": "error", "message": "Tweet not found"}
{ "status": "error", "message": "Failed to fetch data from Twitter"}
Response Codes
- 200 OK - request succeeded
- 402 Payment Required - not enough credits to perform this request
- 404 Not Found - requested tweet does not exist
- 422 Unprocessable Content - validation failed (e.g. one of the required parameters was not provided)
- 500 Internal Error - API internal error, typically means that SocialData API failed to obtain the requested information and you should try again later