Post with PHP

Post to social media
with PHP.

PostLake is one REST endpoint for every social network, so from PHP you post with a single cURL call — no per-platform SDK, no OAuth code, one normalised response back.

Get started free →

No card for the free tier · one API for every network · full MCP access

The fastest way: ask your agent

Prefer no code at all? Connect PostLake's hosted MCP server to your AI assistant (Claude, ChatGPT, Cursor and others) and just ask it to post. It authorizes over OAuth — no key to paste. See the MCP guide.

Post with PHP

This is the whole integration — connect your accounts once in the dashboard, then:

<?php
$ch = curl_init("https://api.postlake.dev/v1/posts");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_API_KEY",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "text" => "Hello from PHP 👋",
        "platforms" => ["bluesky", "linkedin"],
        "profile" => "my-brand",
    ]),
]);
echo curl_exec($ch); // one post id + a targets list with live URLs

Step by step

  1. Create an API key in your dashboard (Settings → API Keys).
  2. Connect your accounts under a profile once, in the dashboard.
  3. POST to /v1/posts with cURL (or Guzzle) — the example above is the whole integration.
  4. Read the normalised response: a post id and a targets array with each network's live URL.

Good to know

Why PostLake

One call, every network

List the platforms in one request and PostLake posts to all of them, returning a single normalised shape — your code never branches per platform.

No app setup

PostLake manages each network's developer app and OAuth for you — nothing to register or get reviewed yourself.

Agent-safe

Idempotency keys mean a retry never double-posts, and analytics come back normalised so an agent can decide what to post next.

Honest pricing

A free tier to start, then usage-based credits — one per post. You only pay for posts that actually publish.

Common questions

How do I post to social media with PHP?

Send a POST request to PostLake's /v1/posts endpoint with cURL (or Guzzle), passing your API key and the platforms. One call publishes to every listed network and returns a single normalised response.

Do I need a package for each social network in PHP?

No — one cURL call to PostLake covers every network, so there's no per-platform PHP SDK to install or maintain.

Can I schedule posts from PHP?

Yes — include a scheduledAt timestamp in the JSON body and PostLake publishes at that time, with a webhook on the result.

More guides

Python · Node.js · n8n · Make · Zapier · All guides · Full docs

One API and MCP server for every major network. Free to start.

Get started free →