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
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'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
Authentication
Bearer API keys, server-to-server CORS policy, platform scopes, and IP allowlisting.
Errors & Envelope
Unified error envelope and complete catalog of error codes from OpenAPI.
Rate Limits
Token bucket capacities across key, organization, and upstream tiers.
Charge Policy
When requests are billed vs automatically released back to available balance.
Idempotency
Safe retries with Idempotency-Key and replay retention guarantees.
Endpoint Reference
| Method | Path | Summary |
|---|---|---|
| GET | /v1/instagram/user/profile | Authorized user profile data |
| GET | /v1/instagram/user/media | Paginated user media feed |
| GET | /v1/instagram/media/details | Media metadata and counters |
| GET | /v1/instagram/media/comments | Paginated media comments |
| GET | /v1/twitter/user/profile | X user profile lookup |
| GET | /v1/twitter/user/tweets | Paginated X user posts |
| GET | /v1/twitter/tweet/details | Single X post lookup |
| GET | /v1/twitter/search/recent | Recent X content search |