OpenAPI 3.1.0v0.2.0

SocialAPI Documentation

Build server-to-server integrations against a unified Instagram and X (Twitter) REST gateway with deterministic JSON envelopes and prepaid micro-USD billing.

Base URL

https://api.socialapi.tr

All public gateway endpoints are served over HTTPS at api.socialapi.tr. Browser cross-origin requests are blocked (CORS denied).

Make Your First Request

Authenticate with a Bearer sapi_live_ key from your dashboard and parse the standard response envelope.

curl 'https://api.socialapi.tr/v1/twitter/user/profile?username=sample_dev' \
  -H 'Authorization: Bearer sapi_live_REPLACE_ME'
Replace sapi_live_REPLACE_ME with a server-side key. Never expose API keys in browser code.

Response Envelope

Every gateway response wraps data or error alongside a trace request_id and billing metadata.

{
  "success": true,
  "data": {
    "synthetic": true,
    "id": "x_user_0123456789",
    "username": "sample_dev",
    "display_name": "Sample sample_dev",
    "description": "Synthetic X profile for deterministic mock mode.",
    "followers_count": 8400,
    "following_count": 215,
    "tweet_count": 412,
    "verified": true,
    "created_at": "2022-05-01T00:00:00Z"
  },
  "meta": {
    "request_id": "req_01syntheticexample",
    "platform": "twitter",
    "cached": false,
    "replayed": false,
    "billing": {
      "request_id": "2c91b99a-4d7c-4f21-b8b0-1234567890af",
      "amount": "0.0020",
      "currency": "USD",
      "status": "charged"
    }
  }
}

Core Platform Concepts

Endpoint Reference

MethodPathSummary
GET/v1/instagram/user/profileAuthorized user profile data
GET/v1/instagram/user/mediaPaginated user media feed
GET/v1/instagram/media/detailsMedia metadata and counters
GET/v1/instagram/media/commentsPaginated media comments
GET/v1/twitter/user/profileX user profile lookup
GET/v1/twitter/user/tweetsPaginated X user posts
GET/v1/twitter/tweet/detailsSingle X post lookup
GET/v1/twitter/search/recentRecent X content search