Get Twitter Space Details - API Reference
GET https://api.socialdata.tools/twitter/spaces/show?id={space_id}
Headers
Authorization string required
Authorization Bearer header containing your SocialData API key
Example: Bearer YOUR_API_KEY
Query Parameters
space_id string required
The ID of the desired Twitter Space.
Example: 1jMJgLdenVjxL
Code Examples
curl "https://api.socialdata.tools/spaces/show?id=1jMJgLdenVjxL" -H 'Authorization: Bearer API_KEY' -H 'Accept: application/json'
const id = '1jMJgLdenVjxL';const API_KEY = 'YOUR_API_KEY_HERE';
fetch(`https://api.socialdata.tools/spaces/show?id=${id}`, { 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
id = '1jMJgLdenVjxL'API_KEY = 'YOUR_API_KEY_HERE'
url = f'https://api.socialdata.tools/spaces/show?id={id}'
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)
$id = '1jMJgLdenVjxL';$API_KEY = 'YOUR_API_KEY_HERE';
$url = "https://api.socialdata.tools/spaces/show?id={$id}";
$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
{ "state": "Ended", "title": "The Algorithm goes open source", "media_key": "28_1641872499875930112", "created_at": 1680287883093, "scheduled_start": 1680289200000, "started_at": 1680289206898, "ended_at": "1680293477270", "updated_at": 1680293485413, "disallow_join": false, "narrow_cast_space_type": 0, "is_employee_only": false, "is_locked": false, "is_space_available_for_replay": true, "is_space_available_for_clipping": false, "conversation_controls": 0, "total_replay_watched": 1291373, "total_live_listeners": 435271, "id": "1jMJgLdenVjxL", "creator": { "id": "6844292", "affiliates_highlighted_label": { "label": { "url": { "url": "https:\/\/twitter.com\/X", "urlType": "DeepLink" }, "badge": { "url": "https:\/\/pbs.twimg.com\/profile_images\/1683899100922511378\/5lY42eHs_bigger.jpg" }, "description": "X", "userLabelType": "BusinessLabel", "userLabelDisplayType": "Badge" } }, "has_graduated_access": true, "is_blue_verified": true, "profile_image_shape": "Square", "legacy": { "can_dm": false, "can_media_tag": true, "created_at": "Sat Jun 16 00:14:36 +0000 2007", "default_profile": false, "default_profile_image": false, "description": "Updates from our Product and Infrastructure teams.", "entities": { "description": { "urls": [] } }, "fast_followers_count": 0, "favourites_count": 267, "followers_count": 1324928, "friends_count": 12, "has_custom_timelines": true, "is_translator": false, "listed_count": 4701, "location": "San Francisco", "media_count": 63, "name": "Engineering", "normal_followers_count": 1324928, "pinned_tweet_ids_str": [], "possibly_sensitive": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/6844292\/1690213191", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/1683502255574593536\/anU7i4uA_normal.jpg", "profile_interstitial_type": "", "screen_name": "XEng", "statuses_count": 905, "translator_type": "regular", "verified": false, "verified_type": "Business", "want_retweets": false, "withheld_in_countries": [] } }}
{ "status": "error", "message": "Insufficient balance"}
{ "status": "error", "message": "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 - Twitter space not found
- 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