DocsForAI Social Buddy
Pricing
from $0.01 / 1,000 results
Pricing
from $0.01 / 1,000 results
Rating
0.0
(0)
Developer

Pratik Parmar
Actor stats
0
Bookmarked
2
Total users
0
Monthly active users
4 days ago
Last modified
Categories
Share
🚀 Social Media Post Generator (DocsForAI)
Transform your blog posts and tutorials into engaging X (Twitter) posts with AI-generated images!
This Apify Actor uses Google Gemini AI to create compelling social media content and Flux.2 to generate eye-catching visuals from your markdown content. Perfect for developers, technical writers, and content creators who want to promote their work on social media.
Built with:
- 🤖 Google Gemini 2.5 Pro for content generation
- 🎨 Flux.2 dev model for image generation
- 🐦 X (Twitter) API v2 for auto-posting
- ⚡ Apify SDK for Python
✨ Features
- 🤖 AI-Powered Content Generation - Uses Google Gemini 2.5 Pro to create engaging posts (max 240 characters)
- 🎨 AI Image Generation - Creates professional visuals using Flux.2 dev model
- 🐦 Auto-Post to X (Twitter) - Optionally publishes your content directly to X with images
- 💰 Pay-Per-Event Pricing - Flexible monetization with charges for post generation, image creation, and X posting
- 📊 Structured Output - Saves results to dataset with base64 images for easy viewing
- 🔐 Secure Credentials - API keys stored securely as secrets
🚀 How it works
- Input: Provide your markdown blog/tutorial content
- AI Analysis: Gemini AI analyzes the content and creates:
- A compelling X post (strictly under 240 characters)
- A detailed image generation prompt
- Image Generation: Flux.2 creates a professional image based on the prompt
- Storage: Saves the post content and image to Apify's dataset and key-value store
- Publishing (Optional): Posts to X (Twitter) with the generated image
📥 Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
markdownContent | string | ✅ Yes | Your blog or tutorial content in markdown format |
postToX | boolean | ❌ No | Enable automatic posting to X (Twitter). Default: false |
xApiKey | string | ⚠️ If posting | Your X API Key (Consumer Key) |
xApiSecretKey | string | ⚠️ If posting | Your X API Secret Key (Consumer Secret) |
xAccessToken | string | ⚠️ If posting | Your X Access Token |
xAccessTokenSecret | string | ⚠️ If posting | Your X Access Token Secret |
📤 Output
The Actor outputs a dataset with the following fields:
postContent- Generated X post text (max 240 chars)imageBase64- Base64-encoded image for displayimageUrl- URL to the image in key-value storeimageKey- Unique UUID filename of the imagemarkdownPreview- First 200 characters of source contenttweetUrl- Direct link to posted tweet (ifpostToXenabled)tweetId- X post ID (if posted)posted- Boolean indicating if posting succeeded
💵 Pricing
This Actor uses pay-per-event pricing:
- Post Generation: $0.10 per post
- Image Generation: $0.10 per image
- X Posting: $0.10 per post (when enabled)
Total per run: $0.20 (without X posting) or $0.30 (with X posting)
🔑 Getting X API Credentials
To enable posting to X:
- Go to developer.x.com
- Create a new app or use an existing one
- Navigate to your app's "Keys and tokens" section
- Generate and copy:
- API Key (Consumer Key)
- API Secret Key (Consumer Secret)
- Access Token
- Access Token Secret
- Ensure your app has Read and Write permissions
🧪 Testing Locally
Basic Test (Without X Posting)
# Install dependenciesuv pip install -r requirements.txt# Run the Actorapify run
Test with X Posting
- Update
storage/key_value_stores/default/INPUT.json:
{"markdownContent": "# Your Blog Title\n\nYour content here...","postToX": true,"xApiKey": "your_api_key","xApiSecretKey": "your_api_secret","xAccessToken": "your_access_token","xAccessTokenSecret": "your_access_token_secret"}
- Run:
$apify run
Test Pay-Per-Event Charging
$ACTOR_TEST_PAY_PER_EVENT=true apify run
This logs charging events to storage/datasets/charging-log/
📋 Example Usage
Input Example
{"markdownContent": "# Getting Started with Web Scraping\n\nLearn how to build powerful web scrapers...","postToX": false}
Output Example
{"postContent": "🚀 New tutorial: Master web scraping with Python! Learn to extract data at scale, monitor competitors & build ML datasets. Perfect for beginners! #WebScraping #Python #DataScience","imageBase64": "iVBORw0KGgoAAAANSUhEUgAA...","imageUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/uuid.png","imageKey": "550e8400-e29b-41d4-a716-446655440000.png","markdownPreview": "# Getting Started with Web Scraping\n\nWeb scraping is the process of extracting data from websites automatically...","tweetUrl": null,"tweetId": null,"posted": false}
📂 Check Results
After running:
# View the outputcat storage/datasets/default/000000001.json | jq# Find generated imagesls storage/key_value_stores/default/*.png# View post content onlycat storage/datasets/default/000000001.json | jq '.postContent'
🚀 Deploy to Apify
Method 1: Connect Git Repository
- Go to Actor creation page
- Click on Link Git Repository button
- Connect your GitHub repository
- Configure pay-per-event pricing in Actor settings:
- Event:
post-generation→ Price: $0.10 - Event:
image-generation→ Price: $0.10 - Event:
x-post→ Price: $0.10
- Event:
Method 2: Push from Local Machine
-
Login to Apify:
$apify login -
Deploy your Actor:
$apify push -
Configure Pricing in the Apify Console:
- Go to your Actor → Settings → Monetization
- Select "Pay-per-event" pricing model
- Add the three events with their prices
After Deployment
The Actor will be available at: https://console.apify.com/actors/<your-actor-id>
Users can run it via:
- Apify Console UI
- Apify API
- Apify Client
🔧 Dependencies
apify- Apify SDK for Pythonrequests- HTTP library for API callsgoogle-genai- Google Gemini AI SDKtweepy- X (Twitter) API clientcrawlee- Web scraping framework
📚 Documentation & Resources
Actor-Specific
Apify Platform
⚠️ Important Notes
- Character Limit: Posts are strictly limited to 240 characters for X compatibility
- X API Access: Requires X Developer account with Elevated access to post tweets
- Rate Limits: Be mindful of X API rate limits when posting frequently
- Credentials Security: All API keys are marked as secrets in the input schema
- Local Testing: Charging events are logged but not processed when running locally
🤝 Contributing
Feel free to submit issues, create pull requests, or suggest improvements!
📄 License
This Actor is provided as-is under the Apify platform terms.