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.

API & SDK Documentation

Base URL:
https://simplewrap.dev

Posting a Tweet

Post a tweet to Twitter with optional media attachments

Media Requirements
  • Images: JPEG, PNG, GIF, WEBP (max 5MB each)
  • Videos: MP4 (max 512MB, up to 2min 20sec)
  • Limits: Max 4 images OR 1 video per tweet (Cannot mix images and videos in same tweet)
  • Types: Base64 encoded data or public URLs

Endpoint

POST
/api/v1/x/post

Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Payload Examples

Text only:
{
  "text": "Hello from SimpleWrap API! 🚀"
}
With base64 image:
{
  "text": "Check out this image! 📸",
  "media": [
    {
      "type": "base64",
      "data": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...",
      "mediaType": "image/jpeg"
    }
  ]
}
With image URL:
{
  "text": "Amazing photo! 🌟",
  "media": [
    {
      "type": "url",
      "data": "https://example.com/image.jpg",
      "mediaType": "image/jpeg"
    }
  ]
}
Multiple images (max 4):
{
  "text": "Photo gallery! 📷",
  "media": [
    {
      "type": "url",
      "data": "https://example.com/photo1.jpg"
    },
    {
      "type": "base64",
      "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}

Responses

200 - Success
{
  "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"
}
401 - Twitter Auth Expired
{
  "error": "Twitter authentication failed",
  "message": "Your Twitter access token has expired. Please reconnect your Twitter account.",
  "code": "TWITTER_AUTH_EXPIRED"
}
400 - Validation Error
{
  "error": "Maximum 4 media items allowed per tweet"
}
400 - Media Error
{
  "error": "Cannot mix images and videos in the same tweet"
}

Validating Tokens (X)

Check if your Twitter tokens are still valid

Endpoint

GET
/api/v1/x/validate-tokens

Headers

Authorization: Bearer YOUR_API_KEY

Use this endpoint to:

  • • Check if Twitter tokens are still valid
  • • Get current Twitter user info
  • • Debug authentication issues

Response

200 - Success
{
  "success": true,
  "data": {
    "valid": true,
    "user": {
      "id": "1234567890",
      "username": "your_username",
      "name": "Your Display Name"
    }
  }
}
200 - Invalid Tokens
{
  "success": true,
  "data": {
    "valid": false,
    "error": "Token validation failed",
    "user": null
  }
}
SimpleWrap - Easy Twitter API & SDK