Learn how to authenticate your API requests using API keys
x-api-key
Authorization: Bearer YOUR_API_KEY
curl --request GET \ --url 'https://api.twitterxapi.com/twitter/users?usernames=elonmusk' \ --header 'Authorization: Bearer YOUR_API_KEY'
import requests url = "https://api.twitterxapi.com/twitter/users" querystring = {"usernames":"elonmusk"} headers = {"Authorization": "Bearer YOUR_API_KEY"} response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
const options = { method: 'GET', headers: { Authorization: 'Bearer YOUR_API_KEY' } }; fetch('https://api.twitterxapi.com/twitter/users?usernames=elonmusk', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
HttpResponse<String> response = Unirest.get("https://api.twitterxapi.com/twitter/users?usernames=elonmusk") .header("Authorization", "Bearer YOUR_API_KEY") .asString();