GRAML SOCIAL API

Complete documentation for integrating with our services

Base URL
https://gramlsocial.com/api/v1/
Authentication

All API requests require an API key. Include it in the request headers:

X-API-Key: your_api_key_here
Get Your API Key

API Endpoints

GET /health

Check if the API is operational (no authentication required).

Example:
curl https://gramlsocial.com/api/v1/health
Response:
{
  "status": "success",
  "data": {
    "healthy": true,
    "time": "2026-05-02 08:37:14"
  }
}
GET /products

Retrieve all available products with real-time stock levels.

Parameters: Example:
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://gramlsocial.com/api/v1/products?limit=10"
Response:
{
  "status": "success",
  "data": [
    {
      "id": 1468,
      "name": "X(TWITTER) CREATED AROUND 1 MONTH",
      "price": 500,
      "stock": 185,
      "price_formatted": "₦500.00"
    }
  ]
}
GET /my/balance

View your wallet balance in Nigerian Naira (₦).

Example:
curl -H "X-API-Key: YOUR_API_KEY" \
  https://gramlsocial.com/api/v1/my/balance
Response:
{
  "status": "success",
  "data": {
    "balance": 8500.50,
    "currency": "NGN",
    "balance_formatted": "₦8,500.50",
    "username": "Rxpress12"
  }
}
POST /purchase

Purchase a product using your wallet balance. Account details delivered instantly.

Request Body:
{
  "product_id": 1468,
  "quantity": 1
}
Example:
curl -X POST \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":1468,"quantity":1}' \
  https://gramlsocial.com/api/v1/purchase
Response (Success):
{
  "status": "success",
  "message": "Purchase successful",
  "data": {
    "order_id": 42920,
    "transaction_id": "API-69F5B7BAA10B6-1777711034",
    "product": {
      "id": 1468,
      "name": "X(TWITTER) CREATED AROUND 1 MONTH",
      "price": 500
    },
    "quantity": 1,
    "total": 500,
    "total_formatted": "₦500.00",
    "balance_remaining": 8500.50,
    "balance_formatted": "₦8,500.50",
    "accounts": ["username:password@email.com:password"]
  }
}
GET /my/orders

Retrieve your purchase history.

Parameters: Example:
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://gramlsocial.com/api/v1/my/orders?limit=10"

Code Examples

PHP Example
<?php
class GramlSocialAPI {
    private $apiKey;
    private $baseUrl = 'https://gramlsocial.com/api/v1/';
    
    public function __construct($apiKey) {
        $this->apiKey = $apiKey;
    }
    
    private function request($endpoint, $method = 'GET', $data = null) {
        $ch = curl_init($this->baseUrl . $endpoint);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, [
            'X-API-Key: ' . $this->apiKey,
            'Content-Type: application/json'
        ]);
        
        if ($method == 'POST' && $data) {
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        }
        
        return json_decode(curl_exec($ch), true);
    }
    
    public function getBalance() {
        return $this->request('my/balance');
    }
    
    public function getProducts($limit = 50) {
        return $this->request("products?limit=$limit");
    }
    
    public function purchase($productId, $quantity = 1) {
        return $this->request('purchase', 'POST', [
            'product_id' => $productId,
            'quantity' => $quantity
        ]);
    }
    
    public function getOrders($limit = 20) {
        return $this->request("my/orders?limit=$limit");
    }
}

// Usage
$api = new GramlSocialAPI('YOUR_API_KEY');
$balance = $api->getBalance();
echo $balance['data']['balance_formatted'];
?>
Python Example
import requests

class GramlSocialAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://gramlsocial.com/api/v1/"
        self.headers = {"X-API-Key": api_key}
    
    def get_balance(self):
        response = requests.get(f"{self.base_url}my/balance", headers=self.headers)
        return response.json()
    
    def get_products(self, limit=50):
        response = requests.get(f"{self.base_url}products?limit={limit}", headers=self.headers)
        return response.json()
    
    def purchase(self, product_id, quantity=1):
        data = {"product_id": product_id, "quantity": quantity}
        response = requests.post(f"{self.base_url}purchase", headers=self.headers, json=data)
        return response.json()
    
    def get_orders(self, limit=20):
        response = requests.get(f"{self.base_url}my/orders?limit={limit}", headers=self.headers)
        return response.json()

# Usage
api = GramlSocialAPI("YOUR_API_KEY")
balance = api.get_balance()
print(balance['data']['balance_formatted'])
Error Codes
Back to API Management Print Documentation