SDKs & CLI
PostEverywhere provides a Node.js SDK, a CLI, and REST API access for any language. Pick the approach that fits your workflow.
Node.js SDK
Installation
npm install posteverywhere
Initialization
import { PostEverywhere } from 'posteverywhere';
const client = new PostEverywhere({
apiKey: process.env.POSTEVERYWHERE_API_KEY, // pe_live_...
});
caution
Never hard-code your API key. Use environment variables or a secrets manager. See Authentication for details.
List Connected Accounts
const { accounts } = await client.accounts.list();
for (const account of accounts) {
console.log(`${account.platform} — @${account.username} (${account.status})`);
}
Create and Schedule a Post
const post = await client.posts.create({
content: 'Just shipped a major update! Check it out at example.com',
accountIds: ['acc_123', 'acc_456'],
scheduleFor: '2026-04-07T14:00:00Z',
});
console.log(`Post ${post.id} scheduled for ${post.scheduledFor}`);
Platform-Specific Content
Customize content per platform using platformContent:
const post = await client.posts.create({
content: 'Default content for all platforms',
accountIds: ['acc_ig_123', 'acc_x_456', 'acc_li_789'],
platformContent: {
x: {
content: 'Short version for X (under 280 chars)',
},
linkedin: {
content: 'Longer, more detailed version for LinkedIn with professional tone...',
settings: { visibility: 'PUBLIC' },
},
instagram: {
content: 'Visual-first caption with #hashtags',
settings: { firstComment: 'Link in bio!' },
},
},
scheduleFor: '2026-04-07T14:00:00Z',
});
Upload Media
import fs from 'fs';
// Start an upload
const upload = await client.media.upload({
fileName: 'product-launch.jpg',
contentType: 'image/jpeg',
});
// Upload the file to the pre-signed URL
await fetch(upload.uploadUrl, {
method: 'PUT',
body: fs.readFileSync('./product-launch.jpg'),
headers: { 'Content-Type': 'image/jpeg' },
});
// Complete the upload
const media = await client.media.complete(upload.mediaId);
// Use it in a post
await client.posts.create({
content: 'Our new product is here!',
accountIds: ['acc_123'],
mediaIds: [media.id],
});
Bulk Schedule a Week of Posts
const posts = [
{ content: 'Monday motivation: ship fast, learn faster', scheduleFor: '2026-04-07T09:00:00Z' },
{ content: 'Tuesday tip: automate your social media with APIs', scheduleFor: '2026-04-08T09:00:00Z' },
{ content: 'Wednesday win: our users scheduled 10,000 posts last week', scheduleFor: '2026-04-09T09:00:00Z' },
{ content: 'Thursday thought: the best content strategy is consistency', scheduleFor: '2026-04-10T09:00:00Z' },
{ content: 'Friday launch: new API endpoints are live!', scheduleFor: '2026-04-11T09:00:00Z' },
];
const result = await client.posts.bulkSchedule({
accountIds: ['acc_123', 'acc_456'],
posts,
});
console.log(`Scheduled ${result.created} posts, ${result.failed} failed`);
Check Post Results
const results = await client.posts.getResults('post_789');
for (const dest of results.destinations) {
console.log(`${dest.platform}: ${dest.status}`);
if (dest.status === 'failed') {
console.log(` Error: ${dest.error}`);
}
}
CLI
The PostEverywhere CLI lets you manage posts and accounts from your terminal.
Authentication
# Set your API key
export POSTEVERYWHERE_API_KEY="pe_live_..."
# Or authenticate interactively
npx posteverywhere login
Common Commands
# List connected accounts
npx posteverywhere accounts
# Create a post (publishes immediately)
npx posteverywhere post "Just shipped v2.0!" --accounts acc_123,acc_456
# Schedule a post
npx posteverywhere schedule "Big announcement coming soon" \
--accounts acc_123,acc_456 \
--at "2026-04-07T14:00:00Z"
# Upload media
npx posteverywhere media upload ./banner.png
# List scheduled posts
npx posteverywhere posts --status scheduled
# Initialize a project config
npx posteverywhere init
CLI in CI/CD Pipelines
You can use the CLI in GitHub Actions or other CI pipelines to automate social media as part of your release process:
# .github/workflows/release.yml
- name: Announce release on social media
env:
POSTEVERYWHERE_API_KEY: ${{ secrets.POSTEVERYWHERE_API_KEY }}
run: |
npx posteverywhere post \
"v${{ github.event.release.tag_name }} is live! ${{ github.event.release.html_url }}" \
--accounts acc_x_123,acc_li_456
Python
A dedicated Python SDK is not yet available. In the meantime, you can call the REST API directly with requests:
import requests
import os
API_KEY = os.environ["POSTEVERYWHERE_API_KEY"]
BASE_URL = "https://app.posteverywhere.ai/api/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
# List accounts
accounts = requests.get(f"{BASE_URL}/accounts", headers=headers).json()
print(accounts["data"])
# Create a scheduled post
post = requests.post(
f"{BASE_URL}/posts",
headers=headers,
json={
"content": "Hello from Python!",
"accountIds": ["acc_123", "acc_456"],
"scheduleFor": "2026-04-07T14:00:00Z",
},
).json()
print(f"Post {post['data']['id']} scheduled")
cURL
For quick one-off requests or shell scripts:
# List accounts
curl https://app.posteverywhere.ai/api/v1/accounts \
-H "Authorization: Bearer $POSTEVERYWHERE_API_KEY"
# Create a post
curl -X POST https://app.posteverywhere.ai/api/v1/posts \
-H "Authorization: Bearer $POSTEVERYWHERE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Hello from cURL!",
"accountIds": ["acc_123"],
"scheduleFor": "2026-04-07T14:00:00Z"
}'
# Upload media (get pre-signed URL)
curl -X POST https://app.posteverywhere.ai/api/v1/media/upload \
-H "Authorization: Bearer $POSTEVERYWHERE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fileName": "photo.jpg", "contentType": "image/jpeg"}'
Next Steps
- Quick Start — Make your first API call in 5 minutes
- Authentication — API key scopes and security
- MCP Server — Use PostEverywhere from Claude, Cursor, or Windsurf
- API Reference — Full endpoint documentation