bun i simplewrap
Get an easy to use API + SDK for posting and reading from X. Build powerful social media integrations with simple, developer-friendly tools.
https://simplewrap.dev
Post a tweet to Twitter with optional media attachments
/api/v1/x/post
{
"text": "Hello from SimpleWrap API! 🚀"
}
{
"text": "Check out this image! 📸",
"media": [
{
"type": "base64",
"data": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...",
"mediaType": "image/jpeg"
}
]
}
{
"text": "Amazing photo! 🌟",
"media": [
{
"type": "url",
"data": "https://example.com/image.jpg",
"mediaType": "image/jpeg"
}
]
}
{
"text": "Photo gallery! 📷",
"media": [
{
"type": "url",
"data": "https://example.com/photo1.jpg"
},
{
"type": "base64",
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
]
}
{
"success": true,
"data": {
"id": "1234567890123456789",
"text": "Hello from SimpleWrap API! 🚀",
"created_at": "2025-01-27T10:30:00.000Z",
"status": "posted",
"user_id": "user_123",
"media_count": 0
},
"message": "Tweet posted successfully"
}
{
"error": "Twitter authentication failed",
"message": "Your Twitter access token has expired. Please reconnect your Twitter account.",
"code": "TWITTER_AUTH_EXPIRED"
}
{
"error": "Maximum 4 media items allowed per tweet"
}
{
"error": "Cannot mix images and videos in the same tweet"
}
Check if your Twitter tokens are still valid
/api/v1/x/validate-tokens
Use this endpoint to:
{
"success": true,
"data": {
"valid": true,
"user": {
"id": "1234567890",
"username": "your_username",
"name": "Your Display Name"
}
}
}
{
"success": true,
"data": {
"valid": false,
"error": "Token validation failed",
"user": null
}
}